Function anjay_disable_server
Defined in File core.h
Function Documentation
-
int anjay_disable_server(anjay_t *anjay, anjay_ssid_t ssid)
This function shall be called when an LwM2M Server Object shall be disabled. The standard case for this is when Execute is performed on the Disable resource (/1/x/4).
The server will be disabled for the period of time determined by the value of the Disable Timeout resource (/1/x/5). The resource is read soon after the invocation of this function (during next anjay_sched_run) and is not updated upon any subsequent Writes to that resource.
If the server is already disabled, its re-enable action will be re-scheduled according to the value of the Disable Timeout resource added to current time.
NOTE: Disabled servers and the time at which those servers will be reenabled is persisted and restored by anjay_new_from_core_persistence and anjay_delete_with_core_persistence .
- Parameters:
anjay – Anjay object to operate on.
ssid – Short Server ID of the server to put in a disabled state. NOTE: disabling a server requires a Server Object Instance to be present for given
ssid. Because the Bootstrap Server does not have one, this function does nothing when called with ANJAY_SSID_BOOTSTRAP .
- Returns:
0 on success, a negative value in case of error.