nRF Connect SDK API 2.8.99
Loading...
Searching...
No Matches

◆ lwm2m_security_set_psk()

int lwm2m_security_set_psk ( uint16_t sec_obj_inst,
const void * psk,
int psk_len,
bool psk_is_hex,
const char * psk_id )

#include <include/net/lwm2m_client_utils.h>

Set security object to PSK mode.

Any pointer can be given as a NULL, which means that data related to this field is set to zero length in the engine. Effectively, it causes that relative data is not written into the modem. This can be used if the given data is already provisioned to the modem.

Parameters
sec_obj_instSecurity object ID to modify.
pskPointer to PSK key, either in HEX or binary format.
psk_lenLength of data in PSK pointer. If PSK is HEX string, should include string terminator.
psk_is_hexTrue if PSK points to data in HEX format. False if the data is binary.
psk_idPSK key ID in string format.
Returns
Zero if success, negative error code otherwise.