This is an old revision of the document!


SDK API > BS2_SetDataEncryptKey

[+ V2.6.0] Sets data encryption key.
If the device's key is the same as the one you are currently setting, the key setting will be ignored.
Also, if the key of the device is different from the one you want to set, the key will be set and the device's data will be erased.

Declaration

#include "BS_API.h"
 
int BS2_SetDataEncryptKey(void* context, uint32_t deviceId, const BS2EncryptKey* keyInfo);

Parameter

  • [In] context : Context
  • [In] deviceId : Device ID
  • [In] keyInfo : The address of the key information structure to set.

Return Value

If successfully done, BS_SDK_SUCCESS will be returned.
If there is an error, the corresponding error code will be returned.

See Also