// Autogenerated C header file for Cloud Configuration
#ifndef _JACDAC_SPEC_CLOUD_CONFIGURATION_H
#define _JACDAC_SPEC_CLOUD_CONFIGURATION_H 1

#define JD_SERVICE_CLASS_CLOUD_CONFIGURATION  0x1462eefc

// enum ConnectionStatus (uint16_t)
#define JD_CLOUD_CONFIGURATION_CONNECTION_STATUS_CONNECTED 0x1
#define JD_CLOUD_CONFIGURATION_CONNECTION_STATUS_DISCONNECTED 0x2
#define JD_CLOUD_CONFIGURATION_CONNECTION_STATUS_CONNECTING 0x3
#define JD_CLOUD_CONFIGURATION_CONNECTION_STATUS_DISCONNECTING 0x4

/**
 * Read-only string (bytes). Something like `my-iot-hub.azure-devices.net` if available.
 */
#define JD_CLOUD_CONFIGURATION_REG_SERVER_NAME 0x180

/**
 * Read-only string (bytes). Device identifier for the device in the cloud if available.
 */
#define JD_CLOUD_CONFIGURATION_REG_CLOUD_DEVICE_ID 0x181

/**
 * Constant string (bytes). Cloud provider identifier.
 */
#define JD_CLOUD_CONFIGURATION_REG_CLOUD_TYPE 0x183

/**
 * Read-only ConnectionStatus (uint16_t). Indicates the status of connection. A message beyond the [0..3] range represents an HTTP error code.
 */
#define JD_CLOUD_CONFIGURATION_REG_CONNECTION_STATUS 0x182

/**
 * Read-write ms uint32_t. How often to push data to the cloud.
 */
#define JD_CLOUD_CONFIGURATION_REG_PUSH_PERIOD 0x80

/**
 * Read-write ms uint32_t. If no message is published within given period, the device resets.
 * This can be due to connectivity problems or due to the device having nothing to publish.
 * Forced to be at least `2 * flush_period`.
 * Set to `0` to disable (default).
 */
#define JD_CLOUD_CONFIGURATION_REG_PUSH_WATCHDOG_PERIOD 0x81

/**
 * No args. Starts a connection to the cloud service
 */
#define JD_CLOUD_CONFIGURATION_CMD_CONNECT 0x81

/**
 * No args. Starts disconnecting from the cloud service
 */
#define JD_CLOUD_CONFIGURATION_CMD_DISCONNECT 0x82

/**
 * Argument: connection_string string (bytes). Restricted command to override the existing connection string to cloud.
 */
#define JD_CLOUD_CONFIGURATION_CMD_SET_CONNECTION_STRING 0x86

/**
 * Argument: connection_status ConnectionStatus (uint16_t). Raised when the connection status changes
 */
#define JD_CLOUD_CONFIGURATION_EV_CONNECTION_STATUS_CHANGE JD_EV_CHANGE

/**
 * Raised when a message has been sent to the hub.
 */
#define JD_CLOUD_CONFIGURATION_EV_MESSAGE_SENT 0x80

#endif
