supla-device
Loading...
Searching...
No Matches
register_device.h
1// SPDX-FileCopyrightText: AC SOFTWARE SP. Z O.O.
2// SPDX-License-Identifier: GPL-2.0-or-later
3
4#ifndef SRC_SUPLA_DEVICE_REGISTER_DEVICE_H_
5#define SRC_SUPLA_DEVICE_REGISTER_DEVICE_H_
6
7#include <supla-common/proto.h>
8
9#include <stdint.h>
10
11namespace Supla {
12namespace RegisterDevice {
13
14TDS_SuplaRegisterDeviceHeader *getRegDevHeaderPtr();
15// Returns pointer to structure, which is filled with values from channel
16// at given index. Next call will return exactly the same pointer, but with
17// data from another channel, so please be careful when using this function
18TDS_SuplaDeviceChannel_D *getChannelPtr_D(int index);
19TDS_SuplaDeviceChannel_E *getChannelPtr_E(int index);
20
21// Device parameters
22bool isGUIDEmpty();
23bool isAuthKeyEmpty();
24bool isSoftVerEmpty();
25bool isNameEmpty();
26bool isServerNameEmpty();
27bool isEmailEmpty();
28
29const char *getGUID();
30const char *getAuthKey();
31const char *getSoftVer();
32const char *getName();
33void fillGUIDText(char text[37]);
34
35void setGUID(const char *GUID);
36void setAuthKey(const char *AuthKey);
37void setSoftVer(const char *SoftVer);
38void setName(const char *Name);
39
40void setEmail(const char *email);
41void setServerName(const char *server);
42
43const char *getEmail();
44const char *getServerName();
45
46bool isSuplaPublicServerConfigured();
47bool isSleepingDeviceEnabled();
48bool isRemoteDeviceConfigEnabled();
49bool isPairingSubdeviceEnabled();
50bool isAutomaticFirmwareUpdateEnabled();
51bool isSetCfgModePasswordEnabled();
52
53void setManufacturerId(int16_t mfrId);
54void setProductId(int16_t productId);
55
56int16_t getManufacturerId();
57int16_t getProductId();
58
59void addFlags(int32_t newFlags);
60void removeFlags(int32_t removedFlags);
61
62// Channel operations
63int getNextFreeChannelNumber();
64bool isChannelNumberFree(int channelNumber);
65int getFreeChannelCount();
66bool hasFreeChannelCount(uint8_t requiredCount);
67void addChannel(int channelNumber);
68void removeChannel(int channelNumber);
69int getChannelCount();
70int getMaxChannelNumberUsed();
71
72void generateHttpAgent(char *buffer, int size);
73
74#ifdef SUPLA_TEST
75void resetToDefaults();
76int32_t getChannelFunctionList(int channelNumber);
77int32_t getChannelDefaultFunction(int channelNumber);
78int32_t getChannelType(int channelNumber);
79int getChannelNumber(int index);
80int8_t *getChannelValuePtr(int channelNumber);
81uint64_t getChannelFlags(int channelNumber);
82#endif
83
84} // namespace RegisterDevice
85} // namespace Supla
86
87#endif // SRC_SUPLA_DEVICE_REGISTER_DEVICE_H_
Definition proto.h:973
Definition proto.h:999
Definition proto.h:1105