I use the BLE is the ticc2541,1.3.2 protocol stack
1, the first thing to note is that the iphone will protect the information, ble device read the iphone address is random, each connection will be different
2, below I will specify how to view the phone's MAC address
First of all my program is as a slave, from the machine equipped to start broadcasting, event sbp_start_device_evt---> Gaprole_startdevice (&SIMPLEBLEPERIPHERAL_PERIPHERALCBS) ;
Then enter the Gaprole_processevent function in the PERIPHERAL.C (I will not mention the callback function),
By Event sys_event_msg--->gaprole_processosalmsg ((osal_event_hdr_t *) PMSG);
---> Gap_msg_event---> Gaprole_processgapmsg ((gapeventhdr_t *) PMSG);
---> Gap_link_established_event--->
#define Gap_link_established_event 0x05
!< Sent when the establish Link Request was complete. This event was sent as an osal message defined as gapestlinkreqevent_t.
Uint8 Devaddr[b_addr_len]; !< Device Address of link
typedef struct
{
osal_event_hdr_t HDR; !< gap_msg_event and Status
Uint8 opcode; !< gap_link_established_event
Uint8 Devaddrtype; !< Device Address type: @ref gap_addr_type_defines
Uint8 Devaddr[b_addr_len]; !< Device Address of link
UInt16 ConnectionHandle; !< Connection Handle from controller used to ref the device
UInt16 Conninterval; !< Connection Interval
UInt16 connlatency; !< conenction Latency
UInt16 conntimeout; !< Connection Timeout
Uint8 clockaccuracy; !< Clock Accuracy
} gapestlinkreqevent_t;
gapestlinkreqevent_t *PPKT = (gapestlinkreqevent_t *) PMSG;
Debug_print ("Address:%s (%d) \ r \ n", Bdaddr2str (PPKT->DEVADDR), __line__);
At this time address is your mobile phone Bluetooth MAC address, both Android and iOS can, pro-test
Welcome to Exchange, if reproduced please indicate the source
Sina Blog: http://blog.sina.com.cn/u/2049150530
Blog Park: http://www.cnblogs.com/sky-heaven/
Know: Http://www.zhihu.com/people/zhang-bing-hua
How ble gets the iphone MAC address-"Sky original"