Mini Program's Bluetooth interface to obtain deviceId is different on Android and iOS.

as shown in the figure, how to unify deviceId and iOS under Android?

Apr.07,2021
The method of obtaining the Mac address of a device under

IOS:IOS has been blocked, so there is no mac address. At this time, it can only be judged by other methods, such as adding some special information in the Bluetooth device advertisData field, etc., can be judged by string, or directly by binary.
let bf = devices.devices [0] .AdvertisData.slice (0Magne6);
{slice (0Power6), different devices may have different mac address location, which needs to be aligned with the value of android. The console cannot print the value of advertisData. You can use the cache to view the results. Good luck}
let macId = Array.prototype.map.call (new Uint8Array (bf), x = > ('00' + x.toString (16)). Slice (- 2)). Join (':');

)
Menu