Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BLE_ERROR after 11 BLE packets #48

Open
ericlangel opened this issue Aug 16, 2018 · 1 comment
Open

BLE_ERROR after 11 BLE packets #48

ericlangel opened this issue Aug 16, 2018 · 1 comment

Comments

@ericlangel
Copy link

ericlangel commented Aug 16, 2018

Hello,

i have some problems with ble.updateCharacteristicValue()
After 11 packets with 18Bytes it doesn't send the 12th one.

my code in a for loop:
if(ble.updateCharacteristicValue(characteristic1.getValueAttribute().getHandle(), (uint8_t *)&Work_Buffer[0], 12)== BLE_ERROR_NONE){
Serial.println("OK");
}
else{
Serial.println("BLE Error");
}

i got 11 OK's and after that many BLE Error's
The Error is Value 5 ->BLE_STACK_BUSY

i tried to add a Delay between the packets, but it doesn't helped.

Where is the Problem? can i flush or clear the BLE Buffer?

@ericlangel
Copy link
Author

i get it working, but i don't know why its working?

i added a ble.waitForEvent() after ble.updateCharacteristicValue()

ble.updateCharacteristicValue(characteristic1.getValueAttribute().getHandle(), (uint8_t *)&Work_Buffer[0], 12);
ble.waitForEvent();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant