Read uint8 from serial

I’m working with this library and I need to be able to send/receive unsigned bytes. I can send them with Serial1.write but I’m unable to read them. I’ve tried looping with, casting with Serial1.readBytes and basically every possible way to read the serial I can think of but all I’m getting is garbage. Is there any native way to read to an unsigned char buffer on the elctron?

@jcole, do you have a link to the actual code?

I don’t quite see this issue

I’ve tried to write and read bytes with this code and a TX-RX loopback and it works as expected

uint8_t buf[256];
uint8_t inbuf[256];

void setup() 

  for (uint8_t i=0; i<30;i++)
    buf[i] = i;

void loop() 
  Serial1.write(buf, 30);
  Serial1.readBytes((char*)inbuf, 255);
  for(int i=0; i<30; i++)
    Serial.printf("0x%02x ", inbuf[i]);

The thing to take into account is the 64byte RX/TX buffer tho’ (observer the “missing” 0x3f entry in each block)

Yeah, I don’t know. I went from getting garbage to getting no response at all. I just contacted the link labs people so hopefully they can shed some light.