Telemetry icon indicating copy to clipboard operation
Telemetry copied to clipboard

TM_transport size inconsistency (telemetry_utils.h)

Open slightlynybbled opened this issue 9 years ago • 1 comments

struct TM_transport {
  int32_t (*read)(uint8_t * buf, uint32_t sizeToRead);
  int32_t (*readable)();
  int32_t (*write)(uint8_t * buf, uint32_t sizeToWrite);
  int32_t (*writeable)();
};

Return types for each should match the potential 'readable' or 'writeable'. For instance, if 'sizeToRead' is an uint32_t, then the return should also be a uint32_t. This issue is present in the examples, source code, and wiki.

slightlynybbled avatar Apr 29 '16 13:04 slightlynybbled

Good catch Jason, I was planning to eventually return negative error code but returning 0 should be enough to signal an error.

Overdrivr avatar Apr 29 '16 13:04 Overdrivr