I am using a BLE module (CYBLE-212019-00) connected to a host processor and controlled via EZ-serial API (EZ-serial v.1.1.1 on BLE module, API library version 1.3). I try to connect the BLE module to a remote GATT server and discover the services and characteristics on this remote server. I am able to connect the BLE module, but the command for discovering services and characteristics fail with a result code 0x0108 “Operation not permitted”, although I am waiting the connection event to send the discovery command. Note that the service discovery and characteristic discovery works when I am using the text commands, but not when I send the same command (in binary) via the API.
Below are some additional details.
Thank you for the support.
Detail of the setup and the tests:
- Connection between two BLE modules CYBLE-212019-00, one is the client, the other is the server.
- Use of the default configuration without using CYSPP.
- Factory reset between tests.
- Pairing/bounding does not solve the problem.
- Using different parameter value for begin/end attribute handle for the discovery command does not solve the problem.
- Service discovery command is sent only when the connection has been established (gap_connected event received).
Test in text mode (successful):
# Factory reset
# Start scan
# ... Multiple scan results
# Stop scan
# Stop advertisement
# Service discovery
# Disconnection command
Test using API (fail):
// Connection (after scan results and advertisement stopped)
response = EZS_SEND_AND_WAIT(ezs_cmd_gap_connect(
0x0006, // Connection interval
0x0000, // Slave latency
0x0064, // Supervision timeout
0x0100, // Scan interval
0x0100, // Scan window
0x000A // Scan timeout
// ... response code is OK.
// ... wait for gap_connected event before starting service discovery
// Service discovery
response = EZS_SEND_AND_WAIT(ezs_cmd_gattc_discover_services(
// Result code in response packet is 0x0108 “Operation not permitted”