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)