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:
parent
8d80dd2604
commit
bedd1f4f95
5 changed files with 126 additions and 7 deletions
11
src/main.cpp
11
src/main.cpp
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue