supla-device
Toggle main menu visibility
Loading...
Searching...
No Matches
src
supla
suplet
calcfg_session.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
This program is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
GNU General Public License for more details.
12
You should have received a copy of the GNU General Public License
13
along with this program; if not, write to the Free Software
14
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15
*/
16
17
#ifndef SRC_SUPLA_SUPLET_CALCFG_SESSION_H_
18
#define SRC_SUPLA_SUPLET_CALCFG_SESSION_H_
19
20
#include <stdint.h>
21
22
#include <supla/sha256.h>
23
#include <supla/suplet/config.h>
24
#include <supla/suplet/definition_cache.h>
25
#include <supla/suplet/storage.h>
26
27
namespace
Supla {
28
namespace
Suplet {
29
30
struct
InstanceCalcfgSession
{
31
bool
active =
false
;
32
uint32_t sessionId = 0;
33
uint32_t lastActivityMs = 0;
34
uint8_t instanceId = 0;
35
bool
upgrade =
false
;
36
uint32_t definitionId = 0;
37
uint16_t fromDefinitionVersion = 0;
38
uint16_t definitionVersion = 0;
39
uint16_t paramsSize = 0;
40
uint16_t receivedSize = 0;
41
uint8_t expectedSha256[32] = {};
42
uint8_t params[SUPLA_SUPLET_MAX_CONFIG_SIZE + 1] = {};
43
uint8_t received[SUPLA_SUPLET_MAX_CONFIG_SIZE] = {};
44
};
45
46
struct
DefinitionCalcfgSession
{
47
bool
active =
false
;
48
uint32_t sessionId = 0;
49
uint32_t lastActivityMs = 0;
50
uint32_t definitionId = 0;
51
uint16_t definitionVersion = 0;
52
uint16_t jsonSize = 0;
53
uint16_t receivedSize = 0;
54
DefinitionCacheHandle
cacheHandle = {};
55
uint16_t currentChunkIndex = 0;
56
uint16_t currentChunkSize = 0;
57
uint8_t expectedSha256[32] = {};
58
uint8_t currentChunk[SUPLA_SUPLET_DEFINITION_CACHE_CHUNK_SIZE] = {};
59
Supla::Sha256
sha256 = {};
60
};
61
62
}
// namespace Suplet
63
}
// namespace Supla
64
65
#endif
// SRC_SUPLA_SUPLET_CALCFG_SESSION_H_
Supla::Sha256
Definition
sha256.h:28
Supla::Suplet::DefinitionCacheHandle
Definition
definition_cache.h:59
Supla::Suplet::DefinitionCalcfgSession
Definition
calcfg_session.h:46
Supla::Suplet::InstanceCalcfgSession
Definition
calcfg_session.h:30
Generated by
1.17.0