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: BLE profile to send basic raw 30 bytes data

Part Number: CC2640R2F
Other Parts Discussed in Thread: CC2640

Hi,

Which BLE profile shall I use to send raw 30 bytes of data ? The data can be simple array, etc.

My CC2640 is in non-connectable broadcaster mode. It will just send raw data and observer will continuously listen and receive the data.

Thanks,

Kushal

  • If your device will only be in broadcaster mode, then you can only send the data through advertisement packets.

    You will find an array like this and you can just modify the data inside to send 30 bytes custom data.

    // 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
    };
    

  • You mean instead of UUID (all zeros in above example) we should send custom data. This makes sense.
  • That is for iBeacon format. If you are not intending to implement an iBeacon, then you don't need to follow this format.