How to decode the BLE advertisement data

☆樱花仙子☆ 提交于 2019-12-02 06:30:21

It seems that you are expecting this advertising packet to be decodable as iBeacon, but it is not. The full bytes listed in comments are:

ff ff 02 15 e8 4a 40 af 7b 8d e8 8d 4a 7b 40 af af e8 4a 40 40 af 7b 8d c3

The 02 15 is the company code of Apple, but the next two bytes e8 4a are not consistent with the pattern you will see for iBeacon. There is no reason to think, therefore, that beacon identifiers are encoded in this packet.

What do the data mean? It's impossible to say without more information about what software or hardware is transmitting this packet and what its intended purpose is. All we can tell is that it is a manufacturer advertisement (type ff) and is reporting itself as an Apple device.

If you want to figure out the meaning of the packet, you need to determine what app or hardware manufacturer is emitting it and seek documentation from that entity.

my small code snippet:

-(void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI
{
    // NSLog(@"%@", central);
    NSLog(@"%@", peripheral);
    //NSLog(@"%@", advertisementData);
    NSLog(@"%@", RSSI);

    // more details:
    NSString* name = [peripheral name]; // name in NULL in iOS 6
    NSLog(@"%@", name);

    for (NSString * key in advertisementData){
        NSLog(@"%@", advertisementData[key]);
    }


}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!