How ble gets the iphone MAC address-"Sky original"

Source: Internet
Author: User

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"

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.