-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathBaseDefinitions.h
89 lines (71 loc) · 2.07 KB
/
BaseDefinitions.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/**************************************************************************/
/*!
@file BaseDefinitions.h
@author Sebastien Warin (http://sebastien.warin.fr)
@version 2.4.18186
@section LICENSE
Constellation License Agreement
Copyright (c) 2015-2018, Sebastien Warin
All rights reserved.
By receiving, opening the file package, and/or using Constellation 1.8("Software")
containing this software, you agree that this End User User License Agreement(EULA)
is a legally binding and valid contract and agree to be bound by it.
You agree to abide by the intellectual property laws and all of the terms and
conditions of this Agreement.
http://www.myconstellation.io/license.txt
*/
/**************************************************************************/
#ifndef _CONSTELLATION_DEFINITIONS_
#define _CONSTELLATION_DEFINITIONS_
#define HTTP_OK 200
#define HTTP_NO_CONTENT 204
#define HTTP_SERVER_ERROR 500
#define DEFAULT_HTTP_USERAGENT "ArduinoLib/2.4"
#define WILDCARD "*"
#define MESSAGE_CALLBACK_SIGNATURE void (*msgCallback)(JsonObject&)
#define MESSAGE_CALLBACK_WCONTEXT_SIGNATURE void (*msgCallbackWithContext)(JsonObject&, MessageContext)
#define STATEOBJECT_CALLBACK_SIGNATURE void (*soCallback)(JsonObject&)
enum ScopeType : uint8_t {
None = 0,
Group = 1,
Package = 2,
Sentinel = 3,
Other = 4,
All = 5
};
enum LogLevel : uint8_t {
LevelNone = 0,
LevelInfo = 1,
LevelWarn = 2,
LevelError = 3
};
enum SenderType : uint8_t {
ConsumerHub = 0,
ConsumerHttp = 1,
ConstellationHub = 2,
ConstellationHttp = 3
};
enum DescriptorType : uint8_t {
MessageCallbackType = 1,
StateObjectType = 2
};
enum DebugMode : uint8_t {
Off = 0,
Error = 1,
Info = 2,
Debug = 3,
Trace = 4
};
typedef struct {
SenderType type;
const char* friendlyName;
const char* connectionId;
} MessageSender;
typedef struct {
const char* sagaId;
bool isSaga;
const char* messageKey;
MessageSender sender;
ScopeType scope;
} MessageContext;
#endif