准备工作 一台 PC IAR Embedded Workbench 集成开发环境,可以用30天试用版本。 支持 蓝牙 4.0 的智能手机一部,并安装下列应用之一 Android Google Play Store. iPhone  App Store. CC2540 开发板 CCDebugger 下载器 创建 iBeacon 工程文档 安装 TI 官方的 CC254x 开发环境 复制 C:\Texas Instruments\BLE-CC254x-1.3.2\Projects\ble\SimpleBLEBroadcaster 文件夹 粘贴到:C:\Texas Instruments\BLE-CC254x-1.3.2\Projects\ble\iBeacon 运行 IAR Embedded Workbench,点击 File > Open > Workspace 修改源代码 simpleBLEBroadcaster.c // 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, // 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 advertisement data type 1, 2,...

继续阅读完整内容

支持我们的网站,请点击查看下方广告

正在加载广告...

 
Advertisement

Please support our site by viewing this advertisement

Free Content