Get MAC address of bluetooth low energy peripheral in iOS

前端 未结 5 500
遥遥无期
遥遥无期 2020-11-28 04:05

I am currently working on an iOS application based on bluetooth low energy devices. In order to get a unique identifier to compare the peripherals got, I have to get the MAC

5条回答
  •  臣服心动
    2020-11-28 04:37

    Low energy peripherals may use privacy feature which hides the MAC address, so it is not necessarily even possible to get the address before connection or bonding. If you somehow get the MAC address which goes over the air, you need to handle privacy or you have interoperability problems.

    Apple uses UUIDs to abstract these privacy features out so users do not need to worry about those.

    Correct way to do that like you wrote is to either add some vendor specific data to advertisement packet or use the Device Information service.

提交回复
热议问题