ConnecCore Cloud Services daemon connects to Remote Manager and listens for CCCS applications to route data to/from Remote Manager.
A CCCS-enabled application must ensure the deamon is ready to be able to send and receive data.
To do so, use cccs_is_daemon_ready()
function.
bool cccs_is_daemon_ready(long timeout);
This function returns true
if the CCCS daemon is ready to send and receive data, and false
otherwise.
timeout
is the number of seconds to wait for daemon readiness:
-
CCCSD_WAIT_FOREVER
blocks until the daemon is ready. -
CCCSD_NO_WAIT
to check the daemon status and return immediately. -
Any other value blocks until either the daemon is ready or the time is up.
int main (void)
{
/* [...] */
if (!cccs_is_daemon_ready(CCCSD_NO_WAIT)) {
log_error("%s: CCCS daemon not ready... exiting", __func__);
return EXIT_FAILURE;
}
/* [...] */
}
Make sure your device is registered within your Remote Manager account before attempting to connect. For more information on registering your device in Remote Manager see Connect to Remote Manager.
Log messages
The library uses syslog for logging.
You can establish the logging level of the library by calling init_logger()
and stop logging using deinit_logger()
.
Function | Description |
---|---|
|
Initialize the API logger with one of the log levels defined in
|
|
Close the logger |
CCCS also allow to easily log a message with one of the following options:
Function | Description |
---|---|
|
Log the given message as error |
|
Log the given message as warning |
|
Log the given message as information |
|
Log the given message as debug |