adafruit / Adafruit_nRF8001

Drivers for Adafruit's nRF8001 Bluetooth Low Energy Breakout
109 stars 53 forks source link

A stray `break` in write(uint8_t * buffer, uint8_t len) prevents any data from sending. #6

Closed AlexJWayne closed 10 years ago

AlexJWayne commented 10 years ago

This break on this line in write(uint8_t * buffer, uint8_t len): https://github.com/adafruit/Adafruit_nRF8001/blob/master/Adafruit_BLE_UART.cpp#L211

It seems to break out of the while loop when it shouldn't, preventing any data from sending.

if(!lib_aci_is_pipe_available(&aci_state, PIPE_UART_OVER_BTLE_UART_TX_TX))
{
  pollACI();
  break; // Breaks universe
}

The implementation of the single byte write(uint8_t buffer) method has no such short circuit and seems to work just fine.

After removing the offending break from the library, my data is actually coming through to my iPhone.

I'm no expert on the libraries used here, but it seems this line should be removed. Whatever it's supposed to be guarding against doesn't seem to be working as intended.

tdicola commented 10 years ago

Thanks for raising the issue and digging in to the cause. I gave it a quick repro and also saw the same issue, calling write with a buffer wouldn't show up on a connected device. Removing the break fixes the issue so I'll push an update to remove it. Thanks!