163 lines
4.0 KiB
Protocol Buffer
163 lines
4.0 KiB
Protocol Buffer
syntax = "proto2";
|
|
|
|
enum eventType_e {
|
|
EVENT_SWAP_START = 0x200;
|
|
EVENT_BATTERY_ENTRY = 0x201;
|
|
EVENT_BATTERY_EXIT = 0x202;
|
|
EVENT_ACTIVITY_FAILED = 0x203;
|
|
EVENT_SWAP_ABORTED = 0x204;
|
|
EVENT_BATFAULT_ALARM = 0x205;
|
|
EVENT_SLOT_LOCK_ENEGAGED = 0x206;
|
|
EVENT_SWAP_ENDED = 0x207;
|
|
EVENT_CHGFAULT_ALARM = 0x208;
|
|
EVENT_NFC_SCAN = 0x209;
|
|
EVENT_SLOT_LOCK_DISENEGAGED = 0x20A;
|
|
EVENT_REVERSE_SWAP = 0x20B;
|
|
}
|
|
|
|
enum jobType_e {
|
|
JOBTYPE_NONE = 0;
|
|
JOBTYPE_GET_STATUS_OF_A_JOB = 0x01;
|
|
JOBTYPE_SWAP_START = 0x100;
|
|
JOBTYPE_CHARGER_ENABLE_DISABLE = 0x101;
|
|
JOBTYPE_GATE_OPEN_CLOSE = 0x102;
|
|
JOBTYPE_TRANSACTION_ABORT = 0x103;
|
|
JOBTYPE_REBOOT = 0x104;
|
|
JOBTYPE_SWAP_DENY = 0x105;
|
|
JOBTYPE_LANGUAGE_UPDATE = 0x106;
|
|
JOBTYPE_SWAP_AUTH_SUCCESS = 0x107;
|
|
}
|
|
|
|
enum jobResult_e {
|
|
JOB_RESULT_UNKNOWN = 0;
|
|
JOB_RESULT_SUCCESS = 1;
|
|
JOB_RESULT_REJECTED = 2;
|
|
JOB_RESULT_TIMEOUT = 3;
|
|
}
|
|
|
|
enum jobStatus_e {
|
|
JOB_STATUS_IDLE = 0;
|
|
JOB_STATUS_PENDING = 1;
|
|
JOB_STATUS_EXECUTING = 2;
|
|
JOB_STATUS_EXECUTED = 3;
|
|
}
|
|
|
|
message slotLevelPayload{
|
|
optional uint32 batteryPresent = 1;
|
|
optional uint32 chargerPresent = 2;
|
|
optional uint32 doorLockStatus = 3;
|
|
optional uint32 doorStatus = 4;
|
|
optional uint32 voltage = 5;
|
|
optional int32 current = 6;
|
|
optional uint32 batteryFaultCode = 7;
|
|
optional uint32 chargerFaultCode = 8;
|
|
optional int32 batteryMaxTemp = 9;
|
|
optional int32 chargerMaxTemp= 10;
|
|
optional string batteryIdentification = 11;
|
|
optional uint32 batteryMode = 12;
|
|
optional uint32 chargerMode = 13;
|
|
optional int32 slotTemperature = 14;
|
|
optional uint32 gasSensor = 15;
|
|
optional uint32 soc=16;
|
|
optional uint32 ts = 17;
|
|
}
|
|
|
|
message mainPayload{
|
|
required uint32 ts = 1;
|
|
required string deviceId = 2;
|
|
required string sessionId = 3;
|
|
repeated slotLevelPayload slotLevelPayload = 4;
|
|
optional uint32 backupSupplyStatus = 5;
|
|
repeated uint32 switchStatus = 6;
|
|
optional uint32 stationStatus = 7;
|
|
optional uint32 stationDiagnosticCode = 8;
|
|
repeated float coordinates = 9;
|
|
}
|
|
|
|
enum swapAbortReason_e{
|
|
ABORT_UNKNOWN=0;
|
|
ABORT_BAT_EXIT_TIMEOUT=1;
|
|
ABORT_BAT_ENTRY_TIMEOUT=2;
|
|
ABORT_DOOR_CLOSE_TIMEOUT=3;
|
|
ABORT_DOOR_OPEN_TIMEOUT=4;
|
|
ABORT_INVALID_PARAM=5;
|
|
ABORT_REMOTE_REQUESTED=6;
|
|
ABORT_INVALID_BATTERY=7;
|
|
}
|
|
|
|
enum swapDenyReason_e{
|
|
SWAP_DENY_INSUFFICIENT_BAL=1;
|
|
SWAP_DENY_INVALID_NFC=2;
|
|
SWAP_DENY_BATTERY_UNAVAILABLE=3;
|
|
}
|
|
|
|
enum languageType_e{
|
|
LANGUAGE_TYPE_ENGLISH = 1;
|
|
LANGUAGE_TYPE_HINDI = 2;
|
|
LANGUAGE_TYPE_KANNADA = 3;
|
|
LANGUAGE_TYPE_TELUGU = 4;
|
|
}
|
|
|
|
message nfcPayload_s{
|
|
required string manufacturingData = 1;
|
|
required string customData = 2;
|
|
}
|
|
|
|
message eventData_s {
|
|
optional nfcPayload_s nfcData = 1;
|
|
optional string batteryIdentification = 2;
|
|
optional uint32 activityFailureReason = 3;
|
|
optional swapAbortReason_e swapAbortReason = 4;
|
|
optional uint32 swapTime = 5;
|
|
optional uint32 faultCode = 6;
|
|
optional uint32 doorStatus = 7;
|
|
optional uint32 slotId = 8;
|
|
}
|
|
|
|
message eventPayload {
|
|
required uint32 ts = 1;
|
|
required string deviceId = 2;
|
|
required eventType_e eventType = 3;
|
|
required string sessionId = 4;
|
|
optional eventData_s eventData = 5;
|
|
}
|
|
|
|
message rpcData_s {
|
|
optional string sessionId = 1;
|
|
repeated uint32 slotsData = 2;
|
|
}
|
|
|
|
message slotControl_s {
|
|
required uint32 slotId = 1;
|
|
required uint32 state = 2;
|
|
}
|
|
|
|
message getJobStatusByJobId_s{
|
|
required string jobId = 1;
|
|
}
|
|
|
|
message rpcRequest {
|
|
required uint32 ts = 1;
|
|
required string jobId = 2;
|
|
required jobType_e jobType = 3;
|
|
optional rpcData_s rpcData = 4;
|
|
optional slotControl_s slotInfo = 5;
|
|
optional swapDenyReason_e swapDeny = 8;
|
|
optional getJobStatusByJobId_s getJobStatusByJobId = 9;
|
|
optional languageType_e languageType = 10;
|
|
}
|
|
|
|
message jobStatusByJobIdResponse_s{
|
|
required string jobId = 1;
|
|
required jobStatus_e jobStatus = 2;
|
|
required jobResult_e jobResult = 3;
|
|
}
|
|
|
|
message rpcResponse {
|
|
required uint32 ts = 1;
|
|
required string deviceId = 2;
|
|
required string jobId = 3;
|
|
required jobStatus_e jobStatus = 4;
|
|
required jobResult_e jobResult = 5;
|
|
optional jobStatusByJobIdResponse_s jobStatusByJobIdResponse = 6;
|
|
} |