NXP NFC Reader Library v4.040.05.011646

Modules | Functions
ICode SLI
Application Layer

These Components implement the ICode SLI commands. More...

Collaboration diagram for ICode SLI:

## Modules
| Component : Software

## Functions
phStatus_t | phalSli_GetRandomNumber (void *pDataParams, uint8_t *pRnd)
| This command generates a random number from the label IC. More...
phStatus_t | phalSli_SetPWD (void *pDataParams, uint8_t bPwdIdentifier, uint8_t *pXorPwd)
| This command transmits different passwords to the label to get access to protected functionalities. More...
phStatus_t | phalSli_WritePWD (void *pDataParams, uint8_t bPwdIdentifier, uint8_t *pPwd)
| With this command, a new password is written into the related memory. More...
phStatus_t | phalSli_LockPWD (void *pDataParams, uint8_t bPwdIdentifier)
| This command locks the addressed password. More...
phStatus_t | phalSli_64BitPWDProtection (void *pDataParams)
| This instructs the label that both of the Read and Write passwords are required for protected access. More...
phStatus_t | phalSli_ProtectPage (void *pDataParams, uint8_t bPageNo, uint8_t bProtectionStatus)
| This command changes the protection status of a page. More...
phStatus_t | phalSli_LockPageProtectionCondition (void *pDataParams, uint8_t bPageNo)
| This command permanenty locks the protection status of a page. More...
phStatus_t | phalSli_GetMultipleBlockProtStatus (void *pDataParams, uint8_t bBlockNo, uint16_t wNumBlocks, uint8_t *pProtectionStates, uint8_t *pNumReceivedStates)
| This instructs the label to return the block protection status of the requested blocks. More...
phStatus_t | phalSli_Destroy (void *pDataParams)
| This command permanently destroys the label. More...
phStatus_t | phalSli_EnablePrivacy (void *pDataParams)
| This command instructs the label to enter privacy mode. More...
phStatus_t | phalSli_ReadSignature (void *pDataParams, uint8_t *pSignature)
| The command returns an IC specific, 32-byte ECC signature, to verify NXP Semiconductors as the silicon vendor. More...
phStatus_t | phalSli_SetEAS (void *pDataParams)
| This command enables the EAS mode if the EAS mode is not locked. More...
phStatus_t | phalSli_ResetEAS (void *pDataParams)
| This command disables the EAS mode if the EAS mode is not locked. More...
phStatus_t | phalSli_LockEAS (void *pDataParams)
| This command locks the current state of the EAS mode and the EAS ID. More...
phStatus_t | phalSli_EASAlarm (void *pDataParams, uint8_t bOption, uint8_t *pEasIdValue, uint8_t bEasIdMaskLength, uint8_t *pEas)
| This command returns the EAS sequence if the EAS mode is enabled. More...
phStatus_t | phalSli_PwdProtectEAS (void *pDataParams)
| This command enables the password protection for EAS. More...
phStatus_t | phalSli_WriteEAS_ID (void *pDataParams, uint8_t *pEasIdValue)
| With this command, a new EAS identifier is stored in the corresponding configuration memory. More...
phStatus_t | phalSli_ReadEPC (void *pDataParams, uint8_t *pEpc)
| On this command, the label will respond with it's EPC data. More...
phStatus_t | phalSli_GetNxpSystemInfo (void *pDataParams, uint8_t *pProtectionPointer, uint8_t *pProtectionCondition, uint8_t *pLockBits, uint8_t *pFeatureFlags)
| The command provides information about IC access conditions and supported features. More...
phStatus_t | phalSli_GetRandomNumberSetPWD (void *pDataParams, uint8_t bPwdIdentifier, uint8_t *pPwd)
| Get random number and set password using this random number and provided password. More...

## Options
#define | PHAL_SLI_OPTION_OFF PH_OFF
| Option Bit is cleared. More...
#define | PHAL_SLI_OPTION_ON PH_ON
| Option Bit is set. More...
#define | PHAL_SLI_OPTION_DEFAULT PHAL_SLI_OPTION_OFF
| Default Option. More...

## Block definitions
#define | PHAL_SLI_BLOCK_SIZE 4U
| Length of an ICode SLI data block. More...

## Password identifiers
#define | PHAL_SLI_PWD_READ 0x01U
| Read Password. More...
#define | PHAL_SLI_PWD_WRITE 0x02U
| Write Password. More...
#define | PHAL_SLI_PWD_PRIVACY 0x04U
| Privacy Password. More...
#define | PHAL_SLI_PWD_DESTROY 0x08U
| Destroy Password. More...
#define | PHAL_SLI_PWD_EAS 0x10U
| EAS Password. More...

## Protection status
#define | PHAL_SLI_PROTECTION_PUBLIC 0x00U
| No protection. More...
#define | PHAL_SLI_PROTECTION_READ_PWD_ONLY 0x01U
| Read and Write protected by the Read password. More...
#define | PHAL_SLI_PROTECTION_WRITE_PWD_ONLY 0x10U
| Write protected by the Write password. More...
#define | PHAL_SLI_PROTECTION_READ_AND_WRITE_PWD 0x11U
| Read protected by the Read password, Write protected by the Write password. More...

## Block Protection bits
#define | PHAL_SLI_PROTECTION_BIT_BLOCK_LOCK 0x01U
| Block is locked. More...
#define | PHAL_SLI_PROTECTION_BIT_READ 0x02U
| Block is read protected. More...
#define | PHAL_SLI_PROTECTION_BIT_WRITE 0x04U
| Block is write protected. More...
#define | PHAL_SLI_PROTECTION_BIT_PROT_LOCK 0x08U
| Page protection is locked. More...

## Detailed Description

These Components implement the ICode SLI commands.

## Macro Definition Documentation

## § PHAL_SLI_OPTION_OFF

#define PHAL_SLI_OPTION_OFF PH_OFF

Option Bit is cleared.

## § PHAL_SLI_OPTION_ON

#define PHAL_SLI_OPTION_ON PH_ON

Option Bit is set.

## § PHAL_SLI_OPTION_DEFAULT

#define PHAL_SLI_OPTION_DEFAULT PHAL_SLI_OPTION_OFF

Default Option.

## § PHAL_SLI_BLOCK_SIZE

#define PHAL_SLI_BLOCK_SIZE 4U

Length of an ICode SLI data block.

## § PHAL_SLI_PWD_READ

#define PHAL_SLI_PWD_READ 0x01U

Read Password.

## § PHAL_SLI_PWD_WRITE

#define PHAL_SLI_PWD_WRITE 0x02U

Write Password.

## § PHAL_SLI_PWD_PRIVACY

#define PHAL_SLI_PWD_PRIVACY 0x04U

Privacy Password.

## § PHAL_SLI_PWD_DESTROY

#define PHAL_SLI_PWD_DESTROY 0x08U

Destroy Password.

## § PHAL_SLI_PWD_EAS

#define PHAL_SLI_PWD_EAS 0x10U

EAS Password.

## § PHAL_SLI_PROTECTION_PUBLIC

#define PHAL_SLI_PROTECTION_PUBLIC 0x00U

No protection.

## § PHAL_SLI_PROTECTION_READ_PWD_ONLY

#define PHAL_SLI_PROTECTION_READ_PWD_ONLY 0x01U

Read and Write protected by the Read password.

## § PHAL_SLI_PROTECTION_WRITE_PWD_ONLY

#define PHAL_SLI_PROTECTION_WRITE_PWD_ONLY 0x10U

Write protected by the Write password.

## § PHAL_SLI_PROTECTION_READ_AND_WRITE_PWD

#define PHAL_SLI_PROTECTION_READ_AND_WRITE_PWD 0x11U

Read protected by the Read password, Write protected by the Write password.

## § PHAL_SLI_PROTECTION_BIT_BLOCK_LOCK

#define PHAL_SLI_PROTECTION_BIT_BLOCK_LOCK 0x01U

Block is locked.

## § PHAL_SLI_PROTECTION_BIT_READ

#define PHAL_SLI_PROTECTION_BIT_READ 0x02U

Block is read protected.

## § PHAL_SLI_PROTECTION_BIT_WRITE

#define PHAL_SLI_PROTECTION_BIT_WRITE 0x04U

Block is write protected.

## § PHAL_SLI_PROTECTION_BIT_PROT_LOCK

#define PHAL_SLI_PROTECTION_BIT_PROT_LOCK 0x08U

Page protection is locked.

## Function Documentation

## § phalSli_GetRandomNumber()

phStatus_t phalSli_GetRandomNumber | ( | void * | pDataParams,
|  | uint8_t * | pRnd
| ) |  |

This command generates a random number from the label IC.

The received random number shall be used to diversify the password for the phalSli_SetPWD command.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlaying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [out] | pRnd | Random number; 16 bits.

## § phalSli_SetPWD()

phStatus_t phalSli_SetPWD | ( | void * | pDataParams,
|  | uint8_t | bPwdIdentifier,
|  | uint8_t * | pXorPwd
| ) |  |

This command transmits different passwords to the label to get access to protected functionalities.

This command has to be executed just once for the related passwords if the label is powered. The different passwords are addressed with the Password Identifier.

    [XOR password calculation example]
    pXorPwd[0] = pPassword[0] ^ pRnd[0];
    pXorPwd[1] = pPassword[1] ^ pRnd[1];
    pXorPwd[2] = pPassword[2] ^ pRnd[0];
    pXorPwd[3] = pPassword[3] ^ pRnd[1];

Remark: This command can only be executed in addressed or selected mode except of Privay Password.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlaying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [in] | bPwdIdentifier | Password Identifier; Refer to the PHAL_SLI_PWD_* definitions.
  [in] | pXorPwd | XOR Password; 32 bits.

## § phalSli_WritePWD()

phStatus_t phalSli_WritePWD | ( | void * | pDataParams,
|  | uint8_t | bPwdIdentifier,
|  | uint8_t * | pPwd
| ) |  |

With this command, a new password is written into the related memory.

Note that the old password has to be transmitted before with phalSli_SetPWD. The new password takes effect immediately which means that the new password has to be transmitted with phalSli_SetPWD to get access to protected blocks/pages. Remark: This command can only be executed in addressed or selected mode.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlaying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [in] | bPwdIdentifier | Password Identifier; Refer to the PHAL_SLI_PWD_* definitions.
  [in] | pPwd | Plain Password; 32 bits.

## § phalSli_LockPWD()

phStatus_t phalSli_LockPWD | ( | void * | pDataParams,
|  | uint8_t | bPwdIdentifier
| ) |  |

This command locks the addressed password.

Note that the addressed password has to be transmitted before with phalSli_SetPWD. A locked password can not be changed any longer.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlaying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [in] | bPwdIdentifier | Password Identifier; Refer to the PHAL_SLI_PWD_* definitions.

## § phalSli_64BitPWDProtection()

phStatus_t phalSli_64BitPWDProtection | ( | void * | pDataParams | ) |

This instructs the label that both of the Read and Write passwords are required for protected access.

Note that both the Read and Write passwords have to be transmitted before with phalSli_SetPWD.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlaying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.

## § phalSli_ProtectPage()

phStatus_t phalSli_ProtectPage | ( | void * | pDataParams,
|  | uint8_t | bPageNo,
|  | uint8_t | bProtectionStatus
| ) |  |

This command changes the protection status of a page.

Note that the related passwords have to be transmitted before with phalSli_SetPWD if the page is not public.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlaying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [in] | bPageNo | Page number.
  [in] | bProtectionStatus | New protection status; Refer to the PHAL_SLI_PROTECTION_* definitions.

## § phalSli_LockPageProtectionCondition()

phStatus_t phalSli_LockPageProtectionCondition | ( | void * | pDataParams,
|  | uint8_t | bPageNo
| ) |  |

This command permanenty locks the protection status of a page.

Note that the related passwords have to be transmitted before with phalSli_SetPWD if the page is not public.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlaying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [in] | bPageNo | Page number.

## § phalSli_GetMultipleBlockProtStatus()

phStatus_t phalSli_GetMultipleBlockProtStatus | ( | void * | pDataParams,
|  | uint8_t | bBlockNo,
|  | uint16_t | wNumBlocks,
|  | uint8_t * | pProtectionStates,
|  | uint8_t * | pNumReceivedStates
| ) |  |

This instructs the label to return the block protection status of the requested blocks.

Remark: If `bBlockNo` + `bNumBlocks` exceeds the total available number of user blocks, the number of received status bytes is less than the requested number. This means that the last returned status byte corresponds to the highest available user block.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlaying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [in] | bBlockNo | First Block number.
  [in] | wNumBlocks | Number of blocks.
  [out] | pProtectionStates | Protection states of requested blocks. Refer to the PHAL_SLI_PROTECTION_BIT_* definitions.
  [out] | pNumReceivedStates | Number of received block protection states.

## § phalSli_Destroy()

phStatus_t phalSli_Destroy | ( | void * | pDataParams | ) |

This command permanently destroys the label.

The Destroy password has to be transmitted before with phalSli_SetPWD. Remark: This command is irreversible and the label will never respond to any command again. Remark: This command can only be executed in addressed or selected mode.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlaying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.

## § phalSli_EnablePrivacy()

phStatus_t phalSli_EnablePrivacy | ( | void * | pDataParams | ) |

This command instructs the label to enter privacy mode.

In privacy mode, the label will only respond to phalSli_GetRandomNumber and phalSli_SetPWD commands. To get out of the privacy mode, the Privacy password has to be transmitted before with phalSli_SetPWD.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlaying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.

## § phalSli_ReadSignature()

phStatus_t phalSli_ReadSignature | ( | void * | pDataParams,
|  | uint8_t * | pSignature
| ) |  |

The command returns an IC specific, 32-byte ECC signature, to verify NXP Semiconductors as the silicon vendor.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [out] | pSignature | Signature; 256 bits.

## § phalSli_SetEAS()

phStatus_t phalSli_SetEAS | ( | void * | pDataParams | ) |

This command enables the EAS mode if the EAS mode is not locked.

If the EAS mode is password protected the EAS password has to be transmitted before with phalSli_SetPWD.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlaying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.

## § phalSli_ResetEAS()

phStatus_t phalSli_ResetEAS | ( | void * | pDataParams | ) |

This command disables the EAS mode if the EAS mode is not locked.

If the EAS mode is password protected the EAS password has to be transmitted before with phalSli_SetPWD.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlaying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.

## § phalSli_LockEAS()

phStatus_t phalSli_LockEAS | ( | void * | pDataParams | ) |

This command locks the current state of the EAS mode and the EAS ID.

If the EAS mode is password protected the EAS password has to be transmitted before with phalSli_SetPWD.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlaying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.

## § phalSli_EASAlarm()

phStatus_t phalSli_EASAlarm | ( | void * | pDataParams,
|  | uint8_t | bOption,
|  | uint8_t * | pEasIdValue,
|  | uint8_t | bEasIdMaskLength,
|  | uint8_t * | pEas
| ) |  |

This command returns the EAS sequence if the EAS mode is enabled.

- `bOption` disabled: `bEasIdMaskLength` and `pEasIdValue` are not transmitted, EAS Sequence is returned;
- `bOption` enabled and `bEasIdMaskLength` = `0`: EAS ID is returned;
- `bOption` enabled and `bEasIdMaskLength` > `0`: EAS Sequence is returned by ICs with matching `pEasIdValue`;

If the EAS mode is disabled, the label remains silent.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlaying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [in] | bOption | Option flag; `PHAL_SLI_OPTION_OFF:` disable; `PHAL_SLI_OPTION_ON:` enable.
  [in] | pEasIdValue | EAS ID; 0, 8 or 16 bits; optional.
  [in] | bEasIdMaskLength | 8 bits; optional.
  [out] | pEas | EAS ID (16 bits) or EAS Sequence (256 bits).

## § phalSli_PwdProtectEAS()

phStatus_t phalSli_PwdProtectEAS | ( | void * | pDataParams | ) |

This command enables the password protection for EAS.

The EAS password has to be transmitted before with phalSli_SetPWD.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlaying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.

## § phalSli_WriteEAS_ID()

phStatus_t phalSli_WriteEAS_ID | ( | void * | pDataParams,
|  | uint8_t * | pEasIdValue
| ) |  |

With this command, a new EAS identifier is stored in the corresponding configuration memory.

If the EAS mode is password protected the EAS password has to be transmitted before with phalSli_SetPWD.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlaying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [in] | pEasIdValue | EAS ID; 16 bits.

## § phalSli_ReadEPC()

phStatus_t phalSli_ReadEPC | ( | void * | pDataParams,
|  | uint8_t * | pEpc
| ) |  |

On this command, the label will respond with it's EPC data.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlaying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [out] | pEpc | EPC data; 96 bits.

## § phalSli_GetNxpSystemInfo()

phStatus_t phalSli_GetNxpSystemInfo | ( | void * | pDataParams,
|  | uint8_t * | pProtectionPointer,
|  | uint8_t * | pProtectionCondition,
|  | uint8_t * | pLockBits,
|  | uint8_t * | pFeatureFlags
| ) |  |

The command provides information about IC access conditions and supported features.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [out] | pProtectionPointer | Protection pointer address; 8 bits.
  [out] | pProtectionCondition | Protection conditions for the password protection; 8 bits.
  [out] | pLockBits | Lock bits settings; 8 bits.
  [out] | pFeatureFlags | Supported commands and features; 32 bits (+) additional 32 bits if EXT flag is set.

## § phalSli_GetRandomNumberSetPWD()

phStatus_t phalSli_GetRandomNumberSetPWD | ( | void * | pDataParams,
|  | uint8_t | bPwdIdentifier,
|  | uint8_t * | pPwd
| ) |  |

Get random number and set password using this random number and provided password.

This command combines together phalSli_GetRandomNumber and phalSli_SetPWD commands.

Returns
  Status code

Return values

  PH_ERR_SUCCESS | Operation successful.
  Other | Depending on implementation and underlying component.

Parameters

  [in] | pDataParams | Pointer to this layer's parameter structure.
  [in] | bPwdIdentifier | Password Identifier; Refer to the PHAL_SLI_PWD_* definitions.
  [in] | pPwd | Password; 32 bits.