Skip to content

Commit

Permalink
Merged main
Browse files Browse the repository at this point in the history
  • Loading branch information
Levi-Lesches committed May 2, 2024
2 parents afb777c + cc76472 commit cdb321c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions BURT_serial.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,12 @@ void BurtSerial::tryConnect(uint8_t* input, int length) {
* @return Returns `true` if the entire message is sent successfully, `false` otherwise.
*/
bool BurtSerial::send(const pb_msgdesc_t* fields, const void* message, int length) {
if (!isConnected) return false;
/// if (!isConnected) return false;

uint8_t buffer[length];
uint8_t* buffer = new uint8_t[length];
int encodedLength = BurtProto::encode(buffer, fields, message);

int sentLength = Serial.write(buffer, encodedLength);
delete[] buffer;
return encodedLength == sentLength;
}

0 comments on commit cdb321c

Please sign in to comment.