-
Notifications
You must be signed in to change notification settings - Fork 24
/
ocpp_process.h
59 lines (53 loc) · 1.66 KB
/
ocpp_process.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
#ifndef __OCPP_PROCESS_H
#define __OCPP_PROCESS_H
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <stdbool.h>
#include "ocpp_ws_client.h"
#include "ocpp_helper.h"
#include "cJSON.h"
#include "main.h"
//OCPP Machine States, as per defined in the documentation
typedef enum{
Authorize,
BootNotification,
CancelReservation,
ChangeAvailability,
ChangeConfiguration,
ClearCache,
ClearChargingProfile,
DataTransfer,
DiagnosticsStatusNotification,
FirmwareStatusNotification,
GetConfiguration,
GetDiagnostics,
GetLocalListVersion,
Heartbeat,
MeterValues,
RemoteStartTransaction,
RemoteStopTransaction,
GetCompositeSchedule,
ReserveNow,
Reset,
StartTransaction,
StatusNotification,
StopTransaction,
SendLocalList,
SetChargingProfile,
TriggerMessage,
UnlockConnector,
UpdateFirmware
}OCPP_States;
//HeartBeat Interval used for pinging to CMS for mainting the connection
uint64_t heartBeatInterval;
//If the CP is rejected or state becomes pending, it is the interval when it will again retry
uint64_t retryInterval;
//OCPP Process starting point
void ocpp_process_start();
int onclose(wsclient *c); // This function is called when close event occurs in websocket connection
int onerror(wsclient *c, wsclient_error *err); // This function is called when error event occurs in websocket connection
int onmessage(wsclient *c, wsclient_message *msg); // This function is called when message event occurs in websocket connection
int onopen(wsclient *c); // This function is called webSocket is just open
#endif