arduino / arduino/ArduinoCore-arc32

[Urgent][Stuck Problem] BLE setValue in callback function!

Open
#592 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
330
Forks
281
PR merge metrics
No merged PRs in 30d

Description

Hi There

Now , I'm using curie nano board
my ble program is using callback function.

```c++:

void dataSyncCharCharacteristicWritten(BLEDevice central, BLECharacteristic characteristic) {
// 1. read external serial flash
// code here
// 2. save data in buffer from serial flash memory
// code here
// 3. nofity and send to application buff Value
for (int i = 0; i < register_index; i++) {
syncChar.setValue(syncBuff[i], SAVE_UNIT_STEP);
}
}
```

- where syncChar
```
BLECharacteristic syncChar("FFF2", BLERead | BLEWrite | BLENotify , 20);
```

My problem code parts is number 3
Cuire board is stuck in for statement

How to solved this problem?

regards

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with dataSyncCharCharacteristicWritten on the Curie Nano and inspect the syncChar BLECharacteristic declaration and repeated setValue calls inside the loop. Determine what causes the callback to stop in the for statement; done means the callback can process the buffer and notify the application without the board becoming stuck.

Written by the indexing model from the issue text.

Assessment

Tech stack
arduino, cpp
Domain
embedded-iot
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.