Skip to content

Implement RAPI Sequence ID support #3

@lincomatic

Description

@lincomatic

For integrity's sake, I recommend that you implement RAPI sequence ID support, in order to ensure that replies don't get out of sync w/ commands. You can review my code in RapiSender.cpp in the ESP code for reference.

From rapi_proc.h of the OpenEVSE firmware:

Command format:
$cc pp pp .. :ss^xk\r

\r = carriage return = 13d = 0x0D
cc = 2-letter command
pp = parameters
xk = 2-hex-digit checksum - 8-bit XOR of all characters before '^'
ck = 2-hex-digit checksum - 8-bit sum of all characters before '*'
ss = optional 2-hex-digit sequence id - response will echo the sequence id
so that receiver can verify that the response matches the command
ss CANNOT be 00, which is reserved as an invalid value

response format:
$OK [optional parameters] [:ss]^xk\r - success
$NK [optional parameters] [:ss]^xk\r - failure
xk = 2-hex-digit checksum - 8-bit XOR of all characters before '^'
ss = optional 2-hex-digit sequence ID which was sent with the command
only present if a sequence ID was send with the command

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions