$npx -y skills add easyzoom/aix-skills --skill ble-gatt-integrationUse when integrating, designing, or debugging BLE GATT services, characteristics, descriptors, MTU, notifications, indications, pairing, connection parameters, or throughput
| 1 | # BLE GATT Integration |
| 2 | |
| 3 | ## Overview |
| 4 | |
| 5 | Use this skill to debug BLE GATT by separating advertising, connection, |
| 6 | discovery, attributes, permissions, MTU, security, and data flow. GATT failures |
| 7 | are often permission or state-machine mismatches, not radio failures. |
| 8 | |
| 9 | ## When To Use |
| 10 | |
| 11 | Use this skill when: |
| 12 | |
| 13 | - The user is creating or debugging BLE services, characteristics, descriptors, |
| 14 | notifications, indications, reads, writes, or subscriptions. |
| 15 | - The issue involves missing services, write failures, CCCD problems, MTU, data |
| 16 | truncation, pairing, bonding, connection parameters, or low throughput. |
| 17 | - The stack is Zephyr, ESP-IDF, nRF Connect SDK, NimBLE, BlueZ, Android, iOS, or |
| 18 | a vendor BLE SDK. |
| 19 | |
| 20 | Do not use this skill when the device cannot advertise or connect at all. Start |
| 21 | with platform-specific radio and controller bring-up first. |
| 22 | |
| 23 | ## First Questions |
| 24 | |
| 25 | Ask for: |
| 26 | |
| 27 | - BLE stack, device role, central/client app, peripheral firmware, and logs. |
| 28 | - Advertising data, connection status, service UUIDs, characteristic UUIDs, and |
| 29 | properties. |
| 30 | - Attribute permissions, security level, pairing/bonding state, and CCCD state. |
| 31 | - MTU, connection interval, PHY, data length extension, and payload size. |
| 32 | - Sniffer trace or client error if available. |
| 33 | |
| 34 | ## Debug Workflow |
| 35 | |
| 36 | 1. Prove discovery. |
| 37 | Confirm advertising, connection, primary service discovery, and attribute |
| 38 | handles using a known BLE client. |
| 39 | |
| 40 | 1. Check attribute contract. |
| 41 | Verify UUIDs, properties, permissions, descriptors, lengths, and endian/unit |
| 42 | conventions. |
| 43 | |
| 44 | 1. Separate reads, writes, and subscriptions. |
| 45 | Test read, write-with-response, write-without-response, notify, and indicate |
| 46 | one at a time. |
| 47 | |
| 48 | 1. Validate security. |
| 49 | Match permissions to pairing, bonding, encryption, MITM, and key storage. |
| 50 | |
| 51 | 1. Tune transport parameters. |
| 52 | For throughput, check MTU, connection interval, PHY, data length, buffering, |
| 53 | and application pacing. |
| 54 | |
| 55 | 1. Test client diversity. |
| 56 | Compare behavior on at least one generic tool and the real Android/iOS/client |
| 57 | app. |
| 58 | |
| 59 | ## Common Failures |
| 60 | |
| 61 | - Characteristic lacks the property needed by the client operation. |
| 62 | - CCCD is not enabled before notifications are sent. |
| 63 | - Attribute requires encryption but the client is not paired or bonded. |
| 64 | - Payload exceeds negotiated MTU minus ATT overhead. |
| 65 | - Indications are sent before the previous confirmation arrives. |
| 66 | - Android/iOS cached an old GATT table after firmware changed. |
| 67 | |
| 68 | ## Verification |
| 69 | |
| 70 | Before claiming BLE GATT works: |
| 71 | |
| 72 | - State stack, role, service/characteristic UUIDs, permissions, and MTU. |
| 73 | - Confirm discovery and each required operation with logs or a client trace. |
| 74 | - Confirm security and bonding behavior if protected attributes are used. |
| 75 | - Confirm throughput parameters if performance is part of the requirement. |
| 76 | |
| 77 | ## Example |
| 78 | |
| 79 | User: |
| 80 | |
| 81 | ```text |
| 82 | BLE notify 开了但手机收不到数据。 |
| 83 | ``` |
| 84 | |
| 85 | Agent: |
| 86 | |
| 87 | 1. Checks characteristic properties, CCCD subscription, and connection state. |
| 88 | 1. Verifies MTU and payload length. |
| 89 | 1. Uses a generic BLE client before debugging the mobile app. |