-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathwebservice.c
84 lines (71 loc) · 1.63 KB
/
webservice.c
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
//***************************************************************************
// Web Service
// File webservice.c
// This code is distributed under the terms and conditions of the
// GNU GENERAL PUBLIC LICENSE. See the file LICENSE for details.
// Date 28.12.2021 - Jörg Wendel
//***************************************************************************
#include <strings.h>
#include "webservice.h"
//***************************************************************************
// Web Service
//***************************************************************************
const char* cWebService::events[] =
{
"unknown",
"login",
"logout",
"pagechange",
"data",
"init",
"toggleio",
"toggleionext",
"togglemode",
"storeconfig",
"gettoken",
"setup",
"storeiosetup",
"chartdata",
"logmessage",
"userdetails",
"storeuserconfig",
"changepasswd",
"command",
"groups",
"groupconfig",
"chartbookmarks",
"storechartbookmarks",
"syslog",
"system",
"forcerefresh",
"storedashboards",
"alerts",
"storealerts",
"imageconfig",
"schema",
"storeschema",
"storecalibration",
"lmcaction",
"errors",
"menu",
"pareditrequest",
"parstore",
"pellets",
"pelletsadd",
0
};
const char* cWebService::toName(Event event)
{
if (event >= evUnknown && event < evCount)
return events[event];
return events[evUnknown];
}
cWebService::Event cWebService::toEvent(const char* name)
{
if (!name)
return evUnknown;
for (int e = evUnknown; e < evCount; e++)
if (strcasecmp(name, events[e]) == 0)
return (Event)e;
return evUnknown;
}