|
| | Attribute_Request ()=default |
| | Constructor. More...
|
| |
| | ~Attribute_Request () override=default |
| |
| bool | Client_Attributes_Request (Callback_Value const &callback) |
| | Requests one client-side attribute, which will call the passed callback. If the key-value pair from the server for the requested client-side attributes has been received. More...
|
| |
| bool | Shared_Attributes_Request (Callback_Value const &callback) |
| | Requests one shared attribute, which will call the passed callback. If the key-value pair from the server for the requested shared attributes has been received. More...
|
| |
| API_Process_Type | Get_Process_Type () const override |
| | Returns the way the server response should be processed. More...
|
| |
| void | Process_Response (char const *topic, uint8_t *payload, uint32_t length) override |
| | Process callback that will be called upon response arrival. More...
|
| |
| void | Process_Json_Response (char const *topic, JsonDocument const &data) override |
| | Process callback that will be called upon response arrival. More...
|
| |
| bool | Is_Response_Topic_Matching (char const *topic) const override |
| | Compares received response topic and the topic this api implementation handles responses on, messages from all other topics are ignored and only messages from topics that match are handled. More...
|
| |
| bool | Unsubscribe () override |
| | Unsubcribes all callbacks, to clear up any ongoing subscriptions and stop receiving information over the previously subscribed topic. More...
|
| |
| bool | Resubscribe_Permanent_Subscriptions () override |
| | Forwards the call to let the API clear up any ongoing single-event subscriptions (Provision, Attribute Request, RPC Request) and simply resubscribes the topic for all permanent subscriptions (RPC, Shared Attribute Update) More...
|
| |
| void | loop () override |
| | Internal loop method to update inernal timers for API calls that can timeout. More...
|
| |
| void | Initialize () override |
| | Method that allows to construct internal objects, after the required callback member methods have been set already. More...
|
| |
| void | Set_Client_Callbacks (Callback< void, IAPI_Implementation & >::function subscribe_api_callback, Callback< bool, char const *const, JsonDocument const & >::function send_json_callback, Callback< bool, char const *const, char const *const >::function send_json_string_callback, Callback< bool, char const *const >::function subscribe_topic_callback, Callback< bool, char const *const >::function unsubscribe_topic_callback, Callback< uint16_t >::function get_receive_size_callback, Callback< uint16_t >::function get_send_size_callback, Callback< bool, uint16_t, uint16_t >::function set_buffer_size_callback, Callback< size_t * >::function get_request_id_callback) override |
| | Sets the underlying callbacks that are required for the different API Implementation to communicate with the cloud. More...
|
| |
| virtual | ~IAPI_Implementation () |
| | Virtual default destructor, created to ensure that if a pointer to this class is used and deleted, we will also call the derived base class destructor. More...
|
| |
| virtual API_Process_Type | Get_Process_Type () const =0 |
| | Returns the way the server response should be processed. More...
|
| |
| virtual void | Process_Response (char const *topic, uint8_t *payload, uint32_t length)=0 |
| | Process callback that will be called upon response arrival. More...
|
| |
| virtual void | Process_Json_Response (char const *topic, JsonDocument const &data)=0 |
| | Process callback that will be called upon response arrival. More...
|
| |
| virtual bool | Is_Response_Topic_Matching (char const *topic) const =0 |
| | Compares received response topic and the topic this api implementation handles responses on, messages from all other topics are ignored and only messages from topics that match are handled. More...
|
| |
| virtual bool | Unsubscribe ()=0 |
| | Unsubcribes all callbacks, to clear up any ongoing subscriptions and stop receiving information over the previously subscribed topic. More...
|
| |
| virtual bool | Resubscribe_Permanent_Subscriptions ()=0 |
| | Forwards the call to let the API clear up any ongoing single-event subscriptions (Provision, Attribute Request, RPC Request) and simply resubscribes the topic for all permanent subscriptions (RPC, Shared Attribute Update) More...
|
| |
| virtual void | loop ()=0 |
| | Internal loop method to update inernal timers for API calls that can timeout. More...
|
| |
| virtual void | Initialize ()=0 |
| | Method that allows to construct internal objects, after the required callback member methods have been set already. More...
|
| |
| virtual void | Set_Client_Callbacks (Callback< void, IAPI_Implementation & >::function subscribe_api_callback, Callback< bool, char const *const, JsonDocument const & >::function send_json_callback, Callback< bool, char const *const, char const *const >::function send_json_string_callback, Callback< bool, char const *const >::function subscribe_topic_callback, Callback< bool, char const *const >::function unsubscribe_topic_callback, Callback< uint16_t >::function get_receive_size_callback, Callback< uint16_t >::function get_send_size_callback, Callback< bool, uint16_t, uint16_t >::function set_buffer_size_callback, Callback< size_t * >::function get_request_id_callback)=0 |
| | Sets the underlying callbacks that are required for the different API Implementation to communicate with the cloud. More...
|
| |
template<
size_t MaxSubscriptions = DEFAULT_SUBSCRIPTION_AMOUNT,
size_t MaxAttributes = DEFAULT_ATTRIBUTES_AMOUNT, typename Logger = DefaultLogger>
class Attribute_Request< MaxSubscriptions, MaxAttributes, Logger >
Handles the internal implementation of the ThingsBoard client and shared Attribute Request API. See https://thingsboard.io/docs/reference/mqtt-api/#request-attribute-values-from-the-server for more information.
- Template Parameters
-
| Logger | Implementation that should be used to print error messages generated by internal processes and additional debugging messages if THINGSBOARD_ENABLE_DEBUG is set, default = DefaultLogger |
| MaxSubscriptions | Maximum amount of simultaneous client or shared attribute requests. Once the maximum amount has been reached it is not possible to increase the size, this is done because it allows to allocate the internal memory on the stack instead of the heap. Especially relevant for the value of this template parameters is that once the attributes have been received the call is automatically cleaned up allowing to request attributes again. This means the number should represent the maximum amount of responses to attribute requests the device calling the internal methods is ever waiting for, default = DEFAULT_SUBSCRIPTION_AMOUNT (1) |
| MaxAttributes | Maximum amount of attributes that will ever be requested at once with the Attribute_Request_Callback, allows to use an array on the stack in the background, default = DEFAULT_ATTRIBUTES_AMOUNT (1) |