You can set the service status of your devices using ConnectCore Cloud Services. This status can be:

  • In service. The device is in business hours. Remote Manager is not allowed to perform maintenance tasks on the device.

  • In maintenance. The device is outside business hours. Remote Manager is allowed to perform maintenance tasks on the device.

By default, a device is in maintenance status, so Digi Remote Manager is allowed to perform any task on the device.

To change the device service status, use cccs_set_maintenance_status() function.

cccs_comm_error_t cccs_set_maintenance_status(bool status,
                                              unsigned long const timeout,
                                              cccs_resp_t *resp);
Set device service status
void set_maintenance(bool status)
{
	cccs_comm_error_t ret;
	cccs_resp_t resp;

	ret = cccs_set_maintenance_status(status, 3, &resp);
	if (ret != CCCS_SEND_ERROR_NONE) {
		log_error("%s", Unable to set maintenance status");
	} else if (resp.code != 0) {
		if (resp.hint)
			log_error("Unable to set maintenance status: %s (%d)",
				resp.hint, resp.code);
		else
			log_error(Unable to set maintenance status: %d",
				resp.code);
	}

	free(resp.hint);
}

int main (void)
{
	cccs_comm_error_t ret;
	cccs_resp_t resp;

	/* [...] */

	/* In maintenance */
	set_maintenance(true);

	 /* [...] */

	/* In service */
	set_maintenance(false);

	/* [...] */
}

See Automate operations with web services for more information about device service status in Digi Remote Manager.

Maintenance status example

The Maintenance Status example demonstrates how to set the device maintenance status using CCCS.

This example is included in Digi Embedded Yocto. Go to GitHub to look at the application source code.