adafruit / adafruit_nrf8001 Goto Github PK
View Code? Open in Web Editor NEWDrivers for Adafruit's nRF8001 Bluetooth Low Energy Breakout
Drivers for Adafruit's nRF8001 Bluetooth Low Energy Breakout
Error thrown:
fatal error: util/delay.h: No such file or directory
Cause:
The Due operates on a ARM chip rather than a AVR chipset while delay.h is specifically for the AVR chipset only
home/disappear/sketchbook/libraries/AdafruitnRF8001/utility/hal_aci_tl.cpp: In function ‘void hal_aci_tl_init()’:
/home/disappear/sketchbook/libraries/AdafruitnRF8001/utility/hal_aci_tl.cpp:323:9: error: ‘class SPIClass’ has no member named ‘usingInterrupt’
SPI.usingInterrupt(HAL_IO_RADIO_IRQ); // add checking for spi conflicts
^
/home/disappear/sketchbook/libraries/AdafruitnRF8001/utility/hal_aci_tl.cpp: In function ‘hal_aci_data_t* hal_aci_tl_poll_get()’:
/home/disappear/sketchbook/libraries/AdafruitnRF8001/utility/hal_aci_tl.cpp:366:7: error: ‘class SPIClass’ has no member named ‘beginTransaction’
SPI.beginTransaction(SPISettings(2000000, LSBFIRST, SPI_MODE0)); // gain control of SPI bus
^
/home/disappear/sketchbook/libraries/AdafruitnRF8001/utility/hal_aci_tl.cpp:366:64: error: ‘SPISettings’ was not declared in this scope
SPI.beginTransaction(SPISettings(2000000, LSBFIRST, SPI_MODE0)); // gain control of SPI bus
^
/home/disappear/sketchbook/libraries/AdafruitnRF8001/utility/hal_aci_tl.cpp:407:7: error: ‘class SPIClass’ has no member named ‘endTransaction’
SPI.endTransaction(); // release the SPI bus
^
Hi everyone,
i'm having a problem using multiple write() inside a loop void with Arduino Mega.
I need to send data over BLE to external devices and the limit of 20 char is a problem for my project.
To avoid this i thought to split my data in multiple messages and sending them inside the same loop but after 5-6 loop the write doesn't work anymore.
Can you help me?
Thanks in advance!
Sending strings longer than 20 characters causes chunks of the strings to be dropped and ACI errors to be output. I think this is because data_credit_available isn't checked anywhere before sending data. To reproduce, send some strings whose lengths are > 20 characters using print() one after the other. Some of them will be missing parts.
If I modify line 257 of Adafruit_BLE_UART.cpp to include a check that there is at least one data credit:
if(!lib_aci_is_pipe_available(&aci_state, PIPE_UART_OVER_BTLE_UART_TX_TX) || aci_state.data_credit_available == 0)
Then it will remain polling until the pipe is available and it has a data credit. (Line 281 needs a similar change.) The downside is this ends up wasting cycles, waiting for a data credit to become available. I also wrote the following function so I can check the pipe and data credit status, before I call print() or write():
bool Adafruit_BLE_UART::ready(void) {
return lib_aci_is_pipe_available(&aci_state, PIPE_UART_OVER_BTLE_UART_TX_TX) && aci_state.data_credit_available > 0;
}
what is HW interrupt?
the #define BLE_RW_DEBUG
macro is set. As far as I can see this shouldn't be defined since this is a debug only configuration.
I use Adafruit Bluefruit LE SPI Friend module in my device, when I create my custom services and characteristics and then advertising the services.
During advertising the services I want to connect via some mobile devices (iOS and Android). but when one device find the service and connect to module (when blue led on module turn on), others cannot find module.
Is it possible to connect to module via more than one devices?
I only got one code file in my library
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Arduino: 1.0.6 (Mac OS X), Board: "Arduino Uno"
/Users/teejiahen/Documents/Arduino/libraries/Adafruit_BLE_UART/utility/hal_aci_tl.cpp: In function 'void hal_aci_tl_init()':
/Users/teejiahen/Documents/Arduino/libraries/Adafruit_BLE_UART/utility/hal_aci_tl.cpp:317: error: 'class SPIClass' has no member named 'usingInterrupt'
/Users/teejiahen/Documents/Arduino/libraries/Adafruit_BLE_UART/utility/hal_aci_tl.cpp: In function 'hal_aci_data_t* hal_aci_tl_poll_get()':
/Users/teejiahen/Documents/Arduino/libraries/Adafruit_BLE_UART/utility/hal_aci_tl.cpp:360: error: 'class SPIClass' has no member named 'beginTransaction'
/Users/teejiahen/Documents/Arduino/libraries/Adafruit_BLE_UART/utility/hal_aci_tl.cpp:360: error: 'SPISettings' was not declared in this scope
/Users/teejiahen/Documents/Arduino/libraries/Adafruit_BLE_UART/utility/hal_aci_tl.cpp:401: error: 'class SPIClass' has no member named 'endTransaction'
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.