1
0
Fork 0

Com: Implement proper communications

Implement a set of functions to create messages following the protocols
defined in the README for communication.
Handle HID, which is used to communicate with the interactive application.

Update README with details on the message structures.
This commit is contained in:
Teo-CD 2023-09-24 18:00:42 +01:00
parent 8d80dd2604
commit bedd1f4f95
5 changed files with 126 additions and 7 deletions

View file

@ -3,6 +3,7 @@
#include "Pinout.h"
#include "RFID.h"
#include "Com.h"
__attribute__((noreturn)) int main() {
pinMode(pin_DBG_LED_1, OUTPUT);
@ -36,7 +37,7 @@ __attribute__((noreturn)) int main() {
*/
Serial.begin(115200);
Serial.println("# System is powered up, running set-up.");
Com::sendComment("# System is powered up, running set-up.");
/* TODO: Setups once module structure is up. */
RFID rfid;
@ -45,11 +46,11 @@ __attribute__((noreturn)) int main() {
/* Main loop */
while (true) {
int8_t tagID;
int8_t tagEvent;
tagID = rfid.checkTags();
if (tagID) {
Serial.printf("Check tag result : %d\n", tagID);
tagEvent = rfid.checkTags();
if (tagEvent) {
Com::sendFigUpdate(tagEvent);
}
delay(100);