This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Set scan parameters

Other Parts Discussed in Thread: CC2540

1)
When I try to set the scanparameters in the BTool over the Adv. Commands with MISC_Generic_Command, I can't change any scanparameters. (Please see below). 0x200b is an unknown Op Code, why???

2)
When I set the device discovery request: nameMode=0x00 is this the passive state??? When yes, is it possible to have a passive scan without perfoming a device discovery request?

3)
And another question, why is the passive-Scan not the default scanstate? In the BLE-Standart (Volume2 / Part E / 7.8.10) is note, that it should be the default state!?!?

 

-----------------------------------------------------------------------------------------------
[50] : <Tx> - 01:37:36.368
-Type        : 0x01 (Command)
-Opcode    : 0x200B (MISC_GenericCommand)
-Data Length    : 0x07 byte(s)
 Raw        : 00 10 00 10 00 00 00
Dump(Tx):
01 0B 20 07 00 10 00 10 00 00 00

-----------------------------------------------------------------------------------------------
[51] : <Rx> - 01:37:36.431
-Type        : 0x04 (Event)
-EventCode    : 0x0E (HCI_CommandCompleteEvent)
-Data Length    : 0x04 bytes(s)
 Packets    : 0x01 (1)
 Opcode    : 0x200B (Unknown Op Code)
 Raw        : 01 0B 20 00
Dump(Rx):
04 0E 04 01 0B 20 00

-----------------------------------------------------------------------------------------------

  • Ben Tanner said:
    1)
    When I try to set the scanparameters in the BTool over the Adv. Commands with MISC_Generic_Command, I can't change any scanparameters. (Please see below). 0x200b is an unknown Op Code, why???

    The CC2540 BLE stack is a full stack, meaning that both the controller and host have been implemented. Therefore, you should not use standard HCI commands such as "LE Write Scan Parameters", because the host stack (in particular, the GAP layer) is managing these parameters. If you want to change the scan parameters you should use the GAP_SetParam command. More information on the different parameters can be found in the API Guide included with the SDK.

    Ben Tanner said:
    2)
    When I set the device discovery request: nameMode=0x00 is this the passive state???

    Yes, the "nameMode" parameter controls whether active or passive scanning is used.

    Ben Tanner said:
    When yes, is it possible to have a passive scan without perfoming a device discovery request?

    Again, the GAP layer of the host stack (see BT4.0 spec, Volume 3, Part C, Section 9) manages when and how the controller scans. The only time that the controller is scanning is during observation procedures, discovery procedures, or connection establishment. In the CC2540 API, the "GAP Device Discover Request" command is essentially used for both observation and discovery procedures, and you can use active or passive scanning for this.

    Ben Tanner said:
    3)
    And another question, why is the passive-Scan not the default scanstate? In the BLE-Standart (Volume2 / Part E / 7.8.10) is note, that it should be the default state!?!?

    If you use the GAP API functions, then the default value in the controller will be overwritten by whatever is specified by GAP.