osc bug fix

This commit is contained in:
Dooho Yi 2021-02-17 17:54:41 +09:00
parent 7fc7eb2719
commit 3bf8314f2e
2 changed files with 9 additions and 2 deletions

View file

@ -109,7 +109,9 @@ void loop() {
// //
if (type == '{') { if (type == '{') {
//expecting a Hello message. //expecting a Hello message.
if (POSTMAN_SERIAL.available() > sizeof(Hello) + 1) { if (POSTMAN_SERIAL.available() > sizeof(Hello) + 2) {
POSTMAN_SERIAL.read();
//
Hello hello; Hello hello;
POSTMAN_SERIAL.readBytes((uint8_t *) &hello, sizeof(Hello)); POSTMAN_SERIAL.readBytes((uint8_t *) &hello, sizeof(Hello));
char last = POSTMAN_SERIAL.read(); char last = POSTMAN_SERIAL.read();
@ -134,7 +136,9 @@ void loop() {
} }
} else if (type == '[') { } else if (type == '[') {
//expecting a Note message. //expecting a Note message.
if (POSTMAN_SERIAL.available() > sizeof(Note) + 1) { if (POSTMAN_SERIAL.available() > sizeof(Note) + 2) {
POSTMAN_SERIAL.read();
//
Note note; Note note;
POSTMAN_SERIAL.readBytes((uint8_t *) &note, sizeof(Note)); POSTMAN_SERIAL.readBytes((uint8_t *) &note, sizeof(Note));
char last = POSTMAN_SERIAL.read(); char last = POSTMAN_SERIAL.read();

View file

@ -112,6 +112,9 @@ void onDataSent(uint8_t *mac_addr, uint8_t sendStatus) {
// on 'receive' // on 'receive'
void onDataReceive(uint8_t * mac, uint8_t *incomingData, uint8_t len) { void onDataReceive(uint8_t * mac, uint8_t *incomingData, uint8_t len) {
//
//MONITORING_SERIAL.write(incomingData, len);
// //
#if defined(HAVE_CLIENT) #if defined(HAVE_CLIENT)
Serial.write(incomingData, len); // we pass it over to the client. Serial.write(incomingData, len); // we pass it over to the client.