I am using the TI BLE HCI Vendor Specific HCI Guide to attempt communication with the CC2540 using the BlueZ 5.2 hcitool cmd. I can successfully connect and disconnect from the CC2540.
Hcitool cmd 0x08 0x0d 0x04 0x00 0x04 0x00 0x00 0x00 0xfd 0x0f 0xa0 0xe5 0xc5 0x78 0x00 0x0f 0x00 0x0f 0x00 0x00 0x00 0x80 0x0c 0x01 0x00 0x01 0x00 provides a connection to 78:c5:e5:a0:0f:fd and returns a connection handle of 1025.
Hcitool cmd 0x01 0x06 0x01 0x04 0x16 disconnects from connection handle 1025.
I now want to read the GATT_DEVICE_NAME_UUID contents at handle 0x0003. I interpret this to be either a GATT_ReadCharValue (0xFD8A) or a ATT_ReadReq (0xFD0A). The request parameters format includes just the UUID handle value (0x0003). My translation of this command for hcitool is as follows:
GATT_ReadCharValue: hcitool cmd 0x3f 0x018a 0x03 0x00 (or)
ATT_ReadReq: hcitool cmd 0x3f 0x10a 0x03 0x00
Neither of these commands retrieve the device name. Neither is the request picked up by the Smart RF Sniffer which means the message format is probably wrong. When I use btool, the retrieval works correctly with the following information:
[319] : <Tx> - 11:19:58.992
-Type : 0x01 (Command)
-Opcode : 0xFD8A (GATT_ReadCharValue)
-Data Length : 0x04 (4) byte(s)
ConnHandle : 0x0000 (0)
Handle : 0x0003 (3)
Dump(Tx):
01 8A FD 04 00 00 03 00
------------------------------------------------------------------------------------------------------------------------
[320] : <Rx> - 11:19:59.038
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x06 (6) bytes(s)
Event : 0x067F (GAP_HCI_ExtentionCommandStatus)
Status : 0x00 (Success)
OpCode : 0xFD8A (GATT_ReadCharValue)
DataLength : 0x00 (0)
Dump(Rx):
04 FF 06 7F 06 00 8A FD 00
------------------------------------------------------------------------------------------------------------------------
[321] : <Rx> - 11:19:59.163
-Type : 0x04 (Event)
-EventCode : 0xFF (HCI_LE_ExtEvent)
-Data Length : 0x17 (23) bytes(s)
Event : 0x050B (ATT_ReadRsp)
Status : 0x00 (Success)
ConnHandle : 0x0000 (0)
PduLen : 0x11 (17)
Value : 48 65 61 72 74 20 52 61 74 65 20 53 65 6E 73 6F 72
Dump(Rx):
04 FF 17 0B 05 00 00 00 11 48 65 61 72 74 20 52
61 74 65 20 53 65 6E 73 6F 72
I assume my hcitool cmd format is incorrect. Can someone provides assistance so that I can correctly use the hcitool for communication with the cc2540 using BlueZ?