|
| | Client_Side_RPC ()=default |
| | Constructor. More...
|
| |
| | ~Client_Side_RPC () override=default |
| |
| bool | RPC_Request (RPC_Request_Callback const &callback) |
| | Requests the response from one client-side rpc method, which will call the passed callback. If a response from the server for the executed client-side rpc method was 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 MaxRequestRPC = DEFAULT_REQUEST_RPC_AMOUNT, typename Logger = DefaultLogger>
class Client_Side_RPC< MaxSubscriptions, MaxRequestRPC, Logger >
Handles the internal implementation of the ThingsBoard client-side RPC API. See https://thingsboard.io/docs/user-guide/rpc/#client-side-rpc 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-side rpc 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, default = DEFAULT_SUBSCRIPTION_AMOUNT (1) |
| MaxRequestRPC | Maximum amount of key-value pairs that will ever be sent as parameters to the requested client-side rpc method, allows to allocate the internal memory on the stack instead of the heap. Default value is big enough only call client-side rpc methods with no parameters. Being a value of 2 to hold the default method name and params key needed for a well-formed request. If additional parameters are ever sent with a request the size has to be increased by one for each value in the JsonArray sent as a parameter, default = DEFAULT_REQUEST_RPC_AMOUNT (2) |