-
Notifications
You must be signed in to change notification settings - Fork 1
command librairy
Arnaud Mercier edited this page Jul 6, 2022
·
3 revisions
This homemade librairy implements high level functions to operate the open-seismic harware
All functions needs a stream object, which is the serial port you want to use to send command.
All function use a command object to transfer data:
typedef int commandType;
typedef int commandDef;
typedef struct {
commandType type;
commandDef def;
int status;
int adcConfig;
String data;
int workerId;
bool empty;
} command;
This allows to have different command object depending on the communication needs.
The buildAndSendCommand function send all the parameters in the command struct object with a letter before each parameter. This makes it easy to decode the information in the readCommand function.
When the master wants to harvest the data from a slave then it send a command asking for data. The slaves writes the data directly into the serial port while the master is ready to listen.