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

Send a BLE command to a device using 4 characteristics (IDFGH-13817) #14670

Open
3 tasks done
yanmartins opened this issue Oct 4, 2024 · 0 comments
Open
3 tasks done
Assignees
Labels
Status: Opened Issue is new

Comments

@yanmartins
Copy link

yanmartins commented Oct 4, 2024

Answers checklist.

  • I have read the documentation ESP-IDF Programming Guide and the issue is not addressed there.
  • I have updated my IDF branch (master or release) to the latest version and checked that the issue is present there.
  • I have searched the issue tracker for a similar issue and not found a similar issue.

General issue report

Hello!

I'm using ESPIDF version 5.3.1 with a ESP32-S3.
I flash the ESP as a BLE client with the example gatt_client and adapted it to try make it compatible with the device.

This device has 4 characteristics:

  1. UART Data TX Characteristics
    UUID: 00000002-0000-1000-8000-008025000000
    Type: uint8 array (20 bytes)
    Properties: Notify
    The Terminal I/O client uses the UART Data TX characteristic to receive UART data from the server (peripheral) via notifications.
    Terminal I/O Profile Client Implementation Guide

  2. UART Data RX Characteristics
    UUID: 00000001-0000-1000-8000-008025000000
    Type: uint8 array (20 bytes)
    Properties: Write without response
    The Terminal I/O client uses the UART Data RX characteristic to write UART data to the server (peripheral).

  3. UART Credits TX Characteristics
    UUID: 00000004-0000-1000-8000-008025000000
    Type: uint8 (1 byte)
    Properties: Indicate
    The Terminal I/O client uses the UART Credits TX characteristic to receive UART credits (0 - 255) from the server (peripheral) via indications.

  4. UART Credits RX Characteristics
    UUID: 00000003-0000-1000-8000-008025000000
    Type: uint8 (1 byte)
    Properties: Write
    The Terminal I/O client uses the UART Credits RX characteristic to grant UART credits (0 - 255) to the server (peripheral).

Here is the file with my changes:
gattc_demo.txt (Yes, there are redundant parts, it is a test xD)

The flow is:

  1. Active Indicate
  2. Activate Notify
  3. Use Write to set the UART credits size
  4. Use Write without response to send a command

The log:

I (1164) GATTC_DEMO:  
I (1174) GATTC_DEMO:  
I (1174) GATTC_DEMO:  
W (1184) GATTC_DEMO: searched device device_name
W (1184) GATTC_DEMO: connect to the remote device.
I (1184) GATTC_DEMO: stop scan successfully
I (1184) GATTC_DEMO:  
I (1194) GATTC_DEMO:  
I (1194) GATTC_DEMO:  
I (1194) GATTC_DEMO:  
W (5264) GATTC_DEMO: EVENT: 40
I (5264) GATTC_DEMO: ESP_GATTC_CONNECT_EVT conn_id 0, if 3
I (5264) GATTC_DEMO: REMOTE BDA:
I (5274) GATTC_DEMO: 00 21 7e 70 fa e3 
W (5274) GATTC_DEMO: EVENT: 2
I (5274) GATTC_DEMO: open success
I (5364) GATTC_DEMO: packet length updated: rx = 162, tx = 162, status = 0
W (6294) GATTC_DEMO: EVENT: 46
I (6294) GATTC_DEMO: discover service complete conn_id 0
W (6294) GATTC_DEMO: EVENT: 7
I (6294) GATTC_DEMO: SEARCH RES: conn_id = 0 is primary service 1
I (6304) GATTC_DEMO: start handle 17 end handle 65535 current handle value 17
I (6304) GATTC_DEMO: service found
I (6314) GATTC_DEMO: UUID16: fefb
W (6314) GATTC_DEMO: EVENT: 6
I (6324) GATTC_DEMO: Get service information from remote device
I (6324) GATTC_DEMO: ESP_GATTC_SEARCH_CMPL_EVT
I (6334) GATTC_DEMO: count: 6
E (6334) GATTC_DEMO: ASK FOR REG WRITE
E (6344) GATTC_DEMO: ASK FOR REG WRITE_NR
E (6344) GATTC_DEMO: ASK FOR REG NOTIFY
E (6344) GATTC_DEMO: ASK FOR REG INDICATE
W (6354) GATTC_DEMO: EVENT: 18
I (6354) GATTC_DEMO: ESP_GATTC_CFG_MTU_EVT, Status 0, MTU 158, conn_id 0
W (6364) GATTC_DEMO: EVENT: 38
I (6364) GATTC_DEMO: ESP_GATTC_REG_FOR_NOTIFY_EVT
W (6374) GATTC_DEMO: EVENT: 38
I (6374) GATTC_DEMO: ESP_GATTC_REG_FOR_NOTIFY_EVT
W (6444) GATTC_DEMO: EVENT: 9
I (6444) GATTC_DEMO: write descr success 
W (6494) GATTC_DEMO: EVENT: 9
I (6494) GATTC_DEMO: write descr success 
W (6494) ***: WRITE
W (6494) ***: WRITE NR
E (6494) ---: msg_len: 18
W (6544) GATTC_DEMO: EVENT: 4
I (6544) GATTC_DEMO: write char success 
W (6544) GATTC_DEMO: EVENT: 4
I (6544) GATTC_DEMO: write char success 

I tested sending commands using nRF Connect app and the device performs the actions correctly.

What could I be doing wrong?

@espressif-bot espressif-bot added the Status: Opened Issue is new label Oct 4, 2024
@github-actions github-actions bot changed the title Send a command to a device using 4 characteristics Send a command to a device using 4 characteristics (IDFGH-13817) Oct 4, 2024
@yanmartins yanmartins changed the title Send a command to a device using 4 characteristics (IDFGH-13817) Send a BLE command to a device using 4 characteristics (IDFGH-13817) Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Opened Issue is new
Projects
None yet
Development

No branches or pull requests

3 participants