Question
How to yield a task when sending large amount of data
Hi all,
I want to send loads of data to a client whenever it enables notification for that service. What I have now is that I can catch the En/disable of the characteristic notification and start a task on it using the sequencer. However as long as the task is running, all the received requests aren't executed until the transmission task is completed. Causing data to get lost.
How do I properly yield the task for received BLE requests to be executed?
Steps executed by code:
void TransmitDataTask()
{
while (notify == enabled)
{
Read 1 data entry
chop data into packages
send packages using aci_gatt_update_char_value
// TODO: Check for incomming ble requests/yield task ??
}
}
void IDataNotifyEnabled()
{
notify = enabled
set TransmitDataTask using UTIL_SEQ_SetTask
}
void IDataNotifyDisabled()
{
notify = disabled // will terminate the task
}Kind regards,
Taxara
