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.

CC2640: 简单外设 例程 如果更改外设名称?

Part Number: CC2640


 简单外设 例程 如果更改外设名称?

  • 在simple_peripheral.c中找到下面代码进行修改:

    // Scan Response Data
    static uint8_t scanRspData[] =
    {
      // complete name
      17,   // length of this data
      GAP_ADTYPE_LOCAL_NAME_COMPLETE,
      'S',
      'i',
      'm',
      'p',
      'l',
      'e',
      'P',
      'e',
      'r',
      'i',
      'p',
      'h',
      'e',
      'r',
      'a',
      'l',
    
      // connection interval range
      5,   // length of this data
      GAP_ADTYPE_SLAVE_CONN_INTERVAL_RANGE,
      LO_UINT16(DEFAULT_DESIRED_MIN_CONN_INTERVAL),   // 100ms
      HI_UINT16(DEFAULT_DESIRED_MIN_CONN_INTERVAL),
      LO_UINT16(DEFAULT_DESIRED_MAX_CONN_INTERVAL),   // 1s
      HI_UINT16(DEFAULT_DESIRED_MAX_CONN_INTERVAL),
    
      // Tx power level
      2,   // length of this data
      GAP_ADTYPE_POWER_LEVEL,
      0       // 0dBm
    };

  • 改了,没有用

  • 还需要修改:

    static uint8_t attDeviceName[GAP_DEVICE_NAME_LEN] = "Simple Peripheral";