More compact module sensors was added
This commit is contained in:
@@ -30,9 +30,12 @@ void BluetoothDispatcher::tick() {
|
||||
_buffer += (char)_controller->read();
|
||||
}
|
||||
if (_buffer.endsWith("\r")) {
|
||||
_serial->println(_buffer.substring(0, _buffer.lastIndexOf("\r")));
|
||||
char buffer[_buffer_size];
|
||||
_buffer.substring(0, _buffer.lastIndexOf('\r'), buffer);
|
||||
_serial->println(buffer); // print the payload
|
||||
_buffer.clear();
|
||||
_controller->write((uint8_t *)"Hello, world!", strlen("Hello, world!"));
|
||||
// TODO: add callback, that receive new state
|
||||
}
|
||||
if (_buffer.length() > _buffer_size) {
|
||||
_buffer.clear();
|
||||
|
||||
Reference in New Issue
Block a user