API References
Libertas Data Types
Enums
Device Types
Event Model
Libertas only offers reactive event API for devices, even though the Libertas design also supports the imperative paradigm.
Libertas_SetOnDevice
registers a event callback function for specified device.
The types below are associated with the event API.
LibertasDeviceCallback
defines the signature of callback function.LibertasEvent
is an event object.LibertasEventAttributes
,LibertasEventCmd
, andLibertasDeviceStatus
are related to the devices.
For more information, please refer to the API documentation.
Device Read/Write Access
APIs below are related to device read and write access.
Libertas_DeviceGetAttributes
Libertas_DeviceAttributes
Libertas_DeviceCommandReq
Libertas_DeviceCommandRsp
Libertas_DeviceCommandDefaultRsp
Please note that once the request is sent, it takes some time to get a response from the peer. If the peer is not responsive, a failure status will be generated after a few retries.
Calling APIs to send out a request does not guarantee the delivery of the request. Thing-App needs to call Libertas_SetOnDevice
to register the callback to get the response event. The event will contain the original request and the response information, such as the status code.