Added high level comms overview

This commit is contained in:
2026-01-25 17:22:02 +01:00
parent 317281063a
commit e7f8de347c
2 changed files with 12 additions and 3 deletions

View File

@@ -1,14 +1,23 @@
# Example Arduino Code For The Serial Communications Protocol
# Example Arduino Code For Serial Communications Protocol
This is an Arduino example/library of my serial communications protocol which implements checksums, acknowledge and repeat commands to normal serial communication, while still keeping the end user experience simple and intuitive.
## Command Packet Contents
Bellow is an illustration of a command packet which is sent out by the library.
![image](docs/CommandPacket.png)
Each command packet consists of an instructions packet, a checksum and an end bit, with each part being seperated by a separator bit. The istructions packet consists of a command and a data part, which are again separated by a bit. In the current form of the protocol the separator bit is a `#` and the terminator bit is a `@`.
An example command would look something like this `ERR#Something went wrong#4324@`. In the above example we are sending a command `ERR` with the arguments of `Something went wrong` and the `4324` is an auto generated checksum.
An example command would look something like this `ERR#Something went wrong#4342@`. In the that example we are sending a command `ERR` with the arguments of `Something went wrong` and the `4342` is an auto generated checksum.
All the data is currently being transmitted in plain-text, however in future versions of the library they will be encoded in hex and sent that way.
All the data is currently being transmitted in plain-text, however in future versions of the library they will be encoded in hex and sent that way.
## High Level Communications Overview
Bellow is a high level overview on how the communications protocol works and what gets sent between the two communicating devices. The left side of the diagram represents the communication when the command arrives to the receiver intact and on the right is a representation of what happens when the checksum is wrong(i.e. The command packet is malformed).
![image](docs/CommsProtocol.png)
It is important to note that the user never sees the ACKG/RPT commands be sent or the validation process take place. All the end user sees is the action assigned to a given command be executed once it's been confirmed as intact.