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

Is esp32 ble irq() missing resp_data receiving event? #5716

Closed
Walkline80 opened this issue Mar 3, 2020 · 1 comment
Closed

Is esp32 ble irq() missing resp_data receiving event? #5716

Walkline80 opened this issue Mar 3, 2020 · 1 comment

Comments

@Walkline80
Copy link

According to BLE.gap_advertise(), when we act as the Advertiser, we can broadcasting 'adv_data' and 'resp_data', and the 'resp_data' can be read by the Central after they were connected.

In the opposite case, when we act as the Central, there isn't an irq events to receive 'resp_data' from the Peripheral after connected. In otherwise, maybe something wrong I have made?

Here is some piece of my code:

def irq(event, data):
    if event == BLEConst.IRQ_SCAN_RESULT: ...
    elif event == BLEConst.IRQ_SCAN_COMPLETE: ...
    elif event == BLEConst.IRQ_PERIPHERAL_CONNECT: ...
    elif event == BLEConst.IRQ_PERIPHERAL_DISCONNECT: ...
    elif event == BLEConst.IRQ_GATTC_NOTIFY: ...
    elif event == BLEConst.IRQ_GATTC_INDICATE: ...
    elif event == BLEConst.IRQ_GATTC_SERVICE_RESULT: ...
    elif event == BLEConst.IRQ_GATTC_CHARACTERISTIC_RESULT: ...
    else:
        print("event: {}, data: {}".format(event, data))

And here is the repl information, I adjusted the output order of some information, but it has no effect on the logic:

connecting to [A4:C1:38:0C:15:FD]
GAP procedure initiated: connect; peer_addr_type=0 peer_addr=a4:c1:38:0c:15:fd scan_itvl=16 scan_window=16 itvl_min=24 itvl_max=40 latency=0 supervision_timeout=256 min_ce_len=16 max_ce_len=768 own_addr_type=0
[A4:C1:38:0C:15:FD] connected

GATT procedure initiated: discover all services
service result: [(0, 1, 7, UUID16(0x1800))]
service result: [(0, 8, 11, UUID16(0x1801))]
service result: [(0, 12, 24, UUID16(0x180a))]
service result: [(0, 25, 28, UUID16(0x180f))]
service result: [(0, 29, 32, UUID128('00010203-0405-0607-0809-0a0b0c0d1912'))]
service result: [(0, 33, 75, UUID128('ebe0ccb0-7a0a-4b0c-8a1a-6ff2997da3a6'))]
service result: [(0, 76, 95, UUID16(0xfe95))]
service result: [(0, 96, 104, UUID128('00000100-0065-6c62-2e74-6f696d2e696d'))]

GAP procedure initiated: connection parameter update; conn_handle=0 itvl_min=12 itvl_max=24 latency=0 supervision_timeout=90 min_ce_len=16 max_ce_len=768

[A4:C1:38:0C:15:FD] notify: b'\xb3\x08$\xae\x0b'
[A4:C1:38:0C:15:FD] notify: b'\xb0\x08#\xae\x0b'
[A4:C1:38:0C:15:FD] notify: b'\xb4\x08#\xae\x0b'
[A4:C1:38:0C:15:FD] notify: b'\xb2\x08#\xae\x0b'
[A4:C1:38:0C:15:FD] notify: b'\xb3\x08$\xae\x0b'
[A4:C1:38:0C:15:FD] notify: b'\xb1\x08$\xae\x0b'
[A4:C1:38:0C:15:FD] notify: b'\xb4\x08$\xae\x0b'
@jimmo
Copy link
Member

jimmo commented Mar 5, 2020

Scan response isn't currently implemented. It should be pretty straightforward though.

It's on the TODO list -- #5186

@jimmo jimmo closed this as completed Mar 5, 2020
tannewt added a commit to tannewt/circuitpython that referenced this issue Dec 15, 2021
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

2 participants