john800422 发表于 2015-3-7 17:57:31

分享自己寫的 nRF51 beacon 廣播 & 掃描代碼

主要是從官方範例改過來的,把部分不需要的東西去掉,
透過 nRF51-DK 和 nRF51-Dongle 實現,

nRF51-Dongle 做廣播,不斷廣播 UUID, Major, Minor 和 TX Power,
nRF51-DK 做掃描,並將收到的廣播封包透過 UART 傳到電腦上顯示。

**** 開發環境
Window 7 64
MDK 5.14
nRF51 SDK 7.2.0
SoftDevice s110 7.1.0
SoftDevice s120 1.0.1

// Advertising Data Format
//
// 02 01 04 1A FF 59 00 02 15 E2 C5 6D B5 DF FB 48 D2 B0 60 D0 F5 A7 10 96 E0 00 00 00 00 C3 00
//
// 02 # Number of bytes that follow in first AD structure
// 01 # Flags AD type
// 04 # Flags value
// 1A # Number of bytes that follow in second (and last) AD structure
// FF # Manufacturer specific data AD type
// 59 00 # Company identifier code (0x0059 == Nordic Semiconductor ASA)
// 02 # Device type (0x02 refers to Beacon)
// 15 # Length of specific data
// E2 C5 6D B5 DF FB 48 D2 B0 60 D0 F5 A7 10 96 E0 # Beacon proximity uuid
// 00 00 # Major
// 00 00 # Minor
// C3 # The 2's complement of the calibrated Tx Power

其他自己寫的 nRF51 測試代碼目前都放在 Github 上,有需要可以自行下載
https://github.com/Hom-Wang/NRF51

ICPACHONG 发表于 2015-3-7 22:15:59

感谢分享,楼主分享了很多好东西

xieweibiao 发表于 2015-3-8 14:24:43

最近在学习蓝牙无线的东西,感谢楼主

a515509429 发表于 2015-3-23 14:04:03

低功耗蓝牙!~

suxiaobo 发表于 2015-5-29 10:57:21

谢谢分享。。。

mikewang011 发表于 2015-5-29 17:37:58

感谢楼主无私分享

eddia2012 发表于 2015-5-29 18:37:10

{:smile:}thanks!

l899 发表于 2016-2-25 01:51:57

低功耗蓝牙

308594151 发表于 2016-2-25 10:05:47

mark一下

fchen2 发表于 2016-3-22 12:27:12

广播有时间限制?Nordic例程都是180秒,怎么设也改不了

wx51 发表于 2016-3-23 03:12:44

谢谢楼主,学习了。。。

ifus 发表于 2017-1-11 23:24:34


谢谢楼主,学习了。。。

sc_world 发表于 2017-4-23 21:58:11

谢谢楼主分享!
页: [1]
查看完整版本: 分享自己寫的 nRF51 beacon 廣播 & 掃描代碼