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#include "eh.h"
11#include "proto.h"
12#if defined(ESP32)
13#include <esp8266-compat.h>
14#endif
15
16#ifdef __ANDROID__
17#define SRPC_EXCLUDE_DEVICE
18#endif /*__ANDROID__*/
19
20#if defined(ESP8266) || defined(ESP32)
21
22#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
23#define SRPC_WITHOUT_OUT_QUEUE
24#define SRPC_WITHOUT_IN_QUEUE
25#define PACKET_INTEGRITY_BUFFER_DISABLED
26#endif /* defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) */
27
28#define SRPC_EXCLUDE_CLIENT
29#define SRPC_ICACHE_FLASH ICACHE_FLASH_ATTR
30
31#if !defined(ESP32)
32#include <mem.h>
33#include <os_type.h>
34#endif
35#else
36#define SRPC_ICACHE_FLASH
37#endif
38
39#if defined(__AVR__) || defined(ARDUINO) || defined(SUPLA_DEVICE)
40#define SRPC_EXCLUDE_CLIENT
41#define SRPC_WITHOUT_OUT_QUEUE
42#define SRPC_WITHOUT_IN_QUEUE
43#define PACKET_INTEGRITY_BUFFER_DISABLED
44#endif /*__AVR__*/
45
46#ifdef __cplusplus
47extern "C" {
48#endif
49
50#if defined(SUPLA_DEVICE) || defined(ESP8266) || defined(ESP32) || \
51 defined(__AVR__) || defined(ARDUINO_ARCH_ESP8266) || \
52 defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_AVR)
53#define SRPC_WITH_PACKET_LOG_HOOKS
54#endif
55
56typedef _supla_int_t (*_func_srpc_DataRW)(void *buf, _supla_int_t count,
57 void *user_params);
58typedef void (*_func_srpc_event_OnRemoteCallReceived)(
59 void *_srpc, unsigned _supla_int_t rr_id, unsigned _supla_int_t call_id,
60 void *user_params, unsigned char proto_version);
61typedef void (*_func_srpc_event_BeforeCall)(void *_srpc,
62 unsigned _supla_int_t call_id,
63 void *user_params);
64#ifdef SRPC_WITH_PACKET_LOG_HOOKS
65typedef void (*_func_srpc_event_OnPacketSent)(
66 void *_srpc,
67 unsigned _supla_int_t call_id,
68 void *data,
69 unsigned _supla_int_t data_size,
70 void *user_params);
71typedef void (*_func_srpc_event_OnPacketReceived)(
72 void *_srpc,
73 unsigned _supla_int_t call_id,
74 void *data,
75 unsigned _supla_int_t data_size,
76 void *user_params);
77#endif
78typedef void (*_func_srpc_event_OnVersionError)(void *_srpc,
79 unsigned char remote_version,
80 void *user_params);
81typedef void (*_func_srpc_event_OnMinVersionRequired)(
82 void *_srpc, unsigned _supla_int_t call_id, unsigned char min_version,
83 void *user_params);
84
85typedef struct {
86 _func_srpc_DataRW data_read;
87 _func_srpc_DataRW data_write;
88 _func_srpc_event_OnRemoteCallReceived on_remote_call_received;
89 _func_srpc_event_OnVersionError on_version_error;
90 _func_srpc_event_BeforeCall before_async_call;
91#ifdef SRPC_WITH_PACKET_LOG_HOOKS
92 _func_srpc_event_OnPacketSent on_packet_sent;
93 _func_srpc_event_OnPacketReceived on_packet_received;
94#endif
95 _func_srpc_event_OnMinVersionRequired on_min_version_required;
96
97 TEventHandler *eh;
98
99 void *user_params;
101
103 TDCS_SuplaPingServer *dcs_ping;
104 TSDC_SuplaPingServerResult *sdc_ping_result;
105 TSDC_SuplaGetVersionResult *sdc_getversion_result;
106 TSDC_SuplaVersionError *sdc_version_error;
107 TDCS_SuplaSetActivityTimeout *dcs_set_activity_timeout;
108 TSDC_SuplaSetActivityTimeoutResult *sdc_set_activity_timeout_result;
109 TDS_SuplaRegisterDevice *ds_register_device;
110 TDS_SuplaRegisterDevice_B *ds_register_device_b;
111 TDS_SuplaRegisterDevice_C *ds_register_device_c;
112 TDS_SuplaRegisterDevice_D *ds_register_device_d;
113 TDS_SuplaRegisterDevice_E *ds_register_device_e;
114 TDS_SuplaRegisterDevice_F *ds_register_device_f;
115 TDS_SuplaRegisterDevice_G *ds_register_device_g;
116 TSD_SuplaRegisterDeviceResult *sd_register_device_result;
117 TSD_SuplaRegisterDeviceResult_B *sd_register_device_result_b;
118 TCS_SuplaRegisterClient *cs_register_client;
119 TCS_SuplaRegisterClient_B *cs_register_client_b;
120 TCS_SuplaRegisterClient_C *cs_register_client_c;
121 TCS_SuplaRegisterClient_D *cs_register_client_d;
122 TSC_SuplaRegisterClientResult *sc_register_client_result;
123 TSC_SuplaRegisterClientResult_B *sc_register_client_result_b;
124 TSC_SuplaRegisterClientResult_C *sc_register_client_result_c;
125 TSC_SuplaRegisterClientResult_D *sc_register_client_result_d;
126 TDS_SuplaDeviceChannelValue *ds_device_channel_value;
127 TDS_SuplaDeviceChannelValue_B *ds_device_channel_value_b;
128 TDS_SuplaDeviceChannelValue_C *ds_device_channel_value_c;
129 TDS_SuplaDeviceChannelExtendedValue *ds_device_channel_extendedvalue;
130 TSC_SuplaLocation *sc_location;
131 TSC_SuplaLocationPack *sc_location_pack;
132 TSC_SuplaChannelPack *sc_channel_pack;
133 TSC_SuplaChannelPack_B *sc_channel_pack_b;
134 TSC_SuplaChannelPack_C *sc_channel_pack_c;
135 TSC_SuplaChannelPack_D *sc_channel_pack_d;
136 TSC_SuplaChannelPack_E *sc_channel_pack_e;
137 TSC_SuplaChannelValue *sc_channel_value;
138 TSC_SuplaChannelValue_B *sc_channel_value_b;
139 TSC_SuplaEvent *sc_event;
140 TSD_SuplaChannelNewValue *sd_channel_new_value;
141 TSD_SuplaChannelGroupNewValue *sd_channelgroup_new_value;
142 TDS_SuplaChannelNewValueResult *ds_channel_new_value_result;
143 TCS_SuplaChannelNewValue *cs_channel_new_value;
144 TCS_SuplaChannelNewValue_B *cs_channel_new_value_b;
145 TDS_FirmwareUpdateParams *ds_firmware_update_params;
146 TSD_FirmwareUpdate_UrlResult *sc_firmware_update_url_result;
147 TSDC_RegistrationEnabled *sdc_reg_enabled;
148 TSC_SuplaChannelGroupPack *sc_channelgroup_pack;
149 TSC_SuplaChannelGroupPack_B *sc_channelgroup_pack_b;
150 TSC_SuplaChannelGroupRelationPack *sc_channelgroup_relation_pack;
151 TSC_SuplaChannelRelationPack *sc_channel_relation_pack;
152 TSC_SuplaChannelValuePack *sc_channelvalue_pack;
153 TSC_SuplaChannelValuePack_B *sc_channelvalue_pack_b;
154 TSC_SuplaChannelExtendedValuePack *sc_channelextendedvalue_pack;
155 TCS_SuplaNewValue *cs_new_value;
156 TSC_OAuthTokenRequestResult *sc_oauth_tokenrequest_result;
157 TCS_SuperUserAuthorizationRequest *cs_superuser_authorization_request;
158 TSC_SuperUserAuthorizationResult *sc_superuser_authorization_result;
159 TCS_DeviceCalCfgRequest *cs_device_calcfg_request;
160 TCS_DeviceCalCfgRequest_B *cs_device_calcfg_request_b;
161 TSC_DeviceCalCfgResult *sc_device_calcfg_result;
162 TSD_DeviceCalCfgRequest *sd_device_calcfg_request;
163 TDS_DeviceCalCfgResult *ds_device_calcfg_result;
164 TSDC_UserLocalTimeResult *sdc_user_localtime_result;
165 TCSD_ChannelStateRequest *csd_channel_state_request;
166 TDSC_ChannelState *dsc_channel_state;
167 TCS_ChannelBasicCfgRequest *cs_channel_basic_cfg_request;
168 TSC_ChannelBasicCfg *sc_channel_basic_cfg;
169 TCS_SetChannelFunction *cs_set_channel_function;
170 TSC_SetChannelFunctionResult *sc_set_channel_function_result;
171 TDCS_SetCaption *dcs_set_caption;
172 TSCD_SetCaptionResult *scd_set_caption_result;
173 TSC_ClientsReconnectRequestResult *sc_clients_reconnect_result;
174 TCS_SetRegistrationEnabled *cs_set_registration_enabled;
175 TSC_SetRegistrationEnabledResult *sc_set_registration_enabled_result;
176 TCS_DeviceReconnectRequest *cs_device_reconnect_request;
177 TSC_DeviceReconnectRequestResult *sc_device_reconnect_request_result;
178 TSD_ChannelFunctions *sd_channel_functions;
179 TDS_GetChannelConfigRequest *ds_get_channel_config_request;
180 TSD_ChannelConfig *sd_channel_config;
181 TDS_ActionTrigger *ds_action_trigger;
182 TCS_TimerArmRequest *cs_timer_arm_request;
183 TSC_SuplaScenePack *sc_scene_pack;
184 TSC_SuplaSceneStatePack *sc_scene_state_pack;
185 TCS_Action *cs_action;
186 TCS_ActionWithAuth *cs_action_with_auth;
187 TSC_ActionExecutionResult *sc_action_execution_result;
188 TCS_GetChannelValueWithAuth *cs_get_value_with_auth;
189 TSC_GetChannelValueResult *sc_get_value_result;
190 TDS_RegisterPushNotification *ds_register_push_notification;
191 TDS_PushNotification *ds_push_notification;
192 TCS_RegisterPnClientToken *cs_register_pn_client_token;
193 TSC_RegisterPnClientTokenResult *sc_register_pn_client_token_result;
194 TSDS_SetChannelConfig *sds_set_channel_config_request;
195 TSDS_SetChannelConfigResult *sds_set_channel_config_result;
196 TSD_ChannelConfigFinished *sd_channel_config_finished;
197 TSDS_SetDeviceConfig *sds_set_device_config_request;
198 TSDS_SetDeviceConfigResult *sds_set_device_config_result;
199 TSCS_ChannelConfig *scs_channel_config;
200 TCS_GetChannelConfigRequest *cs_get_channel_config_request;
201 TSC_ChannelConfigUpdateOrResult *sc_channel_config_update_or_result;
202 TSC_DeviceConfigUpdateOrResult *sc_device_config_update_or_result;
203 TCS_GetDeviceConfigRequest *cs_get_device_config_request;
204 TDS_SubdeviceDetails *ds_subdevice_details;
205 TSC_SuplaChannelStatePack *sc_channel_state_pack;
206};
207
208typedef struct {
209 unsigned _supla_int_t call_id;
210 unsigned _supla_int_t rr_id;
211
212 union TsrpcDataPacketData data;
214
215void SRPC_ICACHE_FLASH srpc_params_init(TsrpcParams *params);
216
217void *SRPC_ICACHE_FLASH srpc_init(TsrpcParams *params);
218void SRPC_ICACHE_FLASH srpc_free(void *_srpc);
219
220void SRPC_ICACHE_FLASH srpc_lock(void *_srpc);
221void SRPC_ICACHE_FLASH srpc_unlock(void *_srpc);
222
223char SRPC_ICACHE_FLASH srpc_input_dataexists(void *_srpc);
224char SRPC_ICACHE_FLASH srpc_output_dataexists(void *_srpc);
225unsigned char SRPC_ICACHE_FLASH srpc_out_queue_item_count(void *srpc);
226
227char SRPC_ICACHE_FLASH srpc_iterate(void *_srpc);
228char SRPC_ICACHE_FLASH srpc_iterate_device(void *_srpc);
229
230char SRPC_ICACHE_FLASH srpc_getdata(void *_srpc, TsrpcReceivedData *rd,
231 unsigned _supla_int_t rr_id);
232
233void SRPC_ICACHE_FLASH srpc_rd_free(TsrpcReceivedData *rd);
234
235unsigned char SRPC_ICACHE_FLASH srpc_get_proto_version(void *_srpc);
236void SRPC_ICACHE_FLASH srpc_set_proto_version(void *_srpc,
237 unsigned char version);
238
239unsigned char SRPC_ICACHE_FLASH
240srpc_call_min_version_required(void *_srpc, unsigned _supla_int_t call_id);
241unsigned char SRPC_ICACHE_FLASH
242srpc_call_allowed(void *_srpc, unsigned _supla_int_t call_id);
243
244// device/client <-> server
245_supla_int_t SRPC_ICACHE_FLASH srpc_dcs_async_getversion(void *_srpc);
246_supla_int_t SRPC_ICACHE_FLASH srpc_sdc_async_getversion_result(
247 void *_srpc, char SoftVer[SUPLA_SOFTVER_MAXSIZE]);
248_supla_int_t SRPC_ICACHE_FLASH
249srpc_sdc_async_versionerror(void *_srpc, unsigned char remote_version);
250_supla_int_t SRPC_ICACHE_FLASH srpc_dcs_async_ping_server(void *_srpc);
251_supla_int_t SRPC_ICACHE_FLASH srpc_sdc_async_ping_server_result(void *_srpc);
252_supla_int_t SRPC_ICACHE_FLASH srpc_dcs_async_set_activity_timeout(
253 void *_srpc, TDCS_SuplaSetActivityTimeout *dcs_set_activity_timeout);
254_supla_int_t SRPC_ICACHE_FLASH srpc_dcs_async_set_activity_timeout_result(
255 void *_srpc,
256 TSDC_SuplaSetActivityTimeoutResult *sdc_set_activity_timeout_result);
257_supla_int_t SRPC_ICACHE_FLASH
258srpc_dcs_async_get_registration_enabled(void *_srpc);
259_supla_int_t SRPC_ICACHE_FLASH srpc_sdc_async_get_registration_enabled_result(
260 void *_srpc, TSDC_RegistrationEnabled *reg_enabled);
261_supla_int_t SRPC_ICACHE_FLASH srpc_dcs_async_get_user_localtime(void *_srpc);
262_supla_int_t SRPC_ICACHE_FLASH srpc_sdc_async_get_user_localtime_result(
263 void *_srpc, TSDC_UserLocalTimeResult *localtime);
264_supla_int_t SRPC_ICACHE_FLASH srpc_csd_async_get_channel_state(
265 void *_srpc, TCSD_ChannelStateRequest *request);
266_supla_int_t SRPC_ICACHE_FLASH
267srpc_csd_async_channel_state_result(void *_srpc, TDSC_ChannelState *state);
268
269_supla_int_t SRPC_ICACHE_FLASH
270srpc_dcs_async_set_channel_caption(void *_srpc, TDCS_SetCaption *caption);
271_supla_int_t SRPC_ICACHE_FLASH srpc_scd_async_set_channel_caption_result(
272 void *_srpc, TSCD_SetCaptionResult *caption);
273
274#ifndef SRPC_EXCLUDE_DEVICE
275// device <-> server
276_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_registerdevice(
277 void *_srpc, TDS_SuplaRegisterDevice *registerdevice);
278_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_registerdevice_b(
279 void *_srpc, TDS_SuplaRegisterDevice_B *registerdevice); // ver. >= 2
280_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_registerdevice_c(
281 void *_srpc, TDS_SuplaRegisterDevice_C *registerdevice); // ver. >= 6
282_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_registerdevice_d(
283 void *_srpc, TDS_SuplaRegisterDevice_D *registerdevice); // ver. >= 7
284_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_registerdevice_e(
285 void *_srpc, TDS_SuplaRegisterDevice_E *registerdevice); // ver. >= 10
286_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_registerdevice_f(
287 void *_srpc, TDS_SuplaRegisterDevice_F *registerdevice); // ver. >= 23
288_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_registerdevice_g(
289 void *_srpc, TDS_SuplaRegisterDevice_G *registerdevice); // ver. >= 25
290_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_registerdevice_result(
291 void *_srpc, TSD_SuplaRegisterDeviceResult *registerdevice_result);
292_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_registerdevice_result_b(
293 void *_srpc,
294 TSD_SuplaRegisterDeviceResult_B *registerdevice_result); // ver. >= 25
295_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_registerdevice_in_chunks(
296 void *_srpc, TDS_SuplaRegisterDeviceHeader *registerdevice,
297 TDS_SuplaDeviceChannel_D *(*get_channel_data_callback)(int)); // ver. >= 23
298_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_registerdevice_in_chunks_g(
299 void *_srpc, TDS_SuplaRegisterDeviceHeader *registerdevice,
300 TDS_SuplaDeviceChannel_E *(*get_channel_data_callback)(int)); // ver. >= 25
301
302_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_channel_value_changed(
303 void *_srpc, unsigned char channel_number, char *value);
304_supla_int_t SRPC_ICACHE_FLASH
305srpc_ds_async_channel_value_changed_b(void *_srpc, unsigned char channel_number,
306 char *value, unsigned char offline);
307_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_channel_value_changed_c(
308 void *_srpc, unsigned char channel_number, char *value,
309 unsigned char offline, unsigned _supla_int_t validity_time_sec);
310_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_channel_extendedvalue_changed(
311 void *_srpc, unsigned char channel_number,
313_supla_int_t SRPC_ICACHE_FLASH
314srpc_sd_async_set_channel_value(void *_srpc, TSD_SuplaChannelNewValue *value);
315_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_set_channelgroup_value(
316 void *_srpc, TSD_SuplaChannelGroupNewValue *value); // ver. >= 13
317_supla_int_t SRPC_ICACHE_FLASH
318srpc_ds_async_set_channel_result(void *_srpc, unsigned char ChannelNumber,
319 _supla_int_t SenderID, char Success);
320_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_get_firmware_update_url(
321 void *_srpc, TDS_FirmwareUpdateParams *params);
322_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_get_firmware_update_url_result(
323 void *_srpc, TSD_FirmwareUpdate_UrlResult *result);
324_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_device_sync_done(void *_srpc);
325_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_device_calcfg_request(
326 void *_srpc, TSD_DeviceCalCfgRequest *request);
327_supla_int_t SRPC_ICACHE_FLASH
328srpc_ds_async_device_calcfg_result(void *_srpc, TDS_DeviceCalCfgResult *result);
329_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_get_channel_functions(void *_srpc);
330_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_get_channel_functions_result(
331 void *_srpc, TSD_ChannelFunctions *result);
332_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_get_channel_config_request(
333 void *_srpc, TDS_GetChannelConfigRequest *request);
334_supla_int_t SRPC_ICACHE_FLASH
335srpc_sd_async_get_channel_config_result(void *_srpc, TSD_ChannelConfig *config);
336_supla_int_t SRPC_ICACHE_FLASH
337srpc_ds_async_action_trigger(void *_srpc, TDS_ActionTrigger *action_trigger);
338_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_register_push_notification(
339 void *_srpc, TDS_RegisterPushNotification *reg);
340_supla_int_t SRPC_ICACHE_FLASH
341srpc_ds_async_send_push_notification(void *_srpc, TDS_PushNotification *push);
342_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_set_channel_config_request(
343 void *_srpc, TSDS_SetChannelConfig *config);
344_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_set_channel_config_result(
345 void *_srpc, TSDS_SetChannelConfigResult *result);
346_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_set_channel_config_request(
347 void *_srpc, TSDS_SetChannelConfig *config);
348_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_set_channel_config_result(
349 void *_srpc, TSDS_SetChannelConfigResult *result);
350_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_channel_config_finished(
351 void *_srpc, TSD_ChannelConfigFinished *fin);
352_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_set_device_config_request(
353 void *_srpc, TSDS_SetDeviceConfig *config);
354_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_set_device_config_result(
355 void *_srpc, TSDS_SetDeviceConfigResult *result);
356_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_set_device_config_request(
357 void *_srpc, TSDS_SetDeviceConfig *config);
358_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_set_device_config_result(
359 void *_srpc, TSDS_SetDeviceConfigResult *result);
360_supla_int_t SRPC_ICACHE_FLASH
361srpc_ds_async_set_subdevice_details(void *_srpc, TDS_SubdeviceDetails *reg);
362#endif /*SRPC_EXCLUDE_DEVICE*/
363
364#ifndef SRPC_EXCLUDE_CLIENT
365// client <-> server
366_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_registerclient(
367 void *_srpc, TCS_SuplaRegisterClient *registerclient);
368_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_registerclient_b(
369 void *_srpc, TCS_SuplaRegisterClient_B *registerclient); // ver. >= 6
370_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_registerclient_c(
371 void *_srpc, TCS_SuplaRegisterClient_C *registerclient); // ver. >= 7
372_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_registerclient_d(
373 void *_srpc, TCS_SuplaRegisterClient_D *registerclient); // ver. >= 11
374_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_registerclient_result(
375 void *_srpc, TSC_SuplaRegisterClientResult *registerclient_result);
376_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_registerclient_result_b(
377 void *_srpc,
378 TSC_SuplaRegisterClientResult_B *registerclient_result); // ver. >= 9
379_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_registerclient_result_c(
380 void *_srpc,
381 TSC_SuplaRegisterClientResult_C *registerclient_result); // ver. >= 17
382_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_registerclient_result_d(
383 void *_srpc,
384 TSC_SuplaRegisterClientResult_D *registerclient_result); // ver. >= 19
385_supla_int_t SRPC_ICACHE_FLASH
386srpc_sc_async_location_update(void *_srpc, TSC_SuplaLocation *location);
387_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_locationpack_update(
388 void *_srpc, TSC_SuplaLocationPack *location_pack);
389_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelpack_update(
390 void *_srpc, TSC_SuplaChannelPack *channel_pack);
391_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelpack_update_b(
392 void *_srpc, TSC_SuplaChannelPack_B *channel_pack); // ver. >= 8
393_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelpack_update_c(
394 void *_srpc, TSC_SuplaChannelPack_C *channel_pack); // ver. >= 10
395_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelpack_update_d(
396 void *_srpc, TSC_SuplaChannelPack_D *channel_pack); // ver. >= 15
397_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelpack_update_e(
398 void *_srpc, TSC_SuplaChannelPack_E *channel_pack); // ver. >= 23
399_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channel_value_update(
400 void *_srpc, TSC_SuplaChannelValue *channel_item_value);
401_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channel_value_update_b(
402 void *_srpc, TSC_SuplaChannelValue_B *channel_item_value);
403_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelgroup_pack_update(
404 void *_srpc, TSC_SuplaChannelGroupPack *channelgroup_pack); // ver. >= 9
405_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelgroup_pack_update_b(
406 void *_srpc, TSC_SuplaChannelGroupPack_B *channelgroup_pack); // ver. >= 10
407_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelgroup_relation_pack_update(
409 *channelgroup_relation_pack); // ver. >= 9
410_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channel_relation_pack_update(
411 void *_srpc, TSC_SuplaChannelRelationPack *relation_pack); // ver. >= 21
412_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelvalue_pack_update(
413 void *_srpc, TSC_SuplaChannelValuePack *channelvalue_pack); // ver. >= 9
414_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelvalue_pack_update_b(
415 void *_srpc, TSC_SuplaChannelValuePack_B *channelvalue_pack); // ver. >= 15
416_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelextendedvalue_pack_update(
417 void *_srpc,
418 TSC_SuplaChannelExtendedValuePack *extendedvalue_pack); // ver. >= 10
419_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channel_state_pack_update(
420 void *_srpc, TSC_SuplaChannelStatePack *state_pack); // ver. >= 26
421_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_get_next(void *_srpc);
422_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_event(void *_srpc,
423 TSC_SuplaEvent *event);
424_supla_int_t SRPC_ICACHE_FLASH
425srpc_cs_async_set_channel_value(void *_srpc, TCS_SuplaChannelNewValue *value);
426_supla_int_t SRPC_ICACHE_FLASH
427srpc_cs_async_set_value(void *_srpc, TCS_SuplaNewValue *value); // ver. >= 9
428_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_set_channel_value_b(
429 void *_srpc, TCS_SuplaChannelNewValue_B *value);
430_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_oauth_token_request(void *_srpc);
431_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_oauth_token_request_result(
432 void *_srpc, TSC_OAuthTokenRequestResult *result);
433_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_superuser_authorization_request(
434 void *_srpc, TCS_SuperUserAuthorizationRequest *request);
435_supla_int_t SRPC_ICACHE_FLASH
436srpc_cs_async_get_superuser_authorization_result(void *_srpc);
437_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_superuser_authorization_result(
438 void *_srpc, TSC_SuperUserAuthorizationResult *result);
439_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_device_calcfg_request(
440 void *_srpc, TCS_DeviceCalCfgRequest *request);
441_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_device_calcfg_request_b(
442 void *_srpc, TCS_DeviceCalCfgRequest_B *request);
443_supla_int_t SRPC_ICACHE_FLASH
444srpc_sc_async_device_calcfg_result(void *_srpc, TSC_DeviceCalCfgResult *result);
445_supla_int_t SRPC_ICACHE_FLASH
446srpc_cs_async_get_channel_basic_cfg(void *_srpc, _supla_int_t ChannelID);
447_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channel_basic_cfg_result(
448 void *_srpc, TSC_ChannelBasicCfg *basic_cfg);
449_supla_int_t SRPC_ICACHE_FLASH
450srpc_cs_async_set_channel_function(void *_srpc, TCS_SetChannelFunction *func);
451_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_set_channel_function_result(
452 void *_srpc, TSC_SetChannelFunctionResult *result);
453_supla_int_t SRPC_ICACHE_FLASH
454srpc_cs_async_set_channel_group_caption(void *_srpc, TDCS_SetCaption *caption);
455_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_set_channel_group_caption_result(
456 void *_srpc, TSCD_SetCaptionResult *caption);
457_supla_int_t SRPC_ICACHE_FLASH
458srpc_cs_async_set_location_caption(void *_srpc, TDCS_SetCaption *caption);
459_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_set_location_caption_result(
460 void *_srpc, TSCD_SetCaptionResult *caption);
461_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_set_scene_caption(
462 void *_srpc, TDCS_SetCaption *caption); // ver. >= 19
463_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_set_scene_caption_result(
464 void *_srpc, TSCD_SetCaptionResult *caption); // ver. >= 19
465_supla_int_t SRPC_ICACHE_FLASH
466srpc_cs_async_clients_reconnect_request(void *_srpc);
467_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_clients_reconnect_request_result(
468 void *_srpc, TSC_ClientsReconnectRequestResult *result);
469_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_set_registration_enabled(
470 void *_srpc, TCS_SetRegistrationEnabled *reg_enabled);
471_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_set_registration_enabled_result(
472 void *_srpc, TSC_SetRegistrationEnabledResult *result);
473_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_device_reconnect_request(
474 void *_srpc, TCS_DeviceReconnectRequest *request);
475_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_device_reconnect_request_result(
476 void *_srpc, TSC_DeviceReconnectRequestResult *result);
477_supla_int_t SRPC_ICACHE_FLASH
478srpc_cs_async_timer_arm(void *_srpc, TCS_TimerArmRequest *request);
479_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_scene_pack_update(
480 void *_srpc, TSC_SuplaScenePack *scene_pack); // ver. >= 18
481_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_scene_state_pack_update(
482 void *_srpc, TSC_SuplaSceneStatePack *scene_status_pack); // ver. >= 18
483_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_execute_action(void *_srpc,
484 TCS_Action *action);
485_supla_int_t SRPC_ICACHE_FLASH
486srpc_cs_async_execute_action_with_auth(void *_srpc, TCS_ActionWithAuth *action);
487_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_action_execution_result(
488 void *_srpc, TSC_ActionExecutionResult *result);
489_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_get_channel_value_with_auth(
490 void *_srpc, TCS_GetChannelValueWithAuth *vwa);
491_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_get_channel_value_result(
492 void *_srpc, TSC_GetChannelValueResult *result);
493_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_register_pn_client_token(
494 void *_srpc, TCS_RegisterPnClientToken *reg);
495_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_register_pn_client_token_result(
496 void *_srpc, TSC_RegisterPnClientTokenResult *result);
497_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_get_channel_config_request(
498 void *_srpc, TCS_GetChannelConfigRequest *request);
499_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channel_config_update_or_result(
500 void *_srpc, TSC_ChannelConfigUpdateOrResult *config);
501_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_set_channel_config_request(
502 void *_srpc, TSCS_ChannelConfig *config);
503_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_get_device_config_request(
504 void *_srpc, TCS_GetDeviceConfigRequest *request);
505_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_device_config_update_or_result(
506 void *_srpc, TSC_DeviceConfigUpdateOrResult *config);
507#endif /*SRPC_EXCLUDE_CLIENT*/
508
509#ifndef SRPC_EXCLUDE_EXTENDEDVALUE_TOOLS
510
511_supla_int_t SRPC_ICACHE_FLASH srpc_evtool_v3_emextended2extended(
514
515_supla_int_t SRPC_ICACHE_FLASH
516srpc_evtool_v3_extended2emextended(const TSuplaChannelExtendedValue *ev,
518
519_supla_int_t srpc_evtool_extended2emextended_latest(
522
523#ifdef USE_DEPRECATED_EMEV_V2
524
525_supla_int_t SRPC_ICACHE_FLASH
526srpc_evtool_emev_v2to3(const TElectricityMeter_ExtendedValue_V2 *v2,
528
529_supla_int_t SRPC_ICACHE_FLASH
530srpc_evtool_emev_v3to2(const TElectricityMeter_ExtendedValue_V3 *v3,
531 TElectricityMeter_ExtendedValue_V2 *v2);
532
533#ifdef USE_DEPRECATED_EMEV_V1
534_supla_int_t SRPC_ICACHE_FLASH
535srpc_evtool_v1_emextended2extended(const TElectricityMeter_ExtendedValue *em_ev,
537_supla_int_t SRPC_ICACHE_FLASH
538srpc_evtool_v1_extended2emextended(const TSuplaChannelExtendedValue *ev,
539 TElectricityMeter_ExtendedValue *em_ev);
540
541_supla_int_t SRPC_ICACHE_FLASH
542srpc_evtool_emev_v1to2(const TElectricityMeter_ExtendedValue *v1,
543 TElectricityMeter_ExtendedValue_V2 *v2);
544_supla_int_t SRPC_ICACHE_FLASH
545srpc_evtool_emev_v2to1(const TElectricityMeter_ExtendedValue_V2 *v2,
546 TElectricityMeter_ExtendedValue *v1);
547
548#endif /*USE_DEPRECATED_EMEV_V1*/
549
550_supla_int_t SRPC_ICACHE_FLASH srpc_evtool_v2_emextended2extended(
551 const TElectricityMeter_ExtendedValue_V2 *em_ev,
553_supla_int_t SRPC_ICACHE_FLASH
554srpc_evtool_v2_extended2emextended(const TSuplaChannelExtendedValue *ev,
555 TElectricityMeter_ExtendedValue_V2 *em_ev);
556
557_supla_int_t SRPC_ICACHE_FLASH srpc_evtool_v1_extended2thermostatextended(
559_supla_int_t SRPC_ICACHE_FLASH srpc_evtool_v1_thermostatextended2extended(
561
562#endif /*USE_DEPRECATED_EMEV_V2*/
563
564#ifndef SRPC_EXCLUDE_CLIENT
565_supla_int_t SRPC_ICACHE_FLASH srpc_evtool_v1_icextended2extended(
568_supla_int_t SRPC_ICACHE_FLASH
569srpc_evtool_v1_extended2icextended(const TSuplaChannelExtendedValue *ev,
571_supla_int_t SRPC_ICACHE_FLASH srpc_evtool_value_add(
573_supla_int_t SRPC_ICACHE_FLASH
574srpc_evtool_value_get(TSuplaChannelExtendedValue *ev, unsigned short index,
576#endif /*SRPC_EXCLUDE_CLIENT*/
577
578#endif /*SRPC_EXCLUDE_EXTENDEDVALUE_TOOLS*/
579
580#ifdef __cplusplus
581}
582#endif
583
584#endif /* supladex_H_ */
Definition proto.h:2655
Definition proto.h:1704
Definition proto.h:1687
Definition proto.h:2747
Definition proto.h:2298
Definition proto.h:2289
Definition proto.h:2842
Definition proto.h:3124
Definition proto.h:1726
Definition proto.h:2927
Definition proto.h:3969
Definition proto.h:2793
Definition proto.h:2831
Definition proto.h:2158
Definition proto.h:1845
Definition proto.h:1839
Definition proto.h:1851
Definition proto.h:1742
Definition proto.h:1755
Definition proto.h:1768
Definition proto.h:1731
Definition proto.h:3837
Definition proto.h:2804
Definition proto.h:717
Definition proto.h:738
Definition proto.h:2705
Definition proto.h:3890
Definition proto.h:2325
Definition proto.h:1871
Definition proto.h:3150
Definition proto.h:3915
Definition proto.h:3904
Definition proto.h:3930
Definition proto.h:1253
Definition proto.h:1203
Definition proto.h:1211
Definition proto.h:1196
Definition proto.h:973
Definition proto.h:999
Definition proto.h:1105
Definition proto.h:1032
Definition proto.h:1047
Definition proto.h:1065
Definition proto.h:1083
Definition proto.h:1125
Definition proto.h:1147
Definition proto.h:814
Definition proto.h:2014
Definition eh.h:24
Definition proto.h:2815
Definition proto.h:3131
Definition proto.h:1709
Definition proto.h:2773
Definition proto.h:3142
Definition proto.h:2827
Definition proto.h:2307
Definition proto.h:2920
Definition proto.h:2846
Definition proto.h:1716
Definition proto.h:2060
Definition proto.h:1904
Definition proto.h:3974
Definition proto.h:2798
Definition proto.h:2838
Definition proto.h:2163
Definition proto.h:1307
Definition proto.h:1514
Definition proto.h:1505
Definition proto.h:1531
Definition proto.h:1362
Definition proto.h:1447
Definition proto.h:1456
Definition proto.h:1465
Definition proto.h:1334
Definition proto.h:1562
Definition proto.h:3978
Definition proto.h:1297
Definition proto.h:1287
Definition proto.h:1270
Definition proto.h:1260
Definition proto.h:1858
Definition proto.h:799
Definition proto.h:790
Definition proto.h:1794
Definition proto.h:1808
Definition proto.h:1823
Definition proto.h:1782
Definition proto.h:1583
Definition proto.h:1605
Definition proto.h:1892
Definition proto.h:704
Definition proto.h:733
Definition proto.h:711
Definition proto.h:2642
Definition proto.h:3175
Definition proto.h:2903
Definition proto.h:2891
Definition proto.h:3182
Definition proto.h:3159
Definition proto.h:2851
Definition proto.h:2315
Definition proto.h:1887
Definition proto.h:1240
Definition proto.h:1228
Definition proto.h:1182
Definition proto.h:1169
Definition proto.h:784
Definition proto.h:2624
Definition srpc.h:85
Definition srpc.h:208
Definition srpc.h:102