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.

CC2640R2F: HCI script file for iBeacon packet

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2640,

Hi team,

Do we have an example or script file of using btool transmitting iBeacon packet? 

Thanks.

Jo

  • Jo,

    I don't see anything new, but the Github examples have a Beacon example at:

    https://github.com/ti-simplelink/ble_examples/tree/ble_examples-2.2

    I will try to find out if something newer is available and report back to this thread in case I find something.

    Hope this helps,

    Rafael

  • Jo,

    Please apologize; I just got what you were actually asking. The recommended scripting tool is the HCI_tester

    https://processors.wiki.ti.com/index.php/LPRF_BLE_HCITester

    Despite it looks somewhat old, it has support for the latest devices.

    I couldn't find a Simple Observer script (beacon-like behaviour), though.

    Regards,

    Rafael

  • Hi Rafael,

    Below attachment is a script for CC2640 (old BLE Stack). Could you help to convert for CC2652 with BLE5 Stack ? Thank you.

    #initialize as peripheral
    Send_GAP_DeviceInit 0x04, 3, 0, 0, 1
    ################################
    # Generic Service
    ################################
    #01- Add Primary Service
    Send_GATT_AddService 0x2800, 3
    #02 Add Characteristic Declaration
    Send_GATT_AddAttribute "03:28", 0x03
    #03 DeviceName
    Send_GATT_AddAttribute "00:2A", 0x03
    sleep 100
    #################################
    # Simple BLE Service
    #################################
    #04- Add Primary Service
    Send_GATT_AddService 0x2800, 4
    #05 Add Characteristic Declaration - SimpleBleChar1
    Send_GATT_AddAttribute "03:28", 0x03
    #06 - Char 1 Value
    Send_GATT_AddAttribute "F1:FF", 0x03
    #07 - Char1 Description
    Send_GATT_AddAttribute "01:29", 0x03
    sleep 100
    Send_ATT_FindInfoReq 0xfffe, 0x0001, 0xFFFF
    
    #Update advertising data
    Send_GAP_UpdateAdvertisingData 1, "02:01:04:05:05:05:07:07"
    #Update scan respon
    Send_GAP_UpdateAdvertisingData 0x00, "02:01:04:05:02:02:02:02"
    sleep 100
    #Make discoverable: GAP_ADTYPE_ADV_IND
    Send_GAP_MakeDiscoverable 0x00, 0, 0, 0x07, 0x00
    
    

  • There is a iBeacon example program.

    -kel

  • Hi Kel,

    Could you provide the link ? 

    Is the example the script file for CC2652 HostTest FW ?

    Thank you.

  • Hi,

    The simple broadcaster example program for CC2640R2F, advertising packet can be set to iBeacon format. I am not sure if the same is implemented at latest CC2652 SDK. I don't understand why you need Btool to transmit iBeacon packets.

    // GAP - Advertisement data (max size = 31 bytes, though this is
    // best kept short to conserve power while advertisting)
    static uint8 advertData[] =
    {
      // Flags; this sets the device to use limited discoverable
      // mode (advertises for 30 seconds at a time) instead of general
      // discoverable mode (advertises indefinitely)
      0x02,   // length of this data
      GAP_ADTYPE_FLAGS,
      GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED,
    
    #ifndef BEACON_FEATURE
    
      // three-byte broadcast of the data "1 2 3"
      0x04,   // length of this data including the data type byte
      GAP_ADTYPE_MANUFACTURER_SPECIFIC, // manufacturer specific adv data type
      1,
      2,
      3
    
    #else
    
      // 25 byte beacon advertisement data
      // Preamble: Company ID - 0x000D for TI, refer to www.bluetooth.org/.../company-identifiers
      // Data type: Beacon (0x02)
      // Data length: 0x15
      // UUID: 00000000-0000-0000-0000-000000000000 (null beacon)
      // Major: 1 (0x0001)
      // Minor: 1 (0x0001)
      // Measured Power: -59 (0xc5)
      0x1A, // length of this data including the data type byte
      GAP_ADTYPE_MANUFACTURER_SPECIFIC, // manufacturer specific adv data type
      0x0D, // Company ID - Fixed
      0x00, // Company ID - Fixed
      0x02, // Data Type - Fixed
      0x15, // Data Length - Fixed
      0x00, // UUID - Variable based on different use cases/applications
      0x00, // UUID
      0x00, // UUID
      0x00, // UUID
      0x00, // UUID
      0x00, // UUID
      0x00, // UUID
      0x00, // UUID
      0x00, // UUID
      0x00, // UUID
      0x00, // UUID
      0x00, // UUID
      0x00, // UUID
      0x00, // UUID
      0x00, // UUID
      0x00, // UUID
      0x00, // Major
      0x01, // Major
      0x00, // Minor
      0x01, // Minor
      0xc5  // Power - The 2's complement of the calibrated Tx Power
    
    #endif // !BEACON_FEATURE
    };
    

    -kel

  • Hi Kel,

    Thanks for your information. However, we use HostTest FW on CC2652. For HostTest, it need HCI commands to configure CC2652 behavior. It can use BTool or HCITester to set HCI commands. That's why we ask for the script files.

    Thank you.

  • Hi,

    For others following this thread, this is being worked offline.

    Regards,

    Rafael