FAQs
[[中文版]]常见问题汇总 — FSC-BTDMD 2.3 documentation
1. Why do we need to use an app on a mobile phone for Bluetooth connection and communication?
Native phone Bluetooth functionality primarily supports common use cases like audio transfer and file sharing. Some Bluetooth peripheral devices can be connected via the phone’s built-in settings (e.g., Bluetooth speakers, headphones, keyboards, mice). However, when a peripheral device, like a module only supporting SPP/GATT protocols, cannot be connected via native phone settings, a specific mobile application, such as the FeasyBlue app, is generally required for connection.
2. How to get the Bluetooth MAC address on an iOS phone?
Due to security considerations, the iOS system converts the Bluetooth MAC address into a UUID at the underlying level before presenting it to upper-layer applications. Therefore, apps cannot directly obtain the device’s actual MAC address.
The FSC-BT836x series Bluetooth modules include the MAC address in their broadcasts by default. Apps can retrieve the MAC address from the advertisement packet using the following method.
- (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI
{
if(![self describeDictonary:advertisementData])
{
NSLog(@"is not fsc module");
return;
}
}
- (Boolean)describeDictonary: (NSDictionary *) dict
{
NSArray *keys;
id key;
keys = [dict allKeys];
for(int i = 0; i < [keys count]; i++)
{
key = [keys objectAtIndex:i];
if([key isEqualToString:@"kCBAdvDataManufacturerData"])
{
NSData *tempValue = [dict objectForKey:key];
const Byte *tempByte = [tempValue bytes];
if([tempValue length] == 6)
{
// tempByte Subsequent parameters are the Bluetooth address
return true
}
}else if([key isEqualToString:@"kCBAdvDataLocalName"])
{
//there is name
//NSString *szName = [dict objectForKey: key];
}
}
return false;
}