supla-device
Loading...
Searching...
No Matches
srpc.h
1/*
2 Copyright (C) AC SOFTWARE SP. Z O.O.
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17 */
18#ifndef supladex_H_
19#define supladex_H_
20
21#include <stddef.h>
22#include <stdio.h>
23
24#include "eh.h"
25#include "proto.h"
26#if defined(ESP32)
27#include <esp8266-compat.h>
28#endif
29
30#ifdef __ANDROID__
31#define SRPC_EXCLUDE_DEVICE
32#endif /*__ANDROID__*/
33
34#if defined(ESP8266) || defined(ESP32)
35
36#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32)
37#define SRPC_WITHOUT_OUT_QUEUE
38#define SRPC_WITHOUT_IN_QUEUE
39#define PACKET_INTEGRITY_BUFFER_DISABLED
40#endif /* defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) */
41
42#define SRPC_EXCLUDE_CLIENT
43#define SRPC_ICACHE_FLASH ICACHE_FLASH_ATTR
44
45#if !defined(ESP32)
46#include <mem.h>
47#include <os_type.h>
48#endif
49#else
50#define SRPC_ICACHE_FLASH
51#endif
52
53#if defined(__AVR__) || defined(ARDUINO) || defined(SUPLA_DEVICE)
54#define SRPC_EXCLUDE_CLIENT
55#define SRPC_WITHOUT_OUT_QUEUE
56#define SRPC_WITHOUT_IN_QUEUE
57#define PACKET_INTEGRITY_BUFFER_DISABLED
58#endif /*__AVR__*/
59
60#ifdef __cplusplus
61extern "C" {
62#endif
63
64#if defined(SUPLA_DEVICE) || defined(ESP8266) || defined(ESP32) || \
65 defined(__AVR__) || defined(ARDUINO_ARCH_ESP8266) || \
66 defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_AVR)
67#define SRPC_WITH_PACKET_LOG_HOOKS
68#endif
69
70typedef _supla_int_t (*_func_srpc_DataRW)(void *buf, _supla_int_t count,
71 void *user_params);
72typedef void (*_func_srpc_event_OnRemoteCallReceived)(
73 void *_srpc, unsigned _supla_int_t rr_id, unsigned _supla_int_t call_id,
74 void *user_params, unsigned char proto_version);
75typedef void (*_func_srpc_event_BeforeCall)(void *_srpc,
76 unsigned _supla_int_t call_id,
77 void *user_params);
78#ifdef SRPC_WITH_PACKET_LOG_HOOKS
79typedef void (*_func_srpc_event_OnPacketSent)(
80 void *_srpc,
81 unsigned _supla_int_t call_id,
82 void *data,
83 unsigned _supla_int_t data_size,
84 void *user_params);
85typedef void (*_func_srpc_event_OnPacketReceived)(
86 void *_srpc,
87 unsigned _supla_int_t call_id,
88 void *data,
89 unsigned _supla_int_t data_size,
90 void *user_params);
91#endif
92typedef void (*_func_srpc_event_OnVersionError)(void *_srpc,
93 unsigned char remote_version,
94 void *user_params);
95typedef void (*_func_srpc_event_OnMinVersionRequired)(
96 void *_srpc, unsigned _supla_int_t call_id, unsigned char min_version,
97 void *user_params);
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 TEventHandler *eh;
112
113 void *user_params;
115
117 TDCS_SuplaPingServer *dcs_ping;
118 TSDC_SuplaPingServerResult *sdc_ping_result;
119 TSDC_SuplaGetVersionResult *sdc_getversion_result;
120 TSDC_SuplaVersionError *sdc_version_error;
121 TDCS_SuplaSetActivityTimeout *dcs_set_activity_timeout;
122 TSDC_SuplaSetActivityTimeoutResult *sdc_set_activity_timeout_result;
123 TDS_SuplaRegisterDevice *ds_register_device;
124 TDS_SuplaRegisterDevice_B *ds_register_device_b;
125 TDS_SuplaRegisterDevice_C *ds_register_device_c;
126 TDS_SuplaRegisterDevice_D *ds_register_device_d;
127 TDS_SuplaRegisterDevice_E *ds_register_device_e;
128 TDS_SuplaRegisterDevice_F *ds_register_device_f;
129 TDS_SuplaRegisterDevice_G *ds_register_device_g;
130 TSD_SuplaRegisterDeviceResult *sd_register_device_result;
131 TSD_SuplaRegisterDeviceResult_B *sd_register_device_result_b;
132 TCS_SuplaRegisterClient *cs_register_client;
133 TCS_SuplaRegisterClient_B *cs_register_client_b;
134 TCS_SuplaRegisterClient_C *cs_register_client_c;
135 TCS_SuplaRegisterClient_D *cs_register_client_d;
136 TSC_SuplaRegisterClientResult *sc_register_client_result;
137 TSC_SuplaRegisterClientResult_B *sc_register_client_result_b;
138 TSC_SuplaRegisterClientResult_C *sc_register_client_result_c;
139 TSC_SuplaRegisterClientResult_D *sc_register_client_result_d;
140 TDS_SuplaDeviceChannelValue *ds_device_channel_value;
141 TDS_SuplaDeviceChannelValue_B *ds_device_channel_value_b;
142 TDS_SuplaDeviceChannelValue_C *ds_device_channel_value_c;
143 TDS_SuplaDeviceChannelExtendedValue *ds_device_channel_extendedvalue;
144 TSC_SuplaLocation *sc_location;
145 TSC_SuplaLocationPack *sc_location_pack;
146 TSC_SuplaChannelPack *sc_channel_pack;
147 TSC_SuplaChannelPack_B *sc_channel_pack_b;
148 TSC_SuplaChannelPack_C *sc_channel_pack_c;
149 TSC_SuplaChannelPack_D *sc_channel_pack_d;
150 TSC_SuplaChannelPack_E *sc_channel_pack_e;
151 TSC_SuplaChannelValue *sc_channel_value;
152 TSC_SuplaChannelValue_B *sc_channel_value_b;
153 TSC_SuplaEvent *sc_event;
154 TSD_SuplaChannelNewValue *sd_channel_new_value;
155 TSD_SuplaChannelGroupNewValue *sd_channelgroup_new_value;
156 TDS_SuplaChannelNewValueResult *ds_channel_new_value_result;
157 TCS_SuplaChannelNewValue *cs_channel_new_value;
158 TCS_SuplaChannelNewValue_B *cs_channel_new_value_b;
159 TDS_FirmwareUpdateParams *ds_firmware_update_params;
160 TSD_FirmwareUpdate_UrlResult *sc_firmware_update_url_result;
161 TSDC_RegistrationEnabled *sdc_reg_enabled;
162 TSC_SuplaChannelGroupPack *sc_channelgroup_pack;
163 TSC_SuplaChannelGroupPack_B *sc_channelgroup_pack_b;
164 TSC_SuplaChannelGroupRelationPack *sc_channelgroup_relation_pack;
165 TSC_SuplaChannelRelationPack *sc_channel_relation_pack;
166 TSC_SuplaChannelValuePack *sc_channelvalue_pack;
167 TSC_SuplaChannelValuePack_B *sc_channelvalue_pack_b;
168 TSC_SuplaChannelExtendedValuePack *sc_channelextendedvalue_pack;
169 TCS_SuplaNewValue *cs_new_value;
170 TSC_OAuthTokenRequestResult *sc_oauth_tokenrequest_result;
171 TCS_SuperUserAuthorizationRequest *cs_superuser_authorization_request;
172 TSC_SuperUserAuthorizationResult *sc_superuser_authorization_result;
173 TCS_DeviceCalCfgRequest *cs_device_calcfg_request;
174 TCS_DeviceCalCfgRequest_B *cs_device_calcfg_request_b;
175 TSC_DeviceCalCfgResult *sc_device_calcfg_result;
176 TSD_DeviceCalCfgRequest *sd_device_calcfg_request;
177 TDS_DeviceCalCfgResult *ds_device_calcfg_result;
178 TSDC_UserLocalTimeResult *sdc_user_localtime_result;
179 TCSD_ChannelStateRequest *csd_channel_state_request;
180 TDSC_ChannelState *dsc_channel_state;
181 TCS_ChannelBasicCfgRequest *cs_channel_basic_cfg_request;
182 TSC_ChannelBasicCfg *sc_channel_basic_cfg;
183 TCS_SetChannelFunction *cs_set_channel_function;
184 TSC_SetChannelFunctionResult *sc_set_channel_function_result;
185 TDCS_SetCaption *dcs_set_caption;
186 TSCD_SetCaptionResult *scd_set_caption_result;
187 TSC_ClientsReconnectRequestResult *sc_clients_reconnect_result;
188 TCS_SetRegistrationEnabled *cs_set_registration_enabled;
189 TSC_SetRegistrationEnabledResult *sc_set_registration_enabled_result;
190 TCS_DeviceReconnectRequest *cs_device_reconnect_request;
191 TSC_DeviceReconnectRequestResult *sc_device_reconnect_request_result;
192 TSD_ChannelFunctions *sd_channel_functions;
193 TDS_GetChannelConfigRequest *ds_get_channel_config_request;
194 TSD_ChannelConfig *sd_channel_config;
195 TDS_ActionTrigger *ds_action_trigger;
196 TCS_TimerArmRequest *cs_timer_arm_request;
197 TSC_SuplaScenePack *sc_scene_pack;
198 TSC_SuplaSceneStatePack *sc_scene_state_pack;
199 TCS_Action *cs_action;
200 TCS_ActionWithAuth *cs_action_with_auth;
201 TSC_ActionExecutionResult *sc_action_execution_result;
202 TCS_GetChannelValueWithAuth *cs_get_value_with_auth;
203 TSC_GetChannelValueResult *sc_get_value_result;
204 TDS_RegisterPushNotification *ds_register_push_notification;
205 TDS_PushNotification *ds_push_notification;
206 TCS_RegisterPnClientToken *cs_register_pn_client_token;
207 TSC_RegisterPnClientTokenResult *sc_register_pn_client_token_result;
208 TSDS_SetChannelConfig *sds_set_channel_config_request;
209 TSDS_SetChannelConfigResult *sds_set_channel_config_result;
210 TSD_ChannelConfigFinished *sd_channel_config_finished;
211 TSDS_SetDeviceConfig *sds_set_device_config_request;
212 TSDS_SetDeviceConfigResult *sds_set_device_config_result;
213 TSCS_ChannelConfig *scs_channel_config;
214 TCS_GetChannelConfigRequest *cs_get_channel_config_request;
215 TSC_ChannelConfigUpdateOrResult *sc_channel_config_update_or_result;
216 TSC_DeviceConfigUpdateOrResult *sc_device_config_update_or_result;
217 TCS_GetDeviceConfigRequest *cs_get_device_config_request;
218 TDS_SubdeviceDetails *ds_subdevice_details;
219 TSC_SuplaChannelStatePack *sc_channel_state_pack;
220};
221
222typedef struct {
223 unsigned _supla_int_t call_id;
224 unsigned _supla_int_t rr_id;
225
226 union TsrpcDataPacketData data;
228
229void SRPC_ICACHE_FLASH srpc_params_init(TsrpcParams *params);
230
231void *SRPC_ICACHE_FLASH srpc_init(TsrpcParams *params);
232void SRPC_ICACHE_FLASH srpc_free(void *_srpc);
233
234void SRPC_ICACHE_FLASH srpc_lock(void *_srpc);
235void SRPC_ICACHE_FLASH srpc_unlock(void *_srpc);
236
237char SRPC_ICACHE_FLASH srpc_input_dataexists(void *_srpc);
238char SRPC_ICACHE_FLASH srpc_output_dataexists(void *_srpc);
239unsigned char SRPC_ICACHE_FLASH srpc_out_queue_item_count(void *srpc);
240
241char SRPC_ICACHE_FLASH srpc_iterate(void *_srpc);
242char SRPC_ICACHE_FLASH srpc_iterate_device(void *_srpc);
243
244char SRPC_ICACHE_FLASH srpc_getdata(void *_srpc, TsrpcReceivedData *rd,
245 unsigned _supla_int_t rr_id);
246
247void SRPC_ICACHE_FLASH srpc_rd_free(TsrpcReceivedData *rd);
248
249unsigned char SRPC_ICACHE_FLASH srpc_get_proto_version(void *_srpc);
250void SRPC_ICACHE_FLASH srpc_set_proto_version(void *_srpc,
251 unsigned char version);
252
253unsigned char SRPC_ICACHE_FLASH
254srpc_call_min_version_required(void *_srpc, unsigned _supla_int_t call_id);
255unsigned char SRPC_ICACHE_FLASH
256srpc_call_allowed(void *_srpc, unsigned _supla_int_t call_id);
257
258// device/client <-> server
259_supla_int_t SRPC_ICACHE_FLASH srpc_dcs_async_getversion(void *_srpc);
260_supla_int_t SRPC_ICACHE_FLASH srpc_sdc_async_getversion_result(
261 void *_srpc, char SoftVer[SUPLA_SOFTVER_MAXSIZE]);
262_supla_int_t SRPC_ICACHE_FLASH
263srpc_sdc_async_versionerror(void *_srpc, unsigned char remote_version);
264_supla_int_t SRPC_ICACHE_FLASH srpc_dcs_async_ping_server(void *_srpc);
265_supla_int_t SRPC_ICACHE_FLASH srpc_sdc_async_ping_server_result(void *_srpc);
266_supla_int_t SRPC_ICACHE_FLASH srpc_dcs_async_set_activity_timeout(
267 void *_srpc, TDCS_SuplaSetActivityTimeout *dcs_set_activity_timeout);
268_supla_int_t SRPC_ICACHE_FLASH srpc_dcs_async_set_activity_timeout_result(
269 void *_srpc,
270 TSDC_SuplaSetActivityTimeoutResult *sdc_set_activity_timeout_result);
271_supla_int_t SRPC_ICACHE_FLASH
272srpc_dcs_async_get_registration_enabled(void *_srpc);
273_supla_int_t SRPC_ICACHE_FLASH srpc_sdc_async_get_registration_enabled_result(
274 void *_srpc, TSDC_RegistrationEnabled *reg_enabled);
275_supla_int_t SRPC_ICACHE_FLASH srpc_dcs_async_get_user_localtime(void *_srpc);
276_supla_int_t SRPC_ICACHE_FLASH srpc_sdc_async_get_user_localtime_result(
277 void *_srpc, TSDC_UserLocalTimeResult *localtime);
278_supla_int_t SRPC_ICACHE_FLASH srpc_csd_async_get_channel_state(
279 void *_srpc, TCSD_ChannelStateRequest *request);
280_supla_int_t SRPC_ICACHE_FLASH
281srpc_csd_async_channel_state_result(void *_srpc, TDSC_ChannelState *state);
282
283_supla_int_t SRPC_ICACHE_FLASH
284srpc_dcs_async_set_channel_caption(void *_srpc, TDCS_SetCaption *caption);
285_supla_int_t SRPC_ICACHE_FLASH srpc_scd_async_set_channel_caption_result(
286 void *_srpc, TSCD_SetCaptionResult *caption);
287
288#ifndef SRPC_EXCLUDE_DEVICE
289// device <-> server
290_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_registerdevice(
291 void *_srpc, TDS_SuplaRegisterDevice *registerdevice);
292_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_registerdevice_b(
293 void *_srpc, TDS_SuplaRegisterDevice_B *registerdevice); // ver. >= 2
294_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_registerdevice_c(
295 void *_srpc, TDS_SuplaRegisterDevice_C *registerdevice); // ver. >= 6
296_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_registerdevice_d(
297 void *_srpc, TDS_SuplaRegisterDevice_D *registerdevice); // ver. >= 7
298_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_registerdevice_e(
299 void *_srpc, TDS_SuplaRegisterDevice_E *registerdevice); // ver. >= 10
300_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_registerdevice_f(
301 void *_srpc, TDS_SuplaRegisterDevice_F *registerdevice); // ver. >= 23
302_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_registerdevice_g(
303 void *_srpc, TDS_SuplaRegisterDevice_G *registerdevice); // ver. >= 25
304_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_registerdevice_result(
305 void *_srpc, TSD_SuplaRegisterDeviceResult *registerdevice_result);
306_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_registerdevice_result_b(
307 void *_srpc,
308 TSD_SuplaRegisterDeviceResult_B *registerdevice_result); // ver. >= 25
309_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_registerdevice_in_chunks(
310 void *_srpc, TDS_SuplaRegisterDeviceHeader *registerdevice,
311 TDS_SuplaDeviceChannel_D *(*get_channel_data_callback)(int)); // ver. >= 23
312_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_registerdevice_in_chunks_g(
313 void *_srpc, TDS_SuplaRegisterDeviceHeader *registerdevice,
314 TDS_SuplaDeviceChannel_E *(*get_channel_data_callback)(int)); // ver. >= 25
315
316_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_channel_value_changed(
317 void *_srpc, unsigned char channel_number, char *value);
318_supla_int_t SRPC_ICACHE_FLASH
319srpc_ds_async_channel_value_changed_b(void *_srpc, unsigned char channel_number,
320 char *value, unsigned char offline);
321_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_channel_value_changed_c(
322 void *_srpc, unsigned char channel_number, char *value,
323 unsigned char offline, unsigned _supla_int_t validity_time_sec);
324_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_channel_extendedvalue_changed(
325 void *_srpc, unsigned char channel_number,
327_supla_int_t SRPC_ICACHE_FLASH
328srpc_sd_async_set_channel_value(void *_srpc, TSD_SuplaChannelNewValue *value);
329_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_set_channelgroup_value(
330 void *_srpc, TSD_SuplaChannelGroupNewValue *value); // ver. >= 13
331_supla_int_t SRPC_ICACHE_FLASH
332srpc_ds_async_set_channel_result(void *_srpc, unsigned char ChannelNumber,
333 _supla_int_t SenderID, char Success);
334_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_get_firmware_update_url(
335 void *_srpc, TDS_FirmwareUpdateParams *params);
336_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_get_firmware_update_url_result(
337 void *_srpc, TSD_FirmwareUpdate_UrlResult *result);
338_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_device_calcfg_request(
339 void *_srpc, TSD_DeviceCalCfgRequest *request);
340_supla_int_t SRPC_ICACHE_FLASH
341srpc_ds_async_device_calcfg_result(void *_srpc, TDS_DeviceCalCfgResult *result);
342_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_get_channel_functions(void *_srpc);
343_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_get_channel_functions_result(
344 void *_srpc, TSD_ChannelFunctions *result);
345_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_get_channel_config_request(
346 void *_srpc, TDS_GetChannelConfigRequest *request);
347_supla_int_t SRPC_ICACHE_FLASH
348srpc_sd_async_get_channel_config_result(void *_srpc, TSD_ChannelConfig *config);
349_supla_int_t SRPC_ICACHE_FLASH
350srpc_ds_async_action_trigger(void *_srpc, TDS_ActionTrigger *action_trigger);
351_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_register_push_notification(
352 void *_srpc, TDS_RegisterPushNotification *reg);
353_supla_int_t SRPC_ICACHE_FLASH
354srpc_ds_async_send_push_notification(void *_srpc, TDS_PushNotification *push);
355_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_set_channel_config_request(
356 void *_srpc, TSDS_SetChannelConfig *config);
357_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_set_channel_config_result(
358 void *_srpc, TSDS_SetChannelConfigResult *result);
359_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_set_channel_config_request(
360 void *_srpc, TSDS_SetChannelConfig *config);
361_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_set_channel_config_result(
362 void *_srpc, TSDS_SetChannelConfigResult *result);
363_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_channel_config_finished(
364 void *_srpc, TSD_ChannelConfigFinished *fin);
365_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_set_device_config_request(
366 void *_srpc, TSDS_SetDeviceConfig *config);
367_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_set_device_config_result(
368 void *_srpc, TSDS_SetDeviceConfigResult *result);
369_supla_int_t SRPC_ICACHE_FLASH srpc_ds_async_set_device_config_request(
370 void *_srpc, TSDS_SetDeviceConfig *config);
371_supla_int_t SRPC_ICACHE_FLASH srpc_sd_async_set_device_config_result(
372 void *_srpc, TSDS_SetDeviceConfigResult *result);
373_supla_int_t SRPC_ICACHE_FLASH
374srpc_ds_async_set_subdevice_details(void *_srpc, TDS_SubdeviceDetails *reg);
375#endif /*SRPC_EXCLUDE_DEVICE*/
376
377#ifndef SRPC_EXCLUDE_CLIENT
378// client <-> server
379_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_registerclient(
380 void *_srpc, TCS_SuplaRegisterClient *registerclient);
381_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_registerclient_b(
382 void *_srpc, TCS_SuplaRegisterClient_B *registerclient); // ver. >= 6
383_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_registerclient_c(
384 void *_srpc, TCS_SuplaRegisterClient_C *registerclient); // ver. >= 7
385_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_registerclient_d(
386 void *_srpc, TCS_SuplaRegisterClient_D *registerclient); // ver. >= 11
387_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_registerclient_result(
388 void *_srpc, TSC_SuplaRegisterClientResult *registerclient_result);
389_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_registerclient_result_b(
390 void *_srpc,
391 TSC_SuplaRegisterClientResult_B *registerclient_result); // ver. >= 9
392_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_registerclient_result_c(
393 void *_srpc,
394 TSC_SuplaRegisterClientResult_C *registerclient_result); // ver. >= 17
395_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_registerclient_result_d(
396 void *_srpc,
397 TSC_SuplaRegisterClientResult_D *registerclient_result); // ver. >= 19
398_supla_int_t SRPC_ICACHE_FLASH
399srpc_sc_async_location_update(void *_srpc, TSC_SuplaLocation *location);
400_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_locationpack_update(
401 void *_srpc, TSC_SuplaLocationPack *location_pack);
402_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelpack_update(
403 void *_srpc, TSC_SuplaChannelPack *channel_pack);
404_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelpack_update_b(
405 void *_srpc, TSC_SuplaChannelPack_B *channel_pack); // ver. >= 8
406_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelpack_update_c(
407 void *_srpc, TSC_SuplaChannelPack_C *channel_pack); // ver. >= 10
408_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelpack_update_d(
409 void *_srpc, TSC_SuplaChannelPack_D *channel_pack); // ver. >= 15
410_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelpack_update_e(
411 void *_srpc, TSC_SuplaChannelPack_E *channel_pack); // ver. >= 23
412_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channel_value_update(
413 void *_srpc, TSC_SuplaChannelValue *channel_item_value);
414_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channel_value_update_b(
415 void *_srpc, TSC_SuplaChannelValue_B *channel_item_value);
416_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelgroup_pack_update(
417 void *_srpc, TSC_SuplaChannelGroupPack *channelgroup_pack); // ver. >= 9
418_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelgroup_pack_update_b(
419 void *_srpc, TSC_SuplaChannelGroupPack_B *channelgroup_pack); // ver. >= 10
420_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelgroup_relation_pack_update(
422 *channelgroup_relation_pack); // ver. >= 9
423_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channel_relation_pack_update(
424 void *_srpc, TSC_SuplaChannelRelationPack *relation_pack); // ver. >= 21
425_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelvalue_pack_update(
426 void *_srpc, TSC_SuplaChannelValuePack *channelvalue_pack); // ver. >= 9
427_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelvalue_pack_update_b(
428 void *_srpc, TSC_SuplaChannelValuePack_B *channelvalue_pack); // ver. >= 15
429_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channelextendedvalue_pack_update(
430 void *_srpc,
431 TSC_SuplaChannelExtendedValuePack *extendedvalue_pack); // ver. >= 10
432_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channel_state_pack_update(
433 void *_srpc, TSC_SuplaChannelStatePack *state_pack); // ver. >= 26
434_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_get_next(void *_srpc);
435_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_event(void *_srpc,
436 TSC_SuplaEvent *event);
437_supla_int_t SRPC_ICACHE_FLASH
438srpc_cs_async_set_channel_value(void *_srpc, TCS_SuplaChannelNewValue *value);
439_supla_int_t SRPC_ICACHE_FLASH
440srpc_cs_async_set_value(void *_srpc, TCS_SuplaNewValue *value); // ver. >= 9
441_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_set_channel_value_b(
442 void *_srpc, TCS_SuplaChannelNewValue_B *value);
443_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_oauth_token_request(void *_srpc);
444_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_oauth_token_request_result(
445 void *_srpc, TSC_OAuthTokenRequestResult *result);
446_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_superuser_authorization_request(
447 void *_srpc, TCS_SuperUserAuthorizationRequest *request);
448_supla_int_t SRPC_ICACHE_FLASH
449srpc_cs_async_get_superuser_authorization_result(void *_srpc);
450_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_superuser_authorization_result(
451 void *_srpc, TSC_SuperUserAuthorizationResult *result);
452_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_device_calcfg_request(
453 void *_srpc, TCS_DeviceCalCfgRequest *request);
454_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_device_calcfg_request_b(
455 void *_srpc, TCS_DeviceCalCfgRequest_B *request);
456_supla_int_t SRPC_ICACHE_FLASH
457srpc_sc_async_device_calcfg_result(void *_srpc, TSC_DeviceCalCfgResult *result);
458_supla_int_t SRPC_ICACHE_FLASH
459srpc_cs_async_get_channel_basic_cfg(void *_srpc, _supla_int_t ChannelID);
460_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channel_basic_cfg_result(
461 void *_srpc, TSC_ChannelBasicCfg *basic_cfg);
462_supla_int_t SRPC_ICACHE_FLASH
463srpc_cs_async_set_channel_function(void *_srpc, TCS_SetChannelFunction *func);
464_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_set_channel_function_result(
465 void *_srpc, TSC_SetChannelFunctionResult *result);
466_supla_int_t SRPC_ICACHE_FLASH
467srpc_cs_async_set_channel_group_caption(void *_srpc, TDCS_SetCaption *caption);
468_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_set_channel_group_caption_result(
469 void *_srpc, TSCD_SetCaptionResult *caption);
470_supla_int_t SRPC_ICACHE_FLASH
471srpc_cs_async_set_location_caption(void *_srpc, TDCS_SetCaption *caption);
472_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_set_location_caption_result(
473 void *_srpc, TSCD_SetCaptionResult *caption);
474_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_set_scene_caption(
475 void *_srpc, TDCS_SetCaption *caption); // ver. >= 19
476_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_set_scene_caption_result(
477 void *_srpc, TSCD_SetCaptionResult *caption); // ver. >= 19
478_supla_int_t SRPC_ICACHE_FLASH
479srpc_cs_async_clients_reconnect_request(void *_srpc);
480_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_clients_reconnect_request_result(
481 void *_srpc, TSC_ClientsReconnectRequestResult *result);
482_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_set_registration_enabled(
483 void *_srpc, TCS_SetRegistrationEnabled *reg_enabled);
484_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_set_registration_enabled_result(
485 void *_srpc, TSC_SetRegistrationEnabledResult *result);
486_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_device_reconnect_request(
487 void *_srpc, TCS_DeviceReconnectRequest *request);
488_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_device_reconnect_request_result(
489 void *_srpc, TSC_DeviceReconnectRequestResult *result);
490_supla_int_t SRPC_ICACHE_FLASH
491srpc_cs_async_timer_arm(void *_srpc, TCS_TimerArmRequest *request);
492_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_scene_pack_update(
493 void *_srpc, TSC_SuplaScenePack *scene_pack); // ver. >= 18
494_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_scene_state_pack_update(
495 void *_srpc, TSC_SuplaSceneStatePack *scene_status_pack); // ver. >= 18
496_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_execute_action(void *_srpc,
497 TCS_Action *action);
498_supla_int_t SRPC_ICACHE_FLASH
499srpc_cs_async_execute_action_with_auth(void *_srpc, TCS_ActionWithAuth *action);
500_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_action_execution_result(
501 void *_srpc, TSC_ActionExecutionResult *result);
502_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_get_channel_value_with_auth(
503 void *_srpc, TCS_GetChannelValueWithAuth *vwa);
504_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_get_channel_value_result(
505 void *_srpc, TSC_GetChannelValueResult *result);
506_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_register_pn_client_token(
507 void *_srpc, TCS_RegisterPnClientToken *reg);
508_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_register_pn_client_token_result(
509 void *_srpc, TSC_RegisterPnClientTokenResult *result);
510_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_get_channel_config_request(
511 void *_srpc, TCS_GetChannelConfigRequest *request);
512_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_channel_config_update_or_result(
513 void *_srpc, TSC_ChannelConfigUpdateOrResult *config);
514_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_set_channel_config_request(
515 void *_srpc, TSCS_ChannelConfig *config);
516_supla_int_t SRPC_ICACHE_FLASH srpc_cs_async_get_device_config_request(
517 void *_srpc, TCS_GetDeviceConfigRequest *request);
518_supla_int_t SRPC_ICACHE_FLASH srpc_sc_async_device_config_update_or_result(
519 void *_srpc, TSC_DeviceConfigUpdateOrResult *config);
520#endif /*SRPC_EXCLUDE_CLIENT*/
521
522#ifndef SRPC_EXCLUDE_EXTENDEDVALUE_TOOLS
523
524_supla_int_t SRPC_ICACHE_FLASH srpc_evtool_v3_emextended2extended(
527
528_supla_int_t SRPC_ICACHE_FLASH
529srpc_evtool_v3_extended2emextended(const TSuplaChannelExtendedValue *ev,
531
532_supla_int_t srpc_evtool_extended2emextended_latest(
535
536#ifdef USE_DEPRECATED_EMEV_V2
537
538_supla_int_t SRPC_ICACHE_FLASH
539srpc_evtool_emev_v2to3(const TElectricityMeter_ExtendedValue_V2 *v2,
541
542_supla_int_t SRPC_ICACHE_FLASH
543srpc_evtool_emev_v3to2(const TElectricityMeter_ExtendedValue_V3 *v3,
544 TElectricityMeter_ExtendedValue_V2 *v2);
545
546#ifdef USE_DEPRECATED_EMEV_V1
547_supla_int_t SRPC_ICACHE_FLASH
548srpc_evtool_v1_emextended2extended(const TElectricityMeter_ExtendedValue *em_ev,
550_supla_int_t SRPC_ICACHE_FLASH
551srpc_evtool_v1_extended2emextended(const TSuplaChannelExtendedValue *ev,
552 TElectricityMeter_ExtendedValue *em_ev);
553
554_supla_int_t SRPC_ICACHE_FLASH
555srpc_evtool_emev_v1to2(const TElectricityMeter_ExtendedValue *v1,
556 TElectricityMeter_ExtendedValue_V2 *v2);
557_supla_int_t SRPC_ICACHE_FLASH
558srpc_evtool_emev_v2to1(const TElectricityMeter_ExtendedValue_V2 *v2,
559 TElectricityMeter_ExtendedValue *v1);
560
561#endif /*USE_DEPRECATED_EMEV_V1*/
562
563_supla_int_t SRPC_ICACHE_FLASH srpc_evtool_v2_emextended2extended(
564 const TElectricityMeter_ExtendedValue_V2 *em_ev,
566_supla_int_t SRPC_ICACHE_FLASH
567srpc_evtool_v2_extended2emextended(const TSuplaChannelExtendedValue *ev,
568 TElectricityMeter_ExtendedValue_V2 *em_ev);
569
570_supla_int_t SRPC_ICACHE_FLASH srpc_evtool_v1_extended2thermostatextended(
572_supla_int_t SRPC_ICACHE_FLASH srpc_evtool_v1_thermostatextended2extended(
574
575#endif /*USE_DEPRECATED_EMEV_V2*/
576
577#ifndef SRPC_EXCLUDE_CLIENT
578_supla_int_t SRPC_ICACHE_FLASH srpc_evtool_v1_icextended2extended(
581_supla_int_t SRPC_ICACHE_FLASH
582srpc_evtool_v1_extended2icextended(const TSuplaChannelExtendedValue *ev,
584_supla_int_t SRPC_ICACHE_FLASH srpc_evtool_value_add(
586_supla_int_t SRPC_ICACHE_FLASH
587srpc_evtool_value_get(TSuplaChannelExtendedValue *ev, unsigned short index,
589#endif /*SRPC_EXCLUDE_CLIENT*/
590
591#endif /*SRPC_EXCLUDE_EXTENDEDVALUE_TOOLS*/
592
593#ifdef __cplusplus
594}
595#endif
596
597#endif /* supladex_H_ */
Definition proto.h:2931
Definition proto.h:1703
Definition proto.h:1686
Definition proto.h:3023
Definition proto.h:2576
Definition proto.h:2567
Definition proto.h:3118
Definition proto.h:3377
Definition proto.h:1725
Definition proto.h:3203
Definition proto.h:4221
Definition proto.h:3069
Definition proto.h:3107
Definition proto.h:2157
Definition proto.h:1844
Definition proto.h:1838
Definition proto.h:1850
Definition proto.h:1741
Definition proto.h:1754
Definition proto.h:1767
Definition proto.h:1730
Definition proto.h:4089
Definition proto.h:3080
Definition proto.h:718
Definition proto.h:739
Definition proto.h:2981
Definition proto.h:4142
Definition proto.h:2603
Definition proto.h:1870
Definition proto.h:3403
Definition proto.h:4167
Definition proto.h:4156
Definition proto.h:4182
Definition proto.h:1252
Definition proto.h:1202
Definition proto.h:1210
Definition proto.h:1195
Definition proto.h:972
Definition proto.h:998
Definition proto.h:1104
Definition proto.h:1031
Definition proto.h:1046
Definition proto.h:1064
Definition proto.h:1082
Definition proto.h:1124
Definition proto.h:1146
Definition proto.h:815
Definition proto.h:2013
Definition eh.h:38
Definition proto.h:3091
Definition proto.h:3384
Definition proto.h:1708
Definition proto.h:3049
Definition proto.h:3395
Definition proto.h:3103
Definition proto.h:2585
Definition proto.h:3196
Definition proto.h:3122
Definition proto.h:1715
Definition proto.h:2059
Definition proto.h:1903
Definition proto.h:4226
Definition proto.h:3074
Definition proto.h:3114
Definition proto.h:2162
Definition proto.h:1306
Definition proto.h:1513
Definition proto.h:1504
Definition proto.h:1530
Definition proto.h:1361
Definition proto.h:1446
Definition proto.h:1455
Definition proto.h:1464
Definition proto.h:1333
Definition proto.h:1561
Definition proto.h:4230
Definition proto.h:1296
Definition proto.h:1286
Definition proto.h:1269
Definition proto.h:1259
Definition proto.h:1857
Definition proto.h:800
Definition proto.h:791
Definition proto.h:1793
Definition proto.h:1807
Definition proto.h:1822
Definition proto.h:1781
Definition proto.h:1582
Definition proto.h:1604
Definition proto.h:1891
Definition proto.h:705
Definition proto.h:734
Definition proto.h:712
Definition proto.h:2918
Definition proto.h:3428
Definition proto.h:3179
Definition proto.h:3167
Definition proto.h:3435
Definition proto.h:3412
Definition proto.h:3127
Definition proto.h:2593
Definition proto.h:1886
Definition proto.h:1239
Definition proto.h:1227
Definition proto.h:1181
Definition proto.h:1168
Definition proto.h:785
Definition proto.h:2900
Definition srpc.h:99
Definition srpc.h:222
Definition srpc.h:116