summaryrefslogtreecommitdiff
path: root/monitor/att.c
Commit message (Collapse)AuthorAgeFilesLines
* monitor/att: Attempt to insert discovered attributesLuiz Augusto von Dentz2023-05-051-192/+344
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This attempts to insert discovered attributes into monitor gatt_db instance if their respective discover procedures are used which enables decoding traces injected by user via unit testing: > sudo unit/test-bap -m -s "34 = test-bap: BAP/UCL/SCC/BV-034-C [UCL SNK Config Codec, VS] - run > test-bap: User Data RX ATT: Read Request (0x0a) len 2 Handle: 0x0003 Type: Sink PAC (0x2bc9) < test-bap: User Data TX ATT: Read Response (0x0b) len 8 Handle: 0x0003 Type: Sink PAC (0x2bc9) Value: 01ff010001000000 Number of PAC(s): 1 PAC #0: Codec: Vendor specific (0xff) Codec Company ID: Nokia Mobile Phones (0x0001) Codec Vendor ID: 0x0001 > test-bap: User Data RX ATT: Read Request (0x0a) len 2 Handle: 0x0006 Type: Sink Audio Locations (0x2bca) < test-bap: User Data TX ATT: Read Response (0x0b) len 4 Handle: 0x0006 Type: Sink Audio Locations (0x2bca) Value: 03000000 Location: 0x00000003 Front Left (0x00000001) Front Right (0x00000002) > test-bap: User Data RX ATT: Read Request (0x0a) len 2 Handle: 0x0009 Type: Source PAC (0x2bcb) < test-bap: User Data TX ATT: Read Response (0x0b) len 8 Handle: 0x0009 Type: Source PAC (0x2bcb) Value: 01ff010001000000 Number of PAC(s): 1 PAC #0: Codec: Vendor specific (0xff) Codec Company ID: Nokia Mobile Phones (0x0001) Codec Vendor ID: 0x0001 > test-bap: User Data RX ATT: Read Request (0x0a) len 2 Handle: 0x000c Type: Source Audio Locations (0x2bcc) < test-bap: User Data TX ATT: Read Response (0x0b) len 4 Handle: 0x000c Type: Source Audio Locations (0x2bcc) Value: 03000000 Location: 0x00000003 Front Left (0x00000001) Front Right (0x00000002) > test-bap: User Data RX ATT: Read Request (0x0a) len 2 Handle: 0x000f Type: Available Audio Contexts (0x2bcd) < test-bap: User Data TX ATT: Read Response (0x0b) len 4 Handle: 0x000f Type: Available Audio Contexts (0x2bcd) Value: ff0f0e00 Sink Context: 0x0fff Unspecified (0x0001) Conversational (0x0002) Media (0x0004) Game (0x0008) Instructional (0x0010) Voice Assistants (0x0020) Live (0x0040) Sound Effects (0x0080) Notifications (0x0100) Ringtone (0x0200) Alerts (0x0400) Emergency alarm (0x0800) Source Context: 0x000e Conversational (0x0002) Media (0x0004) Game (0x0008) > test-bap: User Data RX ATT: Read Request (0x0a) len 2 Handle: 0x0012 Type: Supported Audio Contexts (0x2bce) < test-bap: User Data TX ATT: Read Response (0x0b) len 4 Handle: 0x0012 Type: Supported Audio Contexts (0x2bce) Value: ff0f0e00 Sink Context: 0x0fff Unspecified (0x0001) Conversational (0x0002) Media (0x0004) Game (0x0008) Instructional (0x0010) Voice Assistants (0x0020) Live (0x0040) Sound Effects (0x0080) Notifications (0x0100) Ringtone (0x0200) Alerts (0x0400) Emergency alarm (0x0800) Source Context: 0x000e Conversational (0x0002) Media (0x0004) Game (0x0008) > test-bap: User Data RX ATT: Read Request (0x0a) len 2 Handle: 0x0016 Type: Sink ASE (0x2bc4) < test-bap: User Data TX ATT: Read Response (0x0b) len 2 Handle: 0x0016 Type: Sink ASE (0x2bc4) Value: 0100 ASE ID: 1 State: Idle (0x00) > test-bap: User Data RX ATT: Write Request (0x12) len 4 Handle: 0x0017 Data: 0100 < test-bap: User Data TX ATT: Write Response (0x13) len 0 > test-bap: User Data RX ATT: Read Request (0x0a) len 2 Handle: 0x0019 Type: Sink ASE (0x2bc4) < test-bap: User Data TX ATT: Read Response (0x0b) len 2 Handle: 0x0019 Type: Sink ASE (0x2bc4) Value: 0200 ASE ID: 2 State: Idle (0x00) > test-bap: User Data RX ATT: Write Request (0x12) len 4 Handle: 0x001a Data: 0100 < test-bap: User Data TX ATT: Write Response (0x13) len 0 > test-bap: User Data RX ATT: Read Request (0x0a) len 2 Handle: 0x001c Type: Source ASE (0x2bc5) < test-bap: User Data TX ATT: Read Response (0x0b) len 2 Handle: 0x001c Type: Source ASE (0x2bc5) Value: 0300 ASE ID: 3 State: Idle (0x00) > test-bap: User Data RX ATT: Write Request (0x12) len 4 Handle: 0x001d Data: 0100 < test-bap: User Data TX ATT: Write Response (0x13) len 0 > test-bap: User Data RX ATT: Read Request (0x0a) len 2 Handle: 0x001f Type: Source ASE (0x2bc5) < test-bap: User Data TX ATT: Read Response (0x0b) len 2 Handle: 0x001f Type: Source ASE (0x2bc5) Value: 0400 ASE ID: 4 State: Idle (0x00) > test-bap: User Data RX ATT: Write Request (0x12) len 4 Handle: 0x0020 Data: 0100 < test-bap: User Data TX ATT: Write Response (0x13) len 0 > test-bap: User Data RX ATT: Write Request (0x12) len 4 Handle: 0x0023 Data: 0100 < test-bap: User Data TX ATT: Write Response (0x13) len 0 > test-bap: User Data RX ATT: Write Command (0x52) len 13 Handle: 0x0022 Type: ASE Control Point (0x2bc6) Data: 0101030202ff0100010000 Opcode: Codec Configuration (0x01) Number of ASE(s): 1 ASE: #0 ASE ID: 0x03 Target Latency: Balance Latency/Reliability (0x02) PHY: 0x02 LE 2M PHY (0x02) Codec: Vendor specific (0xff) Codec Company ID: Nokia Mobile Phones (0x0001) Codec Vendor ID: 0x0001 < test-bap: User Data TX ATT: Handle Value Notification (0x1b) len 7 Handle: 0x0022 Type: ASE Control Point (0x2bc6) Data: 0101030000 Opcode: Codec Configuration (0x01) Number of ASE(s): 1 ASE: #0 ASE ID: 0x03 ASE Response Code: Success (0x00) ASE Response Reason: None (0x00) < test-bap: User Data TX ATT: Handle Value Notification (0x1b) len 27 Handle: 0x001c Type: Source ASE (0x2bc5) Data: 03010102010a00204e00409c00204e00409c00ff0100010000 ASE ID: 3 State: Codec Configured (0x01) Framing: Unframed PDUs not supported (0x01) PHY: 0x02 LE 2M PHY preffered (0x02) RTN: 1 Max Transport Latency: 10 Presentation Delay Min: 20000 us Presentation Delay Max: 40000 us Preferred Presentation Delay Min: 20000 us Preferred Presentation Delay Max: 40000 us Codec: Vendor specific (0xff) Codec Company ID: Nokia Mobile Phones (0x0001) Codec Vendor ID: 0x0001
* monitor/att: Add decoding support for BASSIulia Tanasescu2023-04-051-2/+462
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds decoding support for BASS attributes: > ACL Data RX: Handle 0 flags 0x02 dlen 7 ATT: Read Request (0x0a) len 2 Handle: 0x003a Type: Broadcast Receive State (0x2bc8) < ACL Data TX: Handle 0 flags 0x00 dlen 45 ATT: Read Response (0x0b) len 40 Handle: 0x003a Type: Broadcast Receive State (0x2bc8) Value: 0100f2698be807c0013a6501020101000000000403020400 Source_ID: 1 Source_Address_Type: 0 Source_Address: C0:07:E8:8B:69:F2 Source_Adv_SID: 1 Broadcast_ID: 0x01653a PA_Sync_State: Synchronized to PA BIG_Encryption: Broadcast_Code required Num_Subgroups: 1 Subgroup #0: BIS_Sync State: 0x00000000 Metadata #0: len 0x03 type 0x02 Metadata: 0400 > ACL Data RX: Handle 0 flags 0x02 dlen 7 ATT: Read Request (0x0a) len 2 Handle: 0x003d Type: Broadcast Receive State (0x2bc8) < ACL Data TX: Handle 0 flags 0x00 dlen 5 ATT: Read Response (0x0b) len 0 Handle: 0x003d Type: Broadcast Receive State (0x2bc8) Value: Empty characteristic > ACL Data RX: Handle 0 flags 0x02 dlen 8 ATT: Write Request (0x12) len 3 Handle: 0x0040 Type: Broadcast Audio Scan Control Point (0x2bc7) Data: 00 Opcode: Remote Scan Stopped (0x00) < ACL Data TX: Handle 0 flags 0x00 dlen 9 ATT: Error Response (0x01) len 4 Write Request (0x12) Handle: 0x0040 Error: Reserved (0x80) > ACL Data RX: Handle 0 flags 0x02 dlen 8 ATT: Write Request (0x12) len 3 Handle: 0x0040 Type: Broadcast Audio Scan Control Point (0x2bc7) Data: 01 Opcode: Remote Scan Started (0x01) < ACL Data TX: Handle 0 flags 0x00 dlen 9 ATT: Error Response (0x01) len 4 Write Request (0x12) Handle: 0x0040 Error: Reserved (0x80) > ACL Data RX: Handle 0 flags 0x01 dlen 5 ATT: Write Request (0x12) len 27 Handle: 0x0040 Type: Broadcast Audio Scan Control Point (0x2bc7) Data: 0200f2698be807c0013a650100ffff01000000000403020400 Opcode: Add Source (0x02) Source_Address_Type: 0 Source_Address: C0:07:E8:8B:69:F2 Source_Adv_SID: 1 Broadcast_ID: 0x01653a PA_Sync_State: Do not synchronize to PA PA_Interval: 0xffff Num_Subgroups: 1 Subgroup #0: BIS_Sync State: 0x00000000 Metadata #0: len 0x03 type 0x02 Metadata: 0400 < ACL Data TX: Handle 0 flags 0x00 dlen 9 ATT: Error Response (0x01) len 4 Write Request (0x12) Handle: 0x0040 Error: Reserved (0x80) > ACL Data RX: Handle 0 flags 0x02 dlen 22 ATT: Write Request (0x12) len 17 Handle: 0x0040 Type: Broadcast Audio Scan Control Point (0x2bc7) Data: 030102780001000000000403040400 Opcode: Modify Source (0x03) Source_ID: 1 PA_Sync_State: Synchronize to PA - PAST not available PA_Interval: 0x0078 Num_Subgroups: 1 Subgroup #0: BIS_Sync State: 0x00000000 Metadata #0: len 0x03 type 0x04 Metadata: 0400 < ACL Data TX: Handle 0 flags 0x00 dlen 9 ATT: Error Response (0x01) len 4 Write Request (0x12) Handle: 0x0040 Error: Reserved (0x80) > ACL Data RX: Handle 0 flags 0x02 dlen 25 ATT: Write Request (0x12) len 20 Handle: 0x0040 Type: Broadcast Audio Scan Control Point (0x2bc7) Data: 0401b803eac6afbb65a25a41f15305680201 Opcode: Set Broadcast_Code (0x04) Source_ID: 1 Broadcast_Code: b803eac6afbb65a25a41f15305680201 < ACL Data TX: Handle 0 flags 0x00 dlen 5 ATT: Write Response (0x13) len 0 < ACL Data TX: Handle 0 flags 0x00 dlen 33 ATT: Handle Multiple Value Notification (0x23) len 28 Length: 0x0018 Handle: 0x003a Type: Broadcast Receive State (0x2bc8) Data: 0100f2698be807c0013a6501020201000000000403020400 Source_ID: 1 Source_Address_Type: 0 Source_Address: C0:07:E8:8B:69:F2 Source_Adv_SID: 1 Broadcast_ID: 0x01653a PA_Sync_State: Synchronized to PA BIG_Encryption: Decrypting Num_Subgroups: 1 Subgroup #0: BIS_Sync State: 0x00000000 Metadata #0: len 0x03 type 0x02 Metadata: 0400 > ACL Data RX: Handle 0 flags 0x02 dlen 9 ATT: Write Request (0x12) len 4 Handle: 0x0040 Type: Broadcast Audio Scan Control Point (0x2bc7) Data: 0501 Opcode: Remove Source (0x05) Source_ID: 1 < ACL Data TX: Handle 0 flags 0x00 dlen 9 ATT: Error Response (0x01) len 4 Write Request (0x12) Handle: 0x0040 Error: Reserved (0x80)
* monitor/att: Fix not loading gatt_db for devices using RPALuiz Augusto von Dentz2023-03-271-1/+7
| | | | | | Device using RPA have its storage using its identity address so this uses keys_resolve_identity to attempt to resolve the destination address instead of always using the connection address.
* monitor/att: Print value when printing descriptorsLuiz Augusto von Dentz2023-03-271-0/+52
| | | | | | | | | | | | This prints the value attribute information when print attribute descriptors: < ACL Data TX: Handle 3585 flags 0x00 dlen 9 ATT: Write Request (0x12) len 4 Handle: 0x002c Type: Client Characteristic Configuration (0x2902) Value Handle: 0x002b Type: Battery Level (0x2a19) Data: 0100 Notification (0x01)
* monitor: Fix printing Signed Write CommandSimon Mikuda2023-03-231-2/+2
| | | | | | | | | | Data field were print twice (1 time incorrectly): > ACL Data RX: Handle 64 flags 0x02 dlen 19 ATT: Signed Write Command (0xd2) len 14 Handle: 0x006f Type: Vendor specific (f7debc9a-7856-3412-7856-341278563412) Data: 0800000087f303c224516133 Data: Signature: 0800000087f303c224516133
* monitor: Fix crash when there is no write handlerSimon Mikuda2023-03-231-1/+1
|
* monitor/att: Fix ASE frequency valuesLuiz Augusto von Dentz2023-02-141-9/+9
| | | | This fixes the printed hex value of some of the frequencies.
* monitor/att: Fix Set Member Lock decodingMarcin Kraglak2023-01-301-2/+2
| | | | | | | According to CSIS specification v1.0.1: "Allowed values for the Set Member Lock characteristic are Unlocked (corresponding to the numeric value 0x01) and Locked (corresponding to the numeric value 0x02); all other values are RFU".
* monitor/att: Add decoding support for CSIPSathish Narasimman2022-12-201-0/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds decoding support for CSIS attributes: > ACL Data RX: Handle 3585 flags 0x02 dlen 7 ATT: Read Request (0x0a) len 2 Handle: 0x0017 Type: Set Identity Resolving Key (0x2b84) < ACL Data TX: Handle 3585 flags 0x00 dlen 22 ATT: Read Response (0x0b) len 17 Value: 01761fae703ed681f0c50b34155b6434fb Handle: 0x0017 Type: Set Identity Resolving Key (0x2b84) SIRK: 01761fae703ed681f0c50b34155b6434fb > ACL Data RX: Handle 3585 flags 0x02 dlen 7 ATT: Read Request (0x0a) len 2 Handle: 0x001b Type: Set Member Lock (0x2b86) < ACL Data TX: Handle 3585 flags 0x00 dlen 6 ATT: Read Response (0x0b) len 1 Value: 01 Handle: 0x001b Type: Set Member Lock (0x2b86) Locked (0x01) > ACL Data RX: Handle 3585 flags 0x02 dlen 7 ATT: Read Request (0x0a) len 2 Handle: 0x001e Type: Set Member Rank (0x2b87) < ACL Data TX: Handle 3585 flags 0x00 dlen 6 ATT: Read Response (0x0b) len 1 Value: 01 Handle: 0x001e Type: Set Member Rank (0x2b87) Rank: 0x01
* monitor/att: Fix crash when accessing packet_connLuiz Augusto von Dentz2022-12-021-1/+8
| | | | | | | This fixes the following crash: :monitor/att.c:2697:11: runtime error: member access within null pointer of type 'struct att_conn_data'
* monitor/att: Fix not dequeing att_read on error responseLuiz Augusto von Dentz2022-11-151-51/+58
| | | | | | If a read/read by type fails it needs to be dequeued otherwise it can cause the next operation of the same type to return the wrong request and possible decoding as if it was a different attribute type.
* monitor/att: Add support for decoding Characteristic DeclarationLuiz Augusto von Dentz2022-11-041-0/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds supports for decoding the so called Characteristic Declaration (0x2803): > ACL Data RX: Handle 3585 flags 0x02 dlen 76 ATT: Read By Type Response (0x09) len 71 Attribute data length: 7 Attribute data list: 10 entries Handle: 0x0002 Value: 200300052a Properties: 0x20 Indicate (0x20) Value Handle: 0x0003 Value UUID: Service Changed (0x2a05) Handle: 0x0015 Value: 021600002a Properties: 0x02 Read (0x02) Value Handle: 0x0016 Value UUID: Device Name (0x2a00) Handle: 0x0017 Value: 021800012a Properties: 0x02 Read (0x02) Value Handle: 0x0018 Value UUID: Appearance (0x2a01) Handle: 0x0019 Value: 021a00a62a Properties: 0x02 Read (0x02) Value Handle: 0x001a Value UUID: Central Address Resolution (0x2aa6) Handle: 0x0029 Value: 102a00372a Properties: 0x10 Notify (0x10) Value Handle: 0x002a Value UUID: Heart Rate Measurement (0x2a37) Handle: 0x002c Value: 022d00382a Properties: 0x02 Read (0x02) Value Handle: 0x002d Value UUID: Body Sensor Location (0x2a38) Handle: 0x002e Value: 082f00392a Properties: 0x08 Write (0x08) Value Handle: 0x002f Value UUID: Heart Rate Control Point (0x2a39) Handle: 0x0031 Value: 0a32008a2a Properties: 0x0a Read (0x02) Write (0x08) Value Handle: 0x0032 Value UUID: First Name (0x2a8a) Handle: 0x0033 Value: 0a3400902a Properties: 0x0a Read (0x02) Write (0x08) Value Handle: 0x0034 Value UUID: Last Name (0x2a90) Handle: 0x0035 Value: 0a36008c2a Properties: 0x0a Read (0x02) Write (0x08) Value Handle: 0x0036 Value UUID: Gender (0x2a8c)
* monitor/att: Add handler support for Read by TypeLuiz Augusto von Dentz2022-11-041-58/+142
| | | | | This adds handler support for Read by Type so it can further decode the values when the procedure is used.
* monitor/att: Revert treating Notification/Indication as a requestLuiz Augusto von Dentz2022-10-181-1/+1
| | | | | | | | | | Notification/Indication shall be treated as response (rsp=true) so the correct database is used: > ACL Data RX: Handle 3585 flags 0x02 dlen 14 ATT: Handle Value Notification (0x1b) len 9 Handle: 0x002a Type: Report (0x2a4d) Data: 0000feffff0000
* monitor/att: Detect cache changesLuiz Augusto von Dentz2022-10-181-12/+29
| | | | | This attempts to detect if the were any changes on cache files since they were last loaded and then attempt to reload them.
* monitor/att: Add decoding support for GMCSAbhay Maheta2022-10-181-0/+513
| | | | | | | | | | | | | | | | | | | This adds decoding support for GMCS attributes. < ACL Data TX: Handle 3585 flags 0x00 dlen 7 ATT: Read Request (0x0a) len 2 Handle: 0x0056 Type: Media Control Point Opcodes Supported (0x2ba5) > ACL Data RX: Handle 3585 flags 0x02 dlen 9 ATT: Read Response (0x0b) len 4 Value: 33180000 Handle: 0x0056 Type: Media Control Point Opcodes Supported (0x2ba5) Supported Opcodes: 0x00001833 Play (0x00000001) Pause (0x00000002) Stop (0x00000010) Move Relative (0x00000020) Previous Track (0x00000800) Next Track (0x00001000)
* monitor/att: Add decoding support for Volume Control SericeSathish Narasimman2022-09-191-0/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | | This adds decoding support for VCS attributes > ACL Data RX: Handle 3585 flags 0x02 dlen 7 ATT: Read Request (0x0a) len 2 Handle: 0x0017 Type: Volume State (0x2b7d) < ACL Data TX: Handle 3585 flags 0x00 dlen 8 ATT: Read Response (0x0b) len 3 Value: 000000 Handle: 0x0017 Type: Volume State (0x2b7d) Volume Setting: 0 Not Muted: 0 Change Counter: 0 > HCI Event: Number of Completed Packets (0x13) plen 5 Num handles: 1 Handle: 3585 Address: 49:71:FC:C0:66:C6 (Resolvable) Count: 1 > ACL Data RX: Handle 3585 flags 0x02 dlen 7 ATT: Read Request (0x0a) len 2 Handle: 0x001c Type: Volume Flags (0x2b7f) < ACL Data TX: Handle 3585 flags 0x00 dlen 6 ATT: Read Response (0x0b) len 1 Value: 01 Handle: 0x001c Type: Volume Flags (0x2b7f) Volume Falg: 1
* monitor: Fix build error in some targetsLuiz Augusto von Dentz2022-07-051-1/+3
| | | | | | | | This fixes the following error: monitor/att.c: In function 'print_attribute': monitor/att.c:1850:35: error: lvalue required as unary '&' operand print_uuid(label, &cpu_to_le16(uuid->value.u16), 2);
* monitor/att: Add LTV deconding support for PAC/ASELuiz Augusto von Dentz2022-06-161-91/+500
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds decoding support for PAC/ASE attributes: > ACL Data RX: Handle 42 flags 0x02 dlen 31 Channel: 65 len 27 sdu 25 [PSM 39 mode Enhanced Credit (0x81)] {chan 1} ATT: Read Response (0x0b) len 24 Value: 010600000000100301ff0002020302030305041e00f00000 Number of PAC(s): 1 PAC #0: Codec: LC3 (0x06) Codec Specific Capabilities #0: len 0x03 type 0x01 Sampling Frequencies: 0x00ff 8 Khz (0x0001) 11.25 Khz (0x0002) 16 Khz (0x0004) 22.05 Khz (0x0008) 24 Khz (0x0010) 32 Khz (0x0020) 44.1 Khz (0x0040) 48 Khz (0x0080) Codec Specific Capabilities #1: len 0x02 type 0x02 Frame Duration: 0x0003 7.5 ms (0x01) 10 ms (0x02) Codec Specific Capabilities #2: len 0x02 type 0x03 Audio Channel Count: 0x03 1 channel (0x01) 2 channels (0x02) Codec Specific Capabilities #3: len 0x05 type 0x04 Frame Length: 30 (0x001e) - 240 (0x00f0) > ACL Data RX: Handle 42 flags 0x02 dlen 30 Channel: 64 len 26 sdu 24 [PSM 39 mode Enhanced Credit (0x81)] {chan 0} ATT: Write Command (0x52) len 23 Handle: 0x0036 Type: ASE Control Point (0x2bc6) Data: 010101020206000000000a02010302020103042800 Opcode: Codec Configuration (0x01) Number of ASE(s): 1 ASE: #0 ASE ID: 0x01 Target Latency: Balance Latency/Reliability (0x02) PHY: 0x02 LE 2M PHY (0x02) Codec: LC3 (0x06) Codec Specific Configuration #0: len 0x02 type 0x01 Sampling Frequency: 16 Khz (0x03) Codec Specific Configuration #1: len 0x02 type 0x02 Frame Duration: 10 ms (0x01) Codec Specific Configuration #2: len 0x03 type 0x04 Frame Length: 40 (0x0028)
* monitor/att: Add decoding support for PAC Audio ContextLuiz Augusto von Dentz2022-06-161-0/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds decoding support for PAC Audio Context attributes: > ACL Data RX: Handle 42 flags 0x02 dlen 9 Channel: 65 len 5 sdu 3 [PSM 39 mode Enhanced Credit (0x81)] {chan 1} ATT: Read Request (0x0a) len 2 Handle: 0x0026 Type: Supported Audio Contexts (0x2bce) < ACL Data TX: Handle 42 flags 0x00 dlen 11 Channel: 64 len 7 sdu 5 [PSM 39 mode Enhanced Credit (0x81)] {chan 1} ATT: Read Response (0x0b) len 4 Value: ff0f0e00 Handle: 0x0026 Type: Supported Audio Contexts (0x2bce) Sink Context: 0x0fff Unspecified (0x0001) Conversational (0x0002) Media (0x0004) Game (0x0008) Instructional (0x0010) Voice Assistants (0x0020) Live (0x0040) Sound Effects (0x0080) Notifications (0x0100) Ringtone (0x0200) Alerts (0x0400) Emergency alarm (0x0800) Source Context: 0x000e Conversational (0x0002) Media (0x0004) Game (0x0008)
* monitor/att: Add decoding support for PAC Sink/Source LocationLuiz Augusto von Dentz2022-06-161-0/+70
| | | | | | | | | | | | | | | | | This adds decoding support for PAC Sink/Source Location attributes: > ACL Data RX: Handle 42 flags 0x02 dlen 9 Channel: 65 len 5 sdu 3 [PSM 39 mode Enhanced Credit (0x81)] {chan 1} ATT: Read Request (0x0a) len 2 Handle: 0x001a Type: Sink Audio Locations (0x2bca) < ACL Data TX: Handle 42 flags 0x00 dlen 11 Channel: 64 len 7 sdu 5 [PSM 39 mode Enhanced Credit (0x81)] {chan 1} ATT: Read Response (0x0b) len 4 Value: 03000000 Handle: 0x001a Type: Sink Audio Locations (0x2bca) Location: 0x00000003 Front Left (0x00000001) Front Right (0x00000002)
* monitor/att: Print attribute information on ATT_REQ_RSPLuiz Augusto von Dentz2022-06-161-7/+18
| | | | | | | | | | | | | This prints the attribute information on ATT_REQ_RSP to make it easier to identify to which handle the response is for: > ACL Data RX: Handle 42 flags 0x02 dlen 9 Channel: 65 len 5 sdu 3 [PSM 39 mode Enhanced Credit (0x81)] {chan 1} ATT: Read Response (0x0b) len 2 Value: 0300 Handle: 0x0030 Type: Source ASE (0x2bc5) ASE ID: 3 State: Idle (0x00)
* monitor/att: Fix decoding for notificationsLuiz Augusto von Dentz2022-06-131-1/+1
|
* monitor: Stop spamming logs when GATT db cannot be loadedLuiz Augusto von Dentz2022-06-131-5/+1
| | | | | | | This stops calling hci_devba everytime the GATT db needs to be loaded since that causes a raw socket to be open to read back the address pointed by the index, instead this is done only once at assign_handle and store in packet_conn_data.
* monitor/att: Add decoding support for ASE Control PointLuiz Augusto von Dentz2022-05-261-158/+561
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds decoding support for ASE Control Point attribute: > ACL Data RX: Handle 42 flags 0x02 dlen 30 Channel: 64 len 26 sdu 24 [PSM 39 mode Enhanced Credit (0x81)] {chan 1} ATT: Write Command (0x52) len 23 Handle: 0x0030 Type: ASE Control Point (0x2bc6) Data: 010103020206000000000a02010302020103042800 Opcode: Codec Configuration (0x01) Number of ASE(s): 1 ASE: #0 ASE ID: 0x03 Target Latency: Balance Latency/Reliability (0x02) PHY: 0x02 LE 2M PHY (0x02) Codec: LC3 (0x06) Codec Specific Configuration #0: len 0x02 type 0x01 Codec Specific Configuration: 03 Codec Specific Configuration #1: len 0x02 type 0x02 Codec Specific Configuration: 01 Codec Specific Configuration #2: len 0x03 type 0x04 Codec Specific Configuration: 2800 < ACL Data TX: Handle 42 flags 0x00 dlen 55 Channel: 64 len 51 sdu 49 [PSM 39 mode Enhanced Credit (0x81)] {chan 0} ATT: Handle Multiple Value Notification (0x23) len 48 Length: 0x0005 Handle: 0x0030 Type: ASE Control Point (0x2bc6) Data: 0101030000 Opcode: Codec Configuration (0x01) Number of ASE(s): 1 ASE: #0 ASE ID: 0x03 ASE Response Code: Success (0x00) ASE Response Reason: None (0x00) > ACL Data RX: Handle 42 flags 0x02 dlen 27 Channel: 64 len 23 sdu 21 [PSM 39 mode Enhanced Credit (0x81)] {chan 1} ATT: Write Command (0x52) len 20 Handle: 0x0030 Type: ASE Control Point (0x2bc6) Data: 020103000010270000022800020a00409c00 Opcode: QoS Configuration (0x02) Number of ASE(s): 1 ASE: #0 ASE ID: 0x03 CIG ID: 0x00 CIS ID: 0x00 SDU Interval: 10000 usec Framing: Unframed (0x00) PHY: 0x02 LE 2M PHY (0x02) Max SDU: 40 RTN: 2 Max Transport Latency: 10 Presentation Delay: 40000 us < ACL Data TX: Handle 42 flags 0x00 dlen 37 Channel: 64 len 33 sdu 31 [PSM 39 mode Enhanced Credit (0x81)] {chan 0} ATT: Handle Multiple Value Notification (0x23) len 30 Length: 0x0005 Handle: 0x0030 Type: ASE Control Point (0x2bc6) Data: 0201030000 Opcode: QoS Configuration (0x02) Number of ASE(s): 1 ASE: #0 ASE ID: 0x03 ASE Response Code: Success (0x00) ASE Response Reason: None (0x00) > ACL Data RX: Handle 42 flags 0x02 dlen 17 Channel: 64 len 13 sdu 11 [PSM 39 mode Enhanced Credit (0x81)] {chan 1} ATT: Write Command (0x52) len 10 Handle: 0x0030 Type: ASE Control Point (0x2bc6) Data: 0301030403020200 Opcode: Enable (0x03) Number of ASE(s): 1 ASE: #0 ASE ID: 0x03 Metadata #0: len 0x03 type 0x02 Metadata: 0200 < ACL Data TX: Handle 42 flags 0x00 dlen 33 Channel: 64 len 29 sdu 27 [PSM 39 mode Enhanced Credit (0x81)] {chan 0} ATT: Handle Multiple Value Notification (0x23) len 26 Length: 0x0005 Handle: 0x0030 Type: ASE Control Point (0x2bc6) Data: 0301030000 Opcode: Enable (0x03) Number of ASE(s): 1 ASE: #0 ASE ID: 0x03 ASE Response Code: Success (0x00) ASE Response Reason: None (0x00) > ACL Data RX: Handle 42 flags 0x02 dlen 12 Channel: 64 len 8 sdu 6 [PSM 39 mode Enhanced Credit (0x81)] {chan 0} ATT: Write Command (0x52) len 5 Handle: 0x0030 Type: ASE Control Point (0x2bc6) Data: 050101 Opcode: Disable (0x05) Number of ASE(s): 1
* monitor/att: Add decoding support for ASE Sink/SourceLuiz Augusto von Dentz2022-05-261-26/+339
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds decoding support for ASE Sink/Source attributes: > ACL Data RX: Handle 42 flags 0x02 dlen 9 Channel: 65 len 5 sdu 3 [PSM 39 mode Enhanced Credit (0x81)] {chan 0} ATT: Read Request (0x0a) len 2 Handle: 0x002a Type: Sink ASE (0x2bc4) < ACL Data TX: Handle 42 flags 0x00 dlen 9 Channel: 64 len 5 sdu 3 [PSM 39 mode Enhanced Credit (0x81)] {chan 0} ATT: Read Response (0x0b) len 2 Value: 0300 ASE ID: 1 State: Idle (0x00) < ACL Data TX: Handle 42 flags 0x00 dlen 55 Channel: 64 len 51 sdu 49 [PSM 39 mode Enhanced Credit (0x81)] {chan 0} ATT: Handle Multiple Value Notification (0x23) len 48 Length: 0x0023 Handle: 0x0024 Type: Sink ASE (0x2bc4) Data: 01010000000a00204e00409c00204e00409c0006000000000a02010302020103042800 ASE ID: 1 State: Codec Configured (0x01) Framing: Unframed PDUs supported (0x00) PHY: 0x00 RTN: 0 Max Transport Latency: 10 Presentation Delay Min: 20000 us Presentation Delay Max: 40000 us Preferred Presentation Delay Min: 20000 us Preferred Presentation Delay Max: 40000 us Codec: LC3 (0x06) Codec Specific Configuration #0: len 0x02 type 0x01 Codec Specific Configuration: 03 Codec Specific Configuration #1: len 0x02 type 0x02 Codec Specific Configuration: 01 Codec Specific Configuration #2: len 0x03 type 0x04 Codec Specific Configuration: 2800 < ACL Data TX: Handle 42 flags 0x00 dlen 37 Channel: 64 len 33 sdu 31 [PSM 39 mode Enhanced Credit (0x81)] {chan 0} ATT: Handle Multiple Value Notification (0x23) len 30 Length: 0x0011 Handle: 0x0024 Type: Sink ASE (0x2bc4) Data: 0102000010270000022800020a00409c00 ASE ID: 1 State: QoS Configured (0x02) CIG ID: 0x00 CIS ID: 0x00 SDU Interval: 10000 usec Framing: Unframed (0x00) PHY: 0x02 LE 2M PHY (0x02) Max SDU: 40 RTN: 2 Max Transport Latency: 10 Presentation Delay: 40000 us < ACL Data TX: Handle 42 flags 0x00 dlen 33 Channel: 64 len 29 sdu 27 [PSM 39 mode Enhanced Credit (0x81)] {chan 0} ATT: Handle Multiple Value Notification (0x23) len 26 Length: 0x000d Handle: 0x002a Type: Source ASE (0x2bc5) Data: 03030000060304030202000000 ASE ID: 3 State: Enabling (0x03) CIG ID: 0x00 CIS ID: 0x00 Metadata #0: len 0x03 type 0x04 Metadata: 0302 Metadata #1: len 0x02 type 0x00 < ACL Data TX: Handle 42 flags 0x00 dlen 39 Channel: 64 len 35 sdu 33 [PSM 39 mode Enhanced Credit (0x81)] {chan 0} ATT: Handle Multiple Value Notification (0x23) len 32 Length: 0x000d Handle: 0x002a Type: Source ASE (0x2bc5) Data: 03040000060304030202000000 ASE ID: 3 State: Streaming (0x04) CIG ID: 0x00 CIS ID: 0x00 Metadata #0: len 0x03 type 0x04 Metadata: 0302 Metadata #1: len 0x02 type 0x00 < ACL Data TX: Handle 42 flags 0x00 dlen 33 Channel: 64 len 29 sdu 27 [PSM 39 mode Enhanced Credit (0x81)] {chan 0} ATT: Handle Multiple Value Notification (0x23) len 26 Length: 0x000d Handle: 0x002a Type: Source ASE (0x2bc5) Data: 03050000060304030202000000 ASE ID: 3 State: Disabling (0x05) CIG ID: 0x00 CIS ID: 0x00 Metadata #0: len 0x03 type 0x04 Metadata: 0302 Metadata #1: len 0x02 type 0x00
* monitor/att: Add decoding support for PAC Sink/SourceLuiz Augusto von Dentz2022-05-261-0/+92
| | | | | | | | | | | | | | | | | | | | | | | | | This adds decoding support for PAC Sink/Source attributes: < ACL Data TX: Handle 42 flags 0x00 dlen 9 Channel: 64 len 5 sdu 3 [PSM 39 mode Enhanced Credit (0x81)] {chan 0} ATT: Read Request (0x0a) len 2 Handle: 0x0017 Type: Sink PAC (0x2bc9) > ACL Data RX: Handle 42 flags 0x02 dlen 31 Channel: 65 len 27 sdu 25 [PSM 39 mode Enhanced Credit (0x81)] {chan 0} Value: 010600000000100301ff0002020302030305041e00f00000 Number of PAC(s): 1 PAC #0: Codec: LC3 (0x06) Codec Specific Configuration #0: len 0x03 type 0x01 Codec Specific Configuration: ff00 Codec Specific Configuration #1: len 0x02 type 0x02 Codec Specific Configuration: 03 Codec Specific Configuration #2: len 0x02 type 0x03 Codec Specific Configuration: 03 Codec Specific Configuration #3: len 0x05 type 0x04 Codec Specific Configuration: 1e00f000
* monitor/att: Simplify CCC decodersLuiz Augusto von Dentz2022-05-261-22/+13
| | | | | This simplify callbacks moving the decoding of the value to print_ccc_value.
* monitor/att: Fix parsing of notificationsLuiz Augusto von Dentz2022-05-251-0/+10
| | | | | | | If there are multiple notifications in the same frame the callback may alter it when using l2cap_frame_pull helpers, so instead this passes a cloned frame with just the expected length so callbacks cannot alter original frame.
* monitor/att: Attempt to reload if database is emptyLuiz Augusto von Dentz2022-05-251-21/+26
| | | | | If database is empty attempt to reload since the daemon may have updated its cache in the meantime.
* monitor/att: Fix parsing of Notify MutipleLuiz Augusto von Dentz2022-05-201-2/+0
| | | | | Notify Multiple was parsing handle multiple times causing the length to be assumed to be a handle.
* monitor/att: Fix not matching read frame directionLuiz Augusto von Dentz2022-05-201-3/+11
| | | | | There could be read frames pending on both direction so this ensures the direction is matched properly.
* monitor/att: Fix treating Notification/Indication as a requestLuiz Augusto von Dentz2022-05-201-2/+2
| | | | | Notification/Indication shall be treated as response so the correct database is used.
* monitor/att: Fix not removing read from queueLuiz Augusto von Dentz2022-05-201-2/+4
| | | | | The code was using queue_find instead of queue_remove_if so follow up read wouldn't match the attribute properly.
* monitor/att: Add decoding support for CCCLuiz Augusto von Dentz2022-05-191-18/+223
| | | | | | | | | | | | | | | | | This adds decoding support for CCC so its value can be decoded: < ACL Data TX: Handle 3585 flags 0x00 dlen 7 ATT: Read Request (0x0a) len 2 Handle: 0x002c Type: Client Characteristic Configuration (0x2902) > ACL Data RX: Handle 3585 flags 0x02 dlen 6 ATT: Read Response (0x0b) len 1 Value: 01 Notification (0x01) < ACL Data TX: Handle 3585 flags 0x00 dlen 9 ATT: Write Request (0x12) len 4 Handle: 0x002c Type: Client Characteristic Configuration (0x2902) Data: 0100 Notification (0x01)
* monitor/att: Decode attribute typeLuiz Augusto von Dentz2022-05-181-12/+133
| | | | | | | | | This attempt to decode the attribute type if its gatt_db can be loaded: < ACL Data TX: Handle 3585 flags 0x00 dlen 9 ATT: Write Request (0x12) len 4 Handle: 0x000b Type: Client Characteristic Configuration (0x2902) Data: 0200
* monitor: Move ATT decoding function into its own fileLuiz Augusto von Dentz2022-05-181-0/+642
This moves ATT decoding function from l2cap.c to att.c.