supla-device
Loading...
Searching...
No Matches
srpc.h
1// SPDX-FileCopyrightText: AC SOFTWARE SP. Z O.O.
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#ifndef supladex_H_
5#define supladex_H_
6
7#include <stddef.h>
8#include <stdio.h>
9
10#if !defined(SUPLA_DEVICE) && !defined(ARDUINO)
11#include "eh.h"
12#endif
13#include "proto.h"
14#if defined(ESP32)
15#include <esp8266-compat.h>
16#endif
17
18#ifdef __ANDROID__
19#define SRPC_EXCLUDE_DEVICE
20#endif /*__ANDROID__*/
21
22#if defined(ESP8266) || defined(ESP32)
23
24#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
25#define SRPC_WITHOUT_OUT_QUEUE
26#define SRPC_WITHOUT_IN_QUEUE
27#define PACKET_INTEGRITY_BUFFER_DISABLED
28#endif /* defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) */
29
30#define SRPC_EXCLUDE_CLIENT
31#define SRPC_ICACHE_FLASH ICACHE_FLASH_ATTR
32
33#if !defined(ESP32)
34#include <mem.h>
35#include <os_type.h>
36#endif
37#else
38#define SRPC_ICACHE_FLASH
39#endif
40
41#if defined(__AVR__) || defined(ARDUINO) || defined(SUPLA_DEVICE)
42#define SRPC_EXCLUDE_CLIENT
43#define SRPC_WITHOUT_OUT_QUEUE
44#define SRPC_WITHOUT_IN_QUEUE
45#define PACKET_INTEGRITY_BUFFER_DISABLED
46#endif /*__AVR__*/
47
48#ifdef __cplusplus
49extern "C" {
50#endif
51
52#if SUPLA_SRPC_PACKET_LOG_ENABLED && !defined(SUPLA_DISABLE_LOGS) && \
53 (defined(SUPLA_DEVICE) || defined(ESP8266) || defined(ESP32) || \
54 defined(__AVR__) || defined(ARDUINO_ARCH_ESP8266) || \
55 defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_AVR))
56#define SRPC_WITH_PACKET_LOG_HOOKS
57#endif
58
59typedef _supla_int_t (*_func_srpc_DataRW)(void *buf, _supla_int_t count,
60 void *user_params);
61typedef void (*_func_srpc_event_OnRemoteCallReceived)(
62 void *_srpc, unsigned _supla_int_t rr_id, unsigned _supla_int_t call_id,
63 void *user_params, unsigned char proto_version);
64typedef void (*_func_srpc_event_BeforeCall)(void *_srpc,
65 unsigned _supla_int_t call_id,
66 void *user_params);
67#ifdef SRPC_WITH_PACKET_LOG_HOOKS
68typedef void (*_func_srpc_event_OnPacketSent)(
69 void *_srpc,
70 unsigned _supla_int_t call_id,
71 void *data,
72 unsigned _supla_int_t data_size,
73 void *user_params);
74typedef void (*_func_srpc_event_OnPacketReceived)(
75 void *_srpc,
76 unsigned _supla_int_t call_id,
77 void *data,
78 unsigned _supla_int_t data_size,
79 void *user_params);
80#endif
81typedef void (*_func_srpc_event_OnVersionError)(void *_srpc,
82 unsigned char remote_version,
83 void *user_params);
84typedef void (*_func_srpc_event_OnMinVersionRequired)(
85 void *_srpc, unsigned _supla_int_t call_id, unsigned char min_version,
86 void *user_params);
87
88typedef enum {
89 SRPC_ITERATE_REASON_NONE = 0,
90 SRPC_ITERATE_REASON_SOCKET_CLOSED,
91 SRPC_ITERATE_REASON_INPUT_BUFFER_ERROR,
92 SRPC_ITERATE_REASON_INPUT_BUFFER_OVERFLOW,
93 SRPC_ITERATE_REASON_PROTOCOL_ERROR,
94 SRPC_ITERATE_REASON_VERSION_ERROR,
95 SRPC_ITERATE_REASON_INPUT_QUEUE_ERROR,
96 SRPC_ITERATE_REASON_OUTPUT_BUFFER_ERROR
97} TsrpcIterateReason;
98
99typedef struct {
100 _func_srpc_DataRW data_read;
101 _func_srpc_DataRW data_write;
102 _func_srpc_event_OnRemoteCallReceived on_remote_call_received;
103 _func_srpc_event_OnVersionError on_version_error;
104 _func_srpc_event_BeforeCall before_async_call;
105#ifdef SRPC_WITH_PACKET_LOG_HOOKS
106 _func_srpc_event_OnPacketSent on_packet_sent;
107 _func_srpc_event_OnPacketReceived on_packet_received;
108#endif
109 _func_srpc_event_OnMinVersionRequired on_min_version_required;
110
111#if !defined(SUPLA_DEVICE) && !defined(ARDUINO)
112 TEventHandler *eh;
113#endif
114
115 void *user_params;
117
119 TDCS_SuplaPingServer *dcs_ping;
120 TSDC_SuplaPingServerResult *sdc_ping_result;
121 TSDC_SuplaGetVersionResult *sdc_getversion_result;
122 TSDC_SuplaVersionError *sdc_version_error;
123 TDCS_SuplaSetActivityTimeout *dcs_set_activity_timeout;
124 TSDC_SuplaSetActivityTimeoutResult *sdc_set_activity_timeout_result;
125 TDS_SuplaRegisterDevice *ds_register_device;
126 TDS_SuplaRegisterDevice_B *ds_register_device_b;
127 TDS_SuplaRegisterDevice_C *ds_register_device_c;
128 TDS_SuplaRegisterDevice_D *ds_register_device_d;
129 TDS_SuplaRegisterDevice_E *ds_register_device_e;
130 TDS_SuplaRegisterDevice_F *ds_register_device_f;
131 TDS_SuplaRegisterDevice_G *ds_register_device_g;
132 TSD_SuplaRegisterDeviceResult *sd_register_device_result;
133 TSD_SuplaRegisterDeviceResult_B *sd_register_device_result_b;
134 TCS_SuplaRegisterClient *cs_register_client;
135 TCS_SuplaRegisterClient_B *cs_register_client_b;
136 TCS_SuplaRegisterClient_C *cs_register_client_c;
137 TCS_SuplaRegisterClient_D *cs_register_client_d;
138 TSC_SuplaRegisterClientResult *sc_register_client_result;
139 TSC_SuplaRegisterClientResult_B *sc_register_client_result_b;
140 TSC_SuplaRegisterClientResult_C *sc_register_client_result_c;
141 TSC_SuplaRegisterClientResult_D *sc_register_client_result_d;
142 TDS_SuplaDeviceChannelValue *ds_device_channel_value;
143 TDS_SuplaDeviceChannelValue_B *ds_device_channel_value_b;
144 TDS_SuplaDeviceChannelValue_C *ds_device_channel_value_c;
145 TDS_SuplaDeviceChannelExtendedValue *ds_device_channel_extendedvalue;
146 TSC_SuplaLocation *sc_location;
147 TSC_SuplaLocationPack *sc_location_pack;
148 TSC_SuplaChannelPack *sc_channel_pack;
149 TSC_SuplaChannelPack_B *sc_channel_pack_b;
150 TSC_SuplaChannelPack_C *sc_channel_pack_c;
151 TSC_SuplaChannelPack_D *sc_channel_pack_d;
152 TSC_SuplaChannelPack_E *sc_channel_pack_e;
153 TSC_SuplaChannelValue *sc_channel_value;
154 TSC_SuplaChannelValue_B *sc_channel_value_b;
155 TSC_SuplaEvent *sc_event;
156 TSD_SuplaChannelNewValue *sd_channel_new_value;
157 TSD_SuplaChannelGroupNewValue *sd_channelgroup_new_value;
158 TDS_SuplaChannelNewValueResult *ds_channel_new_value_result;
159 TCS_SuplaChannelNewValue *cs_channel_new_value;
160 TCS_SuplaChannelNewValue_B *cs_channel_new_value_b;
161 TDS_FirmwareUpdateParams *ds_firmware_update_params;
162 TSD_FirmwareUpdate_UrlResult *sc_firmware_update_url_result;
163 TSDC_RegistrationEnabled *sdc_reg_enabled;
164 TSC_SuplaChannelGroupPack *sc_channelgroup_pack;
165 TSC_SuplaChannelGroupPack_B *sc_channelgroup_pack_b;
166 TSC_SuplaChannelGroupRelationPack *sc_channelgroup_relation_pack;
167 TSC_SuplaChannelRelationPack *sc_channel_relation_pack;
168 TSC_SuplaChannelValuePack *sc_channelvalue_pack;
169 TSC_SuplaChannelValuePack_B *sc_channelvalue_pack_b;
170 TSC_SuplaChannelExtendedValuePack *sc_channelextendedvalue_pack;
171 TCS_SuplaNewValue *cs_new_value;
172 TSC_OAuthTokenRequestResult *sc_oauth_tokenrequest_result;
173 TCS_SuperUserAuthorizationRequest *cs_superuser_authorization_request;
174 TSC_SuperUserAuthorizationResult *sc_superuser_authorization_result;
175 TCS_DeviceCalCfgRequest *cs_device_calcfg_request;
176 TCS_DeviceCalCfgRequest_B *cs_device_calcfg_request_b;
177 TSC_DeviceCalCfgResult *sc_device_calcfg_result;
178 TSD_DeviceCalCfgRequest *sd_device_calcfg_request;
179 TDS_DeviceCalCfgResult *ds_device_calcfg_result;
180 TSDC_UserLocalTimeResult *sdc_user_localtime_result;
181 TCSD_ChannelStateRequest *csd_channel_state_request;
182 TDSC_ChannelState *dsc_channel_state;
183 TCS_ChannelBasicCfgRequest *cs_channel_basic_cfg_request;
184 TSC_ChannelBasicCfg *sc_channel_basic_cfg;
185 TCS_SetChannelFunction *cs_set_channel_function;
186 TSC_SetChannelFunctionResult *sc_set_channel_function_result;
187 TDCS_SetCaption *dcs_set_caption;
188 TSCD_SetCaptionResult *scd_set_caption_result;
189 TSC_ClientsReconnectRequestResult *sc_clients_reconnect_result;
190 TCS_SetRegistrationEnabled *cs_set_registration_enabled;
191 TSC_SetRegistrationEnabledResult *sc_set_registration_enabled_result;
192 TCS_DeviceReconnectRequest *cs_device_reconnect_request;
193 TSC_DeviceReconnectRequestResult *sc_device_reconnect_request_result;
194 TSD_ChannelFunctions *sd_channel_functions;
195 TDS_GetChannelConfigRequest *ds_get_channel_config_request;
196 TSD_ChannelConfig *sd_channel_config;
197 TDS_ActionTrigger *ds_action_trigger;
198 TCS_TimerArmRequest *cs_timer_arm_request;
199 TSC_SuplaScenePack *sc_scene_pack;
200 TSC_SuplaSceneStatePack *sc_scene_state_pack;
201 TCS_Action *cs_action;
202 TCS_ActionWithAuth *cs_action_with_auth;
203 TSC_ActionExecutionResult *sc_action_execution_result;
204 TCS_GetChannelValueWithAuth *cs_get_value_with_auth;
205 TSC_GetChannelValueResult *sc_get_value_result;
206 TDS_RegisterPushNotification *ds_register_push_notification;
207 TDS_PushNotification *ds_push_notification;
208 TCS_RegisterPnClientToken *cs_register_pn_client_token;
209 TSC_RegisterPnClientTokenResult *sc_register_pn_client_token_result;
210 TSDS_SetChannelConfig *sds_set_channel_config_request;
211 TSDS_SetChannelConfigResult *sds_set_channel_config_result;
212 TSD_ChannelConfigFinished *sd_channel_config_finished;
213 TSDS_SetDeviceConfig *sds_set_device_config_request;
214 TSDS_SetDeviceConfigResult *sds_set_device_config_result;
215 TSCS_ChannelConfig *scs_channel_config;
216 TCS_GetChannelConfigRequest *cs_get_channel_config_request;
217 TSC_ChannelConfigUpdateOrResult *sc_channel_config_update_or_result;
218 TSC_DeviceConfigUpdateOrResult *sc_device_config_update_or_result;
219 TCS_GetDeviceConfigRequest *cs_get_device_config_request;
220 TDS_SubdeviceDetails *ds_subdevice_details;
221 TSC_SuplaChannelStatePack *sc_channel_state_pack;
222};
223
224typedef struct {
225 unsigned _supla_int_t call_id;
226 unsigned _supla_int_t rr_id;
227
228 union TsrpcDataPacketData data;
230
231void SRPC_ICACHE_FLASH srpc_params_init(TsrpcParams *params);
232
233void *SRPC_ICACHE_FLASH srpc_init(TsrpcParams *params);
234void SRPC_ICACHE_FLASH srpc_free(void *_srpc);
235
236void SRPC_ICACHE_FLASH srpc_lock(void *_srpc);
237void SRPC_ICACHE_FLASH srpc_unlock(void *_srpc);
238
239char SRPC_ICACHE_FLASH srpc_input_dataexists(void *_srpc);
240char SRPC_ICACHE_FLASH srpc_output_dataexists(void *_srpc);
241unsigned char SRPC_ICACHE_FLASH srpc_out_queue_item_count(void *srpc);
242
243char SRPC_ICACHE_FLASH srpc_iterate(void *_srpc);
244char SRPC_ICACHE_FLASH srpc_iterate_device(void *_srpc);
245TsrpcIterateReason SRPC_ICACHE_FLASH
246srpc_get_last_iterate_reason(void *_srpc);
247
248char SRPC_ICACHE_FLASH srpc_getdata(void *_srpc, TsrpcReceivedData *rd,
249 unsigned _supla_int_t rr_id);
250
251void SRPC_ICACHE_FLASH srpc_rd_free(TsrpcReceivedData *rd);
252
253unsigned char SRPC_ICACHE_FLASH srpc_get_proto_version(void *_srpc);
254void SRPC_ICACHE_FLASH srpc_set_proto_version(void *_srpc,
255 unsigned char version);
256
257unsigned char SRPC_ICACHE_FLASH
258srpc_call_min_version_required(void *_srpc, unsigned _supla_int_t call_id);
259unsigned char SRPC_ICACHE_FLASH
260srpc_call_allowed(void *_srpc, unsigned _supla_int_t call_id);
261
262// device/client <-> server
263_supla_int_t SRPC_ICACHE_FLASH srpc_dcs_async_getversion(void *_srpc);
264_supla_int_t SRPC_ICACHE_FLASH srpc_sdc_async_getversion_result(
265 void *_srpc, char SoftVer[SUPLA_SOFTVER_MAXSIZE]);
266_supla_int_t SRPC_ICACHE_FLASH
267srpc_sdc_async_versionerror(void *_srpc, unsigned char remote_version);
268_supla_int_t SRPC_ICACHE_FLASH srpc_dcs_async_ping_server(void *_srpc);
269_supla_int_t SRPC_ICACHE_FLASH srpc_sdc_async_ping_server_result(void *_srpc);
270_supla_int_t SRPC_ICACHE_FLASH srpc_dcs_async_set_activity_timeout(
271 void *_srpc, TDCS_SuplaSetActivityTimeout *dcs_set_activity_timeout);
272_supla_int_t SRPC_ICACHE_FLASH srpc_dcs_async_set_activity_timeout_result(
273 void *_srpc,
274 TSDC_SuplaSetActivityTimeoutResult *sdc_set_activity_timeout_result);
275_supla_int_t SRPC_ICACHE_FLASH
276srpc_dcs_async_get_registration_enabled(void *_srpc);
277_supla_int_t SRPC_ICACHE_FLASH srpc_sdc_async_get_registration_enabled_result(
278 void *_srpc, TSDC_RegistrationEnabled *reg_enabled);
279_supla_int_t SRPC_ICACHE_FLASH srpc_dcs_async_get_user_localtime(void *_srpc);
280_supla_int_t SRPC_ICACHE_FLASH srpc_sdc_async_get_user_localtime_result(
281 void *_srpc, TSDC_UserLocalTimeResult *localtime);
282_supla_int_t SRPC_ICACHE_FLASH srpc_csd_async_get_channel_state(
283 void *_srpc, TCSD_ChannelStateRequest *request);
284_supla_int_t SRPC_ICACHE_FLASH
285srpc_csd_async_channel_state_result(void *_srpc, TDSC_ChannelState *state);
286
287_supla_int_t SRPC_ICACHE_FLASH
288srpc_dcs_async_set_channel_caption(void *_srpc, TDCS_SetCaption *caption);
289_supla_int_t SRPC_ICACHE_FLASH srpc_scd_async_set_channel_caption_result(
290 void *_srpc, TSCD_SetCaptionResult *caption);
291
292#ifndef SRPC_EXCLUDE_DEVICE
293// device <-> server
294_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_registerdevice(
295 void *_srpc, TDS_SuplaRegisterDevice *registerdevice);
296_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_registerdevice_b(
297 void *_srpc, TDS_SuplaRegisterDevice_B *registerdevice); // ver. >= 2
298_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_registerdevice_c(
299 void *_srpc, TDS_SuplaRegisterDevice_C *registerdevice); // ver. >= 6
300_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_registerdevice_d(
301 void *_srpc, TDS_SuplaRegisterDevice_D *registerdevice); // ver. >= 7
302_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_registerdevice_e(
303 void *_srpc, TDS_SuplaRegisterDevice_E *registerdevice); // ver. >= 10
304_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_registerdevice_f(
305 void *_srpc, TDS_SuplaRegisterDevice_F *registerdevice); // ver. >= 23
306_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_registerdevice_g(
307 void *_srpc, TDS_SuplaRegisterDevice_G *registerdevice); // ver. >= 25
308_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_registerdevice_result(
309 void *_srpc, TSD_SuplaRegisterDeviceResult *registerdevice_result);
310_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_registerdevice_result_b(
311 void *_srpc,
312 TSD_SuplaRegisterDeviceResult_B *registerdevice_result); // ver. >= 25
313_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_registerdevice_in_chunks(
314 void *_srpc, TDS_SuplaRegisterDeviceHeader *registerdevice,
315 TDS_SuplaDeviceChannel_D *(*get_channel_data_callback)(int)); // ver. >= 23
316_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_registerdevice_in_chunks_g(
317 void *_srpc, TDS_SuplaRegisterDeviceHeader *registerdevice,
318 TDS_SuplaDeviceChannel_E *(*get_channel_data_callback)(int)); // ver. >= 25
319
320_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_channel_value_changed(
321 void *_srpc, unsigned char channel_number, char *value);
322_supla_int_t SRPC_ICACHE_FLASH
323srpc_ds_async_channel_value_changed_b(void *_srpc, unsigned char channel_number,
324 char *value, unsigned char offline);
325_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_channel_value_changed_c(
326 void *_srpc, unsigned char channel_number, char *value,
327 unsigned char offline, unsigned _supla_int_t validity_time_sec);
328_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_channel_extendedvalue_changed(
329 void *_srpc, unsigned char channel_number,
331_supla_int_t SRPC_ICACHE_FLASH
332srpc_sd_async_set_channel_value(void *_srpc, TSD_SuplaChannelNewValue *value);
333_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_set_channelgroup_value(
334 void *_srpc, TSD_SuplaChannelGroupNewValue *value); // ver. >= 13
335_supla_int_t SRPC_ICACHE_FLASH
336srpc_ds_async_set_channel_result(void *_srpc, unsigned char ChannelNumber,
337 _supla_int_t SenderID, char Success);
338_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_get_firmware_update_url(
339 void *_srpc, TDS_FirmwareUpdateParams *params);
340_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_get_firmware_update_url_result(
341 void *_srpc, TSD_FirmwareUpdate_UrlResult *result);
342_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_device_sync_done(void *_srpc);
343_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_device_calcfg_request(
344 void *_srpc, TSD_DeviceCalCfgRequest *request);
345_supla_int_t SRPC_ICACHE_FLASH
346srpc_ds_async_device_calcfg_result(void *_srpc, TDS_DeviceCalCfgResult *result);
347_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_get_channel_functions(void *_srpc);
348_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_get_channel_functions_result(
349 void *_srpc, TSD_ChannelFunctions *result);
350_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_get_channel_config_request(
351 void *_srpc, TDS_GetChannelConfigRequest *request);
352_supla_int_t SRPC_ICACHE_FLASH
353srpc_sd_async_get_channel_config_result(void *_srpc, TSD_ChannelConfig *config);
354_supla_int_t SRPC_ICACHE_FLASH
355srpc_ds_async_action_trigger(void *_srpc, TDS_ActionTrigger *action_trigger);
356_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_register_push_notification(
357 void *_srpc, TDS_RegisterPushNotification *reg);
358_supla_int_t SRPC_ICACHE_FLASH
359srpc_ds_async_send_push_notification(void *_srpc, TDS_PushNotification *push);
360_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_set_channel_config_request(
361 void *_srpc, TSDS_SetChannelConfig *config);
362_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_set_channel_config_result(
363 void *_srpc, TSDS_SetChannelConfigResult *result);
364_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_set_channel_config_request(
365 void *_srpc, TSDS_SetChannelConfig *config);
366_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_set_channel_config_result(
367 void *_srpc, TSDS_SetChannelConfigResult *result);
368_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_channel_config_finished(
369 void *_srpc, TSD_ChannelConfigFinished *fin);
370_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_set_device_config_request(
371 void *_srpc, TSDS_SetDeviceConfig *config);
372_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_set_device_config_result(
373 void *_srpc, TSDS_SetDeviceConfigResult *result);
374_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_set_device_config_request(
375 void *_srpc, TSDS_SetDeviceConfig *config);
376_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_set_device_config_result(
377 void *_srpc, TSDS_SetDeviceConfigResult *result);
378_supla_int_t SRPC_ICACHE_FLASH
379srpc_ds_async_set_subdevice_details(void *_srpc, TDS_SubdeviceDetails *reg);
380#endif /*SRPC_EXCLUDE_DEVICE*/
381
382#ifndef SRPC_EXCLUDE_CLIENT
383// client <-> server
384_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_registerclient(
385 void *_srpc, TCS_SuplaRegisterClient *registerclient);
386_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_registerclient_b(
387 void *_srpc, TCS_SuplaRegisterClient_B *registerclient); // ver. >= 6
388_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_registerclient_c(
389 void *_srpc, TCS_SuplaRegisterClient_C *registerclient); // ver. >= 7
390_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_registerclient_d(
391 void *_srpc, TCS_SuplaRegisterClient_D *registerclient); // ver. >= 11
392_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_registerclient_result(
393 void *_srpc, TSC_SuplaRegisterClientResult *registerclient_result);
394_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_registerclient_result_b(
395 void *_srpc,
396 TSC_SuplaRegisterClientResult_B *registerclient_result); // ver. >= 9
397_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_registerclient_result_c(
398 void *_srpc,
399 TSC_SuplaRegisterClientResult_C *registerclient_result); // ver. >= 17
400_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_registerclient_result_d(
401 void *_srpc,
402 TSC_SuplaRegisterClientResult_D *registerclient_result); // ver. >= 19
403_supla_int_t SRPC_ICACHE_FLASH
404srpc_sc_async_location_update(void *_srpc, TSC_SuplaLocation *location);
405_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_locationpack_update(
406 void *_srpc, TSC_SuplaLocationPack *location_pack);
407_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelpack_update(
408 void *_srpc, TSC_SuplaChannelPack *channel_pack);
409_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelpack_update_b(
410 void *_srpc, TSC_SuplaChannelPack_B *channel_pack); // ver. >= 8
411_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelpack_update_c(
412 void *_srpc, TSC_SuplaChannelPack_C *channel_pack); // ver. >= 10
413_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelpack_update_d(
414 void *_srpc, TSC_SuplaChannelPack_D *channel_pack); // ver. >= 15
415_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelpack_update_e(
416 void *_srpc, TSC_SuplaChannelPack_E *channel_pack); // ver. >= 23
417_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channel_value_update(
418 void *_srpc, TSC_SuplaChannelValue *channel_item_value);
419_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channel_value_update_b(
420 void *_srpc, TSC_SuplaChannelValue_B *channel_item_value);
421_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelgroup_pack_update(
422 void *_srpc, TSC_SuplaChannelGroupPack *channelgroup_pack); // ver. >= 9
423_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelgroup_pack_update_b(
424 void *_srpc, TSC_SuplaChannelGroupPack_B *channelgroup_pack); // ver. >= 10
425_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelgroup_relation_pack_update(
427 *channelgroup_relation_pack); // ver. >= 9
428_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channel_relation_pack_update(
429 void *_srpc, TSC_SuplaChannelRelationPack *relation_pack); // ver. >= 21
430_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelvalue_pack_update(
431 void *_srpc, TSC_SuplaChannelValuePack *channelvalue_pack); // ver. >= 9
432_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelvalue_pack_update_b(
433 void *_srpc, TSC_SuplaChannelValuePack_B *channelvalue_pack); // ver. >= 15
434_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelextendedvalue_pack_update(
435 void *_srpc,
436 TSC_SuplaChannelExtendedValuePack *extendedvalue_pack); // ver. >= 10
437_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channel_state_pack_update(
438 void *_srpc, TSC_SuplaChannelStatePack *state_pack); // ver. >= 26
439_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_get_next(void *_srpc);
440_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_event(void *_srpc,
441 TSC_SuplaEvent *event);
442_supla_int_t SRPC_ICACHE_FLASH
443srpc_cs_async_set_channel_value(void *_srpc, TCS_SuplaChannelNewValue *value);
444_supla_int_t SRPC_ICACHE_FLASH
445srpc_cs_async_set_value(void *_srpc, TCS_SuplaNewValue *value); // ver. >= 9
446_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_set_channel_value_b(
447 void *_srpc, TCS_SuplaChannelNewValue_B *value);
448_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_oauth_token_request(void *_srpc);
449_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_oauth_token_request_result(
450 void *_srpc, TSC_OAuthTokenRequestResult *result);
451_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_superuser_authorization_request(
452 void *_srpc, TCS_SuperUserAuthorizationRequest *request);
453_supla_int_t SRPC_ICACHE_FLASH
454srpc_cs_async_get_superuser_authorization_result(void *_srpc);
455_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_superuser_authorization_result(
456 void *_srpc, TSC_SuperUserAuthorizationResult *result);
457_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_device_calcfg_request(
458 void *_srpc, TCS_DeviceCalCfgRequest *request);
459_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_device_calcfg_request_b(
460 void *_srpc, TCS_DeviceCalCfgRequest_B *request);
461_supla_int_t SRPC_ICACHE_FLASH
462srpc_sc_async_device_calcfg_result(void *_srpc, TSC_DeviceCalCfgResult *result);
463_supla_int_t SRPC_ICACHE_FLASH
464srpc_cs_async_get_channel_basic_cfg(void *_srpc, _supla_int_t ChannelID);
465_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channel_basic_cfg_result(
466 void *_srpc, TSC_ChannelBasicCfg *basic_cfg);
467_supla_int_t SRPC_ICACHE_FLASH
468srpc_cs_async_set_channel_function(void *_srpc, TCS_SetChannelFunction *func);
469_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_set_channel_function_result(
470 void *_srpc, TSC_SetChannelFunctionResult *result);
471_supla_int_t SRPC_ICACHE_FLASH
472srpc_cs_async_set_channel_group_caption(void *_srpc, TDCS_SetCaption *caption);
473_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_set_channel_group_caption_result(
474 void *_srpc, TSCD_SetCaptionResult *caption);
475_supla_int_t SRPC_ICACHE_FLASH
476srpc_cs_async_set_location_caption(void *_srpc, TDCS_SetCaption *caption);
477_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_set_location_caption_result(
478 void *_srpc, TSCD_SetCaptionResult *caption);
479_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_set_scene_caption(
480 void *_srpc, TDCS_SetCaption *caption); // ver. >= 19
481_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_set_scene_caption_result(
482 void *_srpc, TSCD_SetCaptionResult *caption); // ver. >= 19
483_supla_int_t SRPC_ICACHE_FLASH
484srpc_cs_async_clients_reconnect_request(void *_srpc);
485_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_clients_reconnect_request_result(
486 void *_srpc, TSC_ClientsReconnectRequestResult *result);
487_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_set_registration_enabled(
488 void *_srpc, TCS_SetRegistrationEnabled *reg_enabled);
489_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_set_registration_enabled_result(
490 void *_srpc, TSC_SetRegistrationEnabledResult *result);
491_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_device_reconnect_request(
492 void *_srpc, TCS_DeviceReconnectRequest *request);
493_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_device_reconnect_request_result(
494 void *_srpc, TSC_DeviceReconnectRequestResult *result);
495_supla_int_t SRPC_ICACHE_FLASH
496srpc_cs_async_timer_arm(void *_srpc, TCS_TimerArmRequest *request);
497_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_scene_pack_update(
498 void *_srpc, TSC_SuplaScenePack *scene_pack); // ver. >= 18
499_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_scene_state_pack_update(
500 void *_srpc, TSC_SuplaSceneStatePack *scene_status_pack); // ver. >= 18
501_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_execute_action(void *_srpc,
502 TCS_Action *action);
503_supla_int_t SRPC_ICACHE_FLASH
504srpc_cs_async_execute_action_with_auth(void *_srpc, TCS_ActionWithAuth *action);
505_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_action_execution_result(
506 void *_srpc, TSC_ActionExecutionResult *result);
507_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_get_channel_value_with_auth(
508 void *_srpc, TCS_GetChannelValueWithAuth *vwa);
509_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_get_channel_value_result(
510 void *_srpc, TSC_GetChannelValueResult *result);
511_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_register_pn_client_token(
512 void *_srpc, TCS_RegisterPnClientToken *reg);
513_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_register_pn_client_token_result(
514 void *_srpc, TSC_RegisterPnClientTokenResult *result);
515_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_get_channel_config_request(
516 void *_srpc, TCS_GetChannelConfigRequest *request);
517_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channel_config_update_or_result(
518 void *_srpc, TSC_ChannelConfigUpdateOrResult *config);
519_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_set_channel_config_request(
520 void *_srpc, TSCS_ChannelConfig *config);
521_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_get_device_config_request(
522 void *_srpc, TCS_GetDeviceConfigRequest *request);
523_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_device_config_update_or_result(
524 void *_srpc, TSC_DeviceConfigUpdateOrResult *config);
525#endif /*SRPC_EXCLUDE_CLIENT*/
526
527#ifndef SRPC_EXCLUDE_EXTENDEDVALUE_TOOLS
528
529_supla_int_t SRPC_ICACHE_FLASH srpc_evtool_v3_emextended2extended(
532
533_supla_int_t SRPC_ICACHE_FLASH
534srpc_evtool_v3_extended2emextended(const TSuplaChannelExtendedValue *ev,
536
537_supla_int_t srpc_evtool_extended2emextended_latest(
540
541#ifdef USE_DEPRECATED_EMEV_V2
542
543_supla_int_t SRPC_ICACHE_FLASH
544srpc_evtool_emev_v2to3(const TElectricityMeter_ExtendedValue_V2 *v2,
546
547_supla_int_t SRPC_ICACHE_FLASH
548srpc_evtool_emev_v3to2(const TElectricityMeter_ExtendedValue_V3 *v3,
549 TElectricityMeter_ExtendedValue_V2 *v2);
550
551#ifdef USE_DEPRECATED_EMEV_V1
552_supla_int_t SRPC_ICACHE_FLASH
553srpc_evtool_v1_emextended2extended(const TElectricityMeter_ExtendedValue *em_ev,
555_supla_int_t SRPC_ICACHE_FLASH
556srpc_evtool_v1_extended2emextended(const TSuplaChannelExtendedValue *ev,
557 TElectricityMeter_ExtendedValue *em_ev);
558
559_supla_int_t SRPC_ICACHE_FLASH
560srpc_evtool_emev_v1to2(const TElectricityMeter_ExtendedValue *v1,
561 TElectricityMeter_ExtendedValue_V2 *v2);
562_supla_int_t SRPC_ICACHE_FLASH
563srpc_evtool_emev_v2to1(const TElectricityMeter_ExtendedValue_V2 *v2,
564 TElectricityMeter_ExtendedValue *v1);
565
566#endif /*USE_DEPRECATED_EMEV_V1*/
567
568_supla_int_t SRPC_ICACHE_FLASH srpc_evtool_v2_emextended2extended(
569 const TElectricityMeter_ExtendedValue_V2 *em_ev,
571_supla_int_t SRPC_ICACHE_FLASH
572srpc_evtool_v2_extended2emextended(const TSuplaChannelExtendedValue *ev,
573 TElectricityMeter_ExtendedValue_V2 *em_ev);
574
575_supla_int_t SRPC_ICACHE_FLASH srpc_evtool_v1_extended2thermostatextended(
577_supla_int_t SRPC_ICACHE_FLASH srpc_evtool_v1_thermostatextended2extended(
579
580#endif /*USE_DEPRECATED_EMEV_V2*/
581
582#ifndef SRPC_EXCLUDE_CLIENT
583_supla_int_t SRPC_ICACHE_FLASH srpc_evtool_v1_icextended2extended(
586_supla_int_t SRPC_ICACHE_FLASH
587srpc_evtool_v1_extended2icextended(const TSuplaChannelExtendedValue *ev,
589_supla_int_t SRPC_ICACHE_FLASH srpc_evtool_value_add(
591_supla_int_t SRPC_ICACHE_FLASH
592srpc_evtool_value_get(TSuplaChannelExtendedValue *ev, unsigned short index,
594#endif /*SRPC_EXCLUDE_CLIENT*/
595
596#endif /*SRPC_EXCLUDE_EXTENDEDVALUE_TOOLS*/
597
598#ifdef __cplusplus
599}
600#endif
601
602#endif /* supladex_H_ */
Definition proto.h:2671
Definition proto.h:1719
Definition proto.h:1702
Definition proto.h:2763
Definition proto.h:2313
Definition proto.h:2304
Definition proto.h:2858
Definition proto.h:3141
Definition proto.h:1741
Definition proto.h:2944
Definition proto.h:4019
Definition proto.h:2809
Definition proto.h:2847
Definition proto.h:2173
Definition proto.h:1860
Definition proto.h:1854
Definition proto.h:1866
Definition proto.h:1757
Definition proto.h:1770
Definition proto.h:1783
Definition proto.h:1746
Definition proto.h:3887
Definition proto.h:2820
Definition proto.h:732
Definition proto.h:753
Definition proto.h:2721
Definition proto.h:3940
Definition proto.h:2340
Definition proto.h:1886
Definition proto.h:3167
Definition proto.h:3965
Definition proto.h:3954
Definition proto.h:3980
Definition proto.h:1268
Definition proto.h:1218
Definition proto.h:1226
Definition proto.h:1211
Definition proto.h:988
Definition proto.h:1014
Definition proto.h:1120
Definition proto.h:1047
Definition proto.h:1062
Definition proto.h:1080
Definition proto.h:1098
Definition proto.h:1140
Definition proto.h:1162
Definition proto.h:829
Definition proto.h:2029
Definition proto.h:2831
Definition proto.h:3148
Definition proto.h:1724
Definition proto.h:2789
Definition proto.h:3159
Definition proto.h:2843
Definition proto.h:2322
Definition proto.h:2937
Definition proto.h:2862
Definition proto.h:1731
Definition proto.h:2075
Definition proto.h:1919
Definition proto.h:4024
Definition proto.h:2814
Definition proto.h:2854
Definition proto.h:2178
Definition proto.h:1322
Definition proto.h:1529
Definition proto.h:1520
Definition proto.h:1546
Definition proto.h:1377
Definition proto.h:1462
Definition proto.h:1471
Definition proto.h:1480
Definition proto.h:1349
Definition proto.h:1577
Definition proto.h:4028
Definition proto.h:1312
Definition proto.h:1302
Definition proto.h:1285
Definition proto.h:1275
Definition proto.h:1873
Definition proto.h:814
Definition proto.h:805
Definition proto.h:1809
Definition proto.h:1823
Definition proto.h:1838
Definition proto.h:1797
Definition proto.h:1598
Definition proto.h:1620
Definition proto.h:1907
Definition proto.h:719
Definition proto.h:748
Definition proto.h:726
Definition proto.h:2658
Definition proto.h:3192
Definition proto.h:2920
Definition proto.h:2908
Definition proto.h:3199
Definition proto.h:3176
Definition proto.h:2867
Definition proto.h:2330
Definition proto.h:1902
Definition proto.h:1255
Definition proto.h:1243
Definition proto.h:1197
Definition proto.h:1184
Definition proto.h:799
Definition proto.h:2640
Definition srpc.h:99
Definition srpc.h:224
Definition srpc.h:118