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.

cc2540 usb 广播

Other Parts Discussed in Thread: CC2540

现在是想做一个实验,验证cc2540 usb上的天线效果如何,所以想让cc2540 usb广播测试下连接距离。烧写工程是C:\Texas Instruments\BLE-CC254x-1.4.1.43908b\Projects\ble\SimpleBLEPeripheral\CC2540DB的SimpleBLEPeripheral。

现象是手机只能在烧写完后一会看到cc2540 usb在广播,后面就看不到了;

问题是cc2540 usb能烧写SimpleBLEPeripheral不?如果可以,如何让它一直保持广播?

感谢各位大神指点,谢谢!

  • 可能是进入休眠了,要一直广播的话,建议关闭power saving,并按照下面设置:
    #define DEFAULT_DISCOVERABLE_MODE GAP_ADTYPE_FLAGS_GENERAL //非限制广播

    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, //无限广播
    DEFAULT_DISCOVERABLE_MODE | GAP_ADTYPE_FLAGS_BREDR_NOT_SUPPORTED,

    // service UUID, to notify central devices what services are included
    // in this peripheral
    0x03, // length of this data
    GAP_ADTYPE_16BIT_MORE, // some of the UUID's, but not all
    LO_UINT16( SIMPLEPROFILE_SERV_UUID ),
    HI_UINT16( SIMPLEPROFILE_SERV_UUID ),

    };