BLE buffer problem.
Posted: Sun Jul 19, 2020 5:54 am
Hi, im have problem in buffer gatts_read. With a single data transfer to the BLE buffer, there is no problem, but when it sends 10-20 separate packets, some are cut off.
This is my code:
This is my code:
Code: Select all
self._ble.gatts_set_buffer(self.tele, rx_tele_buf, True)
... ble.py:
elif event == _IRQ_GATTS_WRITE:
conn_handle, attr_handle, = data
if (attr_handle == self.telemetry_val):
tb = self._ble.gatts_read(attr_handle)
tele_buf.append(tb)
Code: Select all
... main.py
import ble.py
async def read_ble_buffer_telemetry():
while True:
if (len(ble.tele_buf) > 0):
for b_item in ble.tele_buf:
print("DATA: "+str(b_item))
await xbee_uart_send(b_item)
await uasyncio.sleep_ms(0)