FireBLE/RSSI test app for IOS

来自Firefly wiki
跳转至: 导航搜索

Scanning Devices

In order to connect with your own device,please scan peripherals with specified services.

[centralManager scanForPeripheralsWithServices:
@[[CBUUID UUIDWithString:BATTERY_SERVICE_UUID],[CBUUID UUIDWithString:IMALERT_SERVICE_UUID]
,[CBUUID UUIDWithString:INTERACTION_SERVICE_UUID],[CBUUID UUIDWithString:OTA_SERVICE_UUID]]
options:@{ CBCentralManagerScanOptionAllowDuplicatesKey : @YES }];

Also you can choose to scan all divice:

[centralManager scanForPeripheralsWithServices:nil options:@{ CBCentralManagerScanOptionAllowDuplicatesKey : @YES }];

Connecting Devices

 [centralManager connectPeripheral:peripheral options:nil];

Reading RSSI value

[_blePeripheral.discoveredPeripheral readRSSI];


After using a function to read RSSI value, this value will be evaluated into the parameter RSSI.