Types specific to the S2C Library. More...
|Information about a connected Mobile client This is returned by s2c_get_mobile_client_list() More...|
|Target of S2C file operation. More...|
|S2C file information. More...|
|S2C File handle, returned by s2c_file_open() or s2c_file_create() More...|
|File listing parameters. More...|
|typedef void(*||s2c_status_update_handler_t) (s2c_status_flag_t new_status)|
|Handler to be triggered when the device's status changes. More...|
|typedef const void *||s2c_config_t[S2C_SETTING_COUNT]|
|Array of pointers to configure the S2C library. |
|typedef void(*||s2c_cloud_message_callback_t) (msgpack_object_dict_t *dictionary)|
|Callback when the cloud issues a non-stream message to the device via websocket. More...|
|typedef uint8_t *(*||s2c_broadcast_callback_t) (uint8_t *buffer, uint16_t max_length)|
|Custom broadcast packet callback. More...|
|typedef zos_bool_t(*||s2c_command_callback_t) (const s2c_mobile_client_info_t *client, const char *command_string)|
|Callback for when a Mobile attempts to execute a command on the Device. More...|
|typedef void(*||s2c_stream_listener_t) (const char *stream, void *arg, msgpack_object_dict_t *dictionary)|
|Callback for when stream data has been received from the Cloud or Mobile. More...|
Types specific to the S2C Library.
|typedef uint8_t*(* s2c_broadcast_callback_t) (uint8_t *buffer, uint16_t max_length)|
Custom broadcast packet callback.
This is periodically called when the device broadcasts on the local network. It is also called when the device periodically updates its cloud connection.
This callback may be used to add custom device information to the broadcast packet.
- The format of the packet MUST be in MessagePack. Refer to the MessagePack for more information about how to construct MessagePack data.
Buffer to hold the custom broadcast data in MessagePack format
The maximum length of the supplied buffer
- Pointer to the end of the buffered data
|typedef void(* s2c_cloud_message_callback_t) (msgpack_object_dict_t *dictionary)|
Callback when the cloud issues a non-stream message to the device via websocket.
This callback executes in the context of the Zap thread. The callback is supplied with the parsed JSON tokens context. The context is automatically cleaned up after the callback returns.
See the following link for the various messages the cloud may issue: https://cloud.zentri.com/support/api/device/ws
The parsed JSON context, msgpack_object_dict_t
|typedef zos_bool_t(* s2c_command_callback_t) (const s2c_mobile_client_info_t *client, const char *command_string)|
Callback for when a Mobile attempts to execute a command on the Device.
This callback can be used as a security feature. It is called before a local client attempts to execute a command. If the callback returns ZOS_FALSE then the command won't be executed and the client will receive and error code.
If the callback returns ZOS_TRUE then the command will be executed.
- Some commands are required as part of the setup process. If this callback always returns ZOS_FALSE then the device will not be able to be setup.
The mobile client attempting to execute the command, see s2c_mobile_client_info_t
The command string the Mobile wants to execute
- ZOS_TRUE if the remote Mobile is allowed to execute the command, ZOS_FALSE else
|typedef void(* s2c_status_update_handler_t) (s2c_status_flag_t new_status)|
Handler to be triggered when the device's status changes.
This handler is triggered whenever the device's status flags change, see s2c_status_flag_t
This handler should be registered with the setting S2C_SETTING_STATUS_UPDATE_HANDLER
The new status of the Device, see s2c_status_flag_t
|typedef void(* s2c_stream_listener_t) (const char *stream, void *arg, msgpack_object_dict_t *dictionary)|
Callback for when stream data has been received from the Cloud or Mobile.
This callback executes in the context of the Zap thread. The callback is supplied with the parsed JSON tokens. The tokens are automatically cleaned up after the callback returns.
Enumeration Type Documentation
S2C Settings flags.
Enable UDP broadcast for advertising device on local network.
Mobile client guest connections are verified by Cloud beforing being granted access.
If this flag is set then guest connections are always allowed, otherwise s2c_allow_mobile_client_guests() must first be invoked before a guest may connect.
If set, the host/device must verify a mobile before the mobile may continue device setup.
The target system node of a packet.
Command response code.
S2C library settings.
These index the s2c_config_t passed to the library on initialization.
Settings flags, see s2c_flag_t.
Cloud token supplied by a remote app, this is used to log the device into the cloud.
Device key supplied by a remote app for encryption local server client connects, this is used to encrypt connects with local mobile apps.
The code of this device (e.g BMC123) this is broadcasted on the local network.
A custom title for the device (e.g.
Kitchen Light), this may be set by the mobile app or the cloud,
Optional callback to broadcast custom packets for devcie, see s2c_broadcast_callback_t.
Optional event handler which indicates if the remote cloud disconnects, zos_event_handler_t.
Optional event handler which indicates if a client connects to the local server, zos_event_handler_t.
Optional event handler which indicates if a client disconnect from the local server, zos_event_handler_t.
Optional event handler which indicates if a client requests the device's current stream values, zos_event_handler_t.
Optional, s2c_command_callback_t, callback which is called when a locally connected Mobile issues a command to the Device.
This callback can stop the command from executing.
Optional, s2c_cloud_message_callback_t, callback which is called when the cloud issues a non-stream message to the Device via websocket.
Optional event handler which invokes @ ref s2c_status_update_handler_t when the device's status flags change.
The maximum amount of time in seconds to wait for mobile to accept the host/device's file operation before timeout.
Default value is 7 seconds
The total number of settings.
The S2C libraries status.
These flags are broadcasts on the local network
The device has a key for the local server (i.e. local connections are encrypted)
The device has a cloud token (i.e. it's able to connect to the cloud)
The device's local server is running the the WLAN interface.
The device's local server is running on the SoftAP interface.
The device is connected to the cloud.
One or more mobiles connected to device.
Device has listeners registered.
Host has listeners registered.
The SoftAP is Open (i.e.
non-secure), a Diffie-Hellman key exchange is required if the device does NOT have a key i.e. if the S2C_STATUS_HAVE_DEVICE_KEY flag is not set
Indicates the device allows guests connections.
Indicates if one or more guests are currently connected.
A file is actively being transferred.
A host MCU is connected.
A mobile must be verified by the host/device before it may continue device setup.