Function anjay_lwm2m_gateway_register_device
Defined in File lwm2m_gateway.h
Function Documentation
-
int anjay_lwm2m_gateway_register_device(anjay_t *anjay, const char *device_id, anjay_iid_t *inout_iid)
Register an End Device in LwM2M Gateway and assign the necessary Resources. /0 Device ID Resource is set as
device_idparameter. /1 Prefix Resource is assigned automatically as “dev<x>” where <x> is the Device ID returned withinout_iidparameter. /3 IoT Device Object Resource is generated as Corelnk format upon Read Request according to the Data Model set with anjay_lwm2m_gateway_register_object callsNote: if
inout_iidis set to ANJAY_ID_INVALID then the Instance id is generated automatically, otherwise value ofinout_iidis used as a new Gateway Instance ID.- Parameters:
anjay – Anjay object to operate on
device_id – Globally Unique Device ID (/0 Resource) as a NULL-terminated string. It’s value is not copied, so the pointer must remain valid
inout_iid – Gateway Instance ID to use or ANJAY_ID_INVALID . Treated also as End IoT Device ID which shall be used with further API calls to specify the End Device entity in Gateway
- Returns:
0 on success, or a negative value in case of error.