supla-device
Toggle main menu visibility
Loading...
Searching...
No Matches
src
supla
device
register_device.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
19
#ifndef SRC_SUPLA_DEVICE_REGISTER_DEVICE_H_
20
#define SRC_SUPLA_DEVICE_REGISTER_DEVICE_H_
21
22
#include <supla-common/proto.h>
23
24
#include <stdint.h>
25
26
namespace
Supla {
27
namespace
RegisterDevice {
28
29
TDS_SuplaRegisterDeviceHeader *getRegDevHeaderPtr();
30
// Returns pointer to structure, which is filled with values from channel
31
// at given index. Next call will return exactly the same pointer, but with
32
// data from another channel, so please be careful when using this function
33
TDS_SuplaDeviceChannel_D *getChannelPtr_D(
int
index);
34
TDS_SuplaDeviceChannel_E *getChannelPtr_E(
int
index);
35
36
// Device parameters
37
bool
isGUIDEmpty();
38
bool
isAuthKeyEmpty();
39
bool
isSoftVerEmpty();
40
bool
isNameEmpty();
41
bool
isServerNameEmpty();
42
bool
isEmailEmpty();
43
44
const
char
*getGUID();
45
const
char
*getAuthKey();
46
const
char
*getSoftVer();
47
const
char
*getName();
48
void
fillGUIDText(
char
text[37]);
49
50
void
setGUID(
const
char
*GUID);
51
void
setAuthKey(
const
char
*AuthKey);
52
void
setSoftVer(
const
char
*SoftVer);
53
void
setName(
const
char
*Name);
54
55
void
setEmail(
const
char
*email);
56
void
setServerName(
const
char
*server);
57
58
const
char
*getEmail();
59
const
char
*getServerName();
60
61
bool
isSuplaPublicServerConfigured();
62
bool
isSleepingDeviceEnabled();
63
bool
isRemoteDeviceConfigEnabled();
64
bool
isPairingSubdeviceEnabled();
65
bool
isAutomaticFirmwareUpdateEnabled();
66
bool
isSetCfgModePasswordEnabled();
67
68
void
setManufacturerId(int16_t mfrId);
69
void
setProductId(int16_t productId);
70
71
int16_t getManufacturerId();
72
int16_t getProductId();
73
74
void
addFlags(int32_t newFlags);
75
void
removeFlags(int32_t removedFlags);
76
77
// Channel operations
78
int
getNextFreeChannelNumber();
79
bool
isChannelNumberFree(
int
channelNumber);
80
void
addChannel(
int
channelNumber);
81
void
removeChannel(
int
channelNumber);
82
int
getChannelCount();
83
int
getMaxChannelNumberUsed();
84
85
void
generateHttpAgent(
char
*buffer,
int
size);
86
87
#ifdef SUPLA_TEST
88
void
resetToDefaults();
89
int32_t getChannelFunctionList(
int
channelNumber);
90
int32_t getChannelDefaultFunction(
int
channelNumber);
91
int32_t getChannelType(
int
channelNumber);
92
int
getChannelNumber(
int
index);
93
int8_t *getChannelValuePtr(
int
channelNumber);
94
uint64_t getChannelFlags(
int
channelNumber);
95
#endif
96
97
}
// namespace RegisterDevice
98
}
// namespace Supla
99
100
#endif
// SRC_SUPLA_DEVICE_REGISTER_DEVICE_H_
Generated by
1.17.0