I'm using simplelink_cc13x2_26x2_sdk_5_20_00_52.A.
I'm trying to make my TI Launchpad send periodic advertising packets using BTool.
This is how I start:
1.) I'm sending a HCIExt_ResetSystemCmd command.
2.) I'm initializing my TI Launchpad as a Peripheral using GAP_DeviceInit.
3.) I'm calling a GAPAdv_create command with propConnectable = Disable, propScannable = Disable and propLegacy = Disable, in order for GAPAdv_SetPeriodicAdvEnable not to fail when calling it.
4.) I'm sending GAPAdv_SetPeriodicAdvParams with the default options provided by BTool, then GAPAdv_setPeriodicAdvData with PayloadLength = 4 and, finally, GAPAdv_SetPeriodicAdvEnable.
Everything seems to work fine, and every response I receive in the log is SUCCESS. The problem is, when trying to scan for the device with my phone (using nRF Connect), I can't find my Launchpad.
What I managed to do was also send the GAPAdv_enable command after all the 4 steps mentioned above. This allowed the Launchpad to be discovered by my phone, as seen in the picture below. Still, I can only see the periodic advertising interval, only after I expand the properties of the device. The "main" advertising interval is 104 ms, while I only wanted periodic advertising data to be sent (the 7.5 ms below).
I've also provided a log with the commands I sent, in order to achieve the result above (the 4 steps + GAPAdv_enable).
[1] : <Tx> - 01:53:57.231 -Type : 0x01 (Command) -OpCode : 0xFC1D (HCIExt_ResetSystemCmd) -Data Length : 0x01 (1) byte(s) Type : 0x00 (0) (Chip Reset) Dump(Tx): 0000:01 1D FC 01 00 ..... -------------------------------------------------------------------- [2] : <Rx> - 01:53:57.262 -Type : 0x04 (Event) -EventCode : 0x00FF (HCI_LE_ExtEvent) -Data Length : 0x05 (5) bytes(s) Event : 0x041D (1053) (HCIExt_ResetSystemCmdDone) Status : 0x00 (0) (SUCCESS) CmdOpCode : 0xFC1D (HCIExt_ResetSystemCmd) Dump(Rx): 0000:04 FF 05 1D 04 00 1D FC ........ -------------------------------------------------------------------- [3] : <Tx> - 01:54:04.051 -Type : 0x01 (Command) -OpCode : 0xFE00 (GAP_DeviceInit) -Data Length : 0x08 (8) byte(s) ProfileRole : 0x04 (4) ( Peripheral) AddrMode : 0x00 (0) (ADDRMODE_PUBLIC) RandomAddr : 00:00:00:00:00:00 Dump(Tx): 0000:01 00 FE 08 04 00 00 00 00 00 00 00 ............ -------------------------------------------------------------------- [4] : <Rx> - 01:54:04.073 -Type : 0x04 (Event) -EventCode : 0x00FF (HCI_LE_ExtEvent) -Data Length : 0x06 (6) bytes(s) Event : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus) Status : 0x00 (0) (SUCCESS) OpCode : 0xFE00 (GAP_DeviceInit) DataLength : 0x00 (0) Dump(Rx): 0000:04 FF 06 7F 06 00 00 FE 00 ......... -------------------------------------------------------------------- [5] : <Rx> - 01:54:04.089 -Type : 0x04 (Event) -EventCode : 0x00FF (HCI_LE_ExtEvent) -Data Length : 0x2C (44) bytes(s) Event : 0x0600 (1536) (GAP_DeviceInitDone) Status : 0x00 (0) (SUCCESS) DevAddr : F8:8A:5E:2D:8C:BB DataPktLen : 0x00FF (255) NumDataPkts : 0x05 (5) IRK : 00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00 CSRK : DD:A8:4B:67:91:B2:52:68:5C:D9:70:CE:7C:12:F2:0C Dump(Rx): 0000:04 FF 2C 00 06 00 BB 8C 2D 5E 8A F8 FF 00 05 00 ..,.....-^...... 0010:00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 DD ................ 0020:A8 4B 67 91 B2 52 68 5C D9 70 CE 7C 12 F2 0C .Kg..Rh\.p.|... -------------------------------------------------------------------- [6] : <Tx> - 01:54:16.422 -Type : 0x01 (Command) -OpCode : 0xFE3E (GapAdv_create) -Data Length : 0x15 (21) byte(s) Properties : 0x0000 (0) ( AdvEventProps Bit Mask Is Not Set) IntervalMin : 0x0000A0 (160) IntervalMax : 0x0000A0 (160) PrimaryChMap : 0x07 (7) ( GAP_ADV_CHAN_37 GAP_ADV_CHAN_38 GAP_ADV_CHAN_39) PeerAddrType : 0x00 (0) (PEER_ADDRTYPE_PUBLIC_OR_PUBLIC_ID) PeerAddress : 00:00:00:00:00:00 FilterPolicy : 0x00 (0) ( AdvFilterPolicy Bit Mask Is Not Set) TxPower : 0x7F (127) PrimaryPHY : 0x01 (1) (GAP_ADV_PRIM_PHY_1_MBPS) SecondaryPHY : 0x01 (1) (GAP_ADV_SEC_PHY_1_MBPS) SID : 0x00 (0) Dump(Tx): 0000:01 3E FE 15 00 00 A0 00 00 A0 00 00 07 00 00 00 .>.............. 0010:00 00 00 00 00 7F 01 01 00 ......... -------------------------------------------------------------------- [7] : <Rx> - 01:54:16.468 -Type : 0x04 (Event) -EventCode : 0x00FF (HCI_LE_ExtEvent) -Data Length : 0x07 (7) bytes(s) Event : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus) Status : 0x00 (0) (SUCCESS) OpCode : 0xFE3E (GapAdv_create) DataLength : 0x01 (1) Handle : 0x00 (0) Dump(Rx): 0000:04 FF 07 7F 06 00 3E FE 01 00 ......>... -------------------------------------------------------------------- [8] : <Tx> - 01:54:24.918 -Type : 0x01 (Command) -OpCode : 0xFE14 (GapAdv_SetPeriodicAdvParams) -Data Length : 0x07 (7) byte(s) Handle : 0x00 (0) Interval Min : 0x0006 (6) Interval Max : 0x0006 (6) Properties : 0x0000 (0) Dump(Tx): 0000:01 14 FE 07 00 06 00 06 00 00 00 ........... -------------------------------------------------------------------- [9] : <Rx> - 01:54:24.956 -Type : 0x04 (Event) -EventCode : 0x00FF (HCI_LE_ExtEvent) -Data Length : 0x06 (6) bytes(s) Event : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus) Status : 0x00 (0) (SUCCESS) OpCode : 0xFE14 (GapAdv_SetPeriodicAdvParams) DataLength : 0x00 (0) Dump(Rx): 0000:04 FF 06 7F 06 00 14 FE 00 ......... -------------------------------------------------------------------- [10] : <Rx> - 01:54:24.971 -Type : 0x04 (Event) -EventCode : 0x00FF (HCI_LE_ExtEvent) -Data Length : 0x03 (3) bytes(s) Event : 0x0619 (1561) (GAPAdv_SetPeriodicAdvParams) Status : 0x00 (0) (SUCCESS) Dump(Rx): 0000:04 FF 03 19 06 00 ...... -------------------------------------------------------------------- [11] : <Tx> - 01:54:28.680 -Type : 0x01 (Command) -OpCode : 0xFE15 (GapAdv_setPeriodicAdvData) -Data Length : 0x07 (7) byte(s) Handle : 0x00 (0) Operation : 0x03 (3) (Complete_Data) PayloadLength : 0x04 (4) Data : 00:11:22:33 Dump(Tx): 0000:01 15 FE 07 00 03 04 00 11 22 33 ........."3 -------------------------------------------------------------------- [12] : <Rx> - 01:54:28.695 -Type : 0x04 (Event) -EventCode : 0x00FF (HCI_LE_ExtEvent) -Data Length : 0x06 (6) bytes(s) Event : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus) Status : 0x00 (0) (SUCCESS) OpCode : 0xFE15 (GapAdv_setPeriodicAdvData) DataLength : 0x00 (0) Dump(Rx): 0000:04 FF 06 7F 06 00 15 FE 00 ......... -------------------------------------------------------------------- [13] : <Rx> - 01:54:28.711 -Type : 0x04 (Event) -EventCode : 0x00FF (HCI_LE_ExtEvent) -Data Length : 0x03 (3) bytes(s) Event : 0x061A (1562) (GAPAdv_SetPeriodicAdvData) Status : 0x00 (0) (SUCCESS) Dump(Rx): 0000:04 FF 03 1A 06 00 ...... -------------------------------------------------------------------- [14] : <Tx> - 01:54:32.172 -Type : 0x01 (Command) -OpCode : 0xFE16 (GapAdv_SetPeriodicAdvEnable) -Data Length : 0x02 (2) byte(s) Enable : 0x01 (1) Handle : 0x00 (0) Dump(Tx): 0000:01 16 FE 02 01 00 ...... -------------------------------------------------------------------- [15] : <Rx> - 01:54:32.195 -Type : 0x04 (Event) -EventCode : 0x00FF (HCI_LE_ExtEvent) -Data Length : 0x06 (6) bytes(s) Event : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus) Status : 0x00 (0) (SUCCESS) OpCode : 0xFE16 (GapAdv_SetPeriodicAdvEnable) DataLength : 0x00 (0) Dump(Rx): 0000:04 FF 06 7F 06 00 16 FE 00 ......... -------------------------------------------------------------------- [16] : <Rx> - 01:54:32.210 -Type : 0x04 (Event) -EventCode : 0x00FF (HCI_LE_ExtEvent) -Data Length : 0x03 (3) bytes(s) Event : 0x061B (1563) (GAPAdv_SetPeriodicAdvEnable) Status : 0x00 (0) (SUCCESS) Dump(Rx): 0000:04 FF 03 1B 06 00 ...... -------------------------------------------------------------------- [17] : <Tx> - 01:54:36.303 -Type : 0x01 (Command) -OpCode : 0xFE3F (GapAdv_enable) -Data Length : 0x04 (4) byte(s) Handle : 0x00 (0) EnableOptions : 0x00 (0) (GAP_ADV_ENABLE_OPTIONS_USE_MAX) DurationMaxEvnt: 0x0000 (0) Dump(Tx): 0000:01 3F FE 04 00 00 00 00 .?...... -------------------------------------------------------------------- [18] : <Rx> - 01:54:36.335 -Type : 0x04 (Event) -EventCode : 0x00FF (HCI_LE_ExtEvent) -Data Length : 0x06 (6) bytes(s) Event : 0x067F (1663) (GAP_HCI_ExtentionCommandStatus) Status : 0x00 (0) (SUCCESS) OpCode : 0xFE3F (GapAdv_enable) DataLength : 0x00 (0) Dump(Rx): 0000:04 FF 06 7F 06 00 3F FE 00 ......?.. --------------------------------------------------------------------
My question is: Why do I also need to send GAPAdv_enable, in order for my device to be identifiable from the mobile phone? Did I, maybe, do something wrong while trying to activate periodic advertising or is my workflow (from the log) the correct one?
Another question would be, where can I see the advertising packets sent? I'm talking about the data (00:11:22:33) set using the GAPAdv_setPeriodicAdvData command.