ZPS_eAplZdoAddReplaceLinkKey

ZPS_teStatus ZPS_eAplZdoAddReplaceLinkKey(
                        uint64 u64IeeeAddr,
                        uint8 au8Key[ZPS_SEC_KEY_LENGTH],
                        ZPS_teApsLinkKeyType eKeyType);

Description

This function can be used to introduce or replace the application link key on the local node, where this key is used to encrypt and decrypt communications with the specified ‘partner node’. If an application link key already exists, then it is replaced.

The function must be called on both the local node and the partner node. Note that the Trust Centre’s record of the application link key for this pair of nodes remains unchanged.

If the JCU Non-Volatile Memory Manager (NVM) module is enabled, this function also saves the application link key to Non-Volatile Memory. This allows the key to be automatically recovered during a subsequent cold start (for example, following a power failure).

The eKeyType parameter of this function can be used to specify ‘unique’ or ‘global’. This does not relate to the type of key being added or replaced, which is always a unique key.

  • Setting this parameter to ‘unique’ means that the node only ever uses the unique key.

  • Setting the parameter to ‘global’ means that the node uses the unique key, where appropriate, and also the pre-configured global link key, where appropriate. For example, the global key would be used when another node joins the network via the local node.

Parent topic:ZPS_eAplZdoAddReplaceLinkKey

Parameters

  • u64IeeeAddr: 64-bit IEEE/MAC address of partner node for which the specified link key is valid.

  • au8Key[]: Array containing the link key to be added/replaced. This array has a length equal to ZPS_SEC_KEY_LENGTH.

  • eKeyType: Type of the key to be used by the node (see above), one of the below:

    • ZPS_APS_UNIQUE_LINK_KEY, or

    • ZPS_APS_GLOBAL_LINK_KEY.

Parent topic:ZPS_eAplZdoAddReplaceLinkKey

Returns

  • ZPS_E_SUCCESS (link key successfully installed)

  • APS return codes, listed and described in Section 11.2.2

  • NWK return codes, listed and described in Section 11.2.3

  • MAC return codes, listed and described in Section 11.2.4

Parent topic:ZPS_eAplZdoAddReplaceLinkKey

Parent topic:Security functions