PacketSerial icon indicating copy to clipboard operation
PacketSerial copied to clipboard

Sending empty (0-byte) data

Open hillin opened this issue 5 years ago • 3 comments
trafficstars

Sending a 0-byte data actually does nothing on PacketSerial (returns directly in the send method). However I find it quite common to send such empty data. For example, a simple protobuf struct:

message SimpleMessage
{
    bool value = 1;
}

with its value set to false will be encoded as a 0-byte buffer by nanopb. I guess it's better to just send a PacketMarker for this kind of data.

Expected Behavior

Send a PacketMarker for 0-byte data.

Current Behavior

Does nothing on 0-byte data.

Your Environment

  • Version used: 1.4.0
  • IDE Name and version: N/A
  • Operating System and version (desktop or mobile): Arduino
  • Link to your project: N/A

hillin avatar Jan 03 '20 08:01 hillin

This lib seems to be unsupported. A much easier to use and supported serial packet library can be found here.

PowerBroker2 avatar May 12 '20 18:05 PowerBroker2

This library is in fact supported.

bakercp avatar May 13 '20 03:05 bakercp

Hi @hillin, pull requests are definitely welcomed!

https://github.com/bakercp/PacketSerial/blob/master/docs/CONTRIBUTING.md

bakercp avatar May 13 '20 03:05 bakercp