, 당신은 이런 식으로 작업을 수행 할 수 있습니다
typedef void* BluetoothHCIRequest;
OSStatus BluetoothHCIRequestCreate(BluetoothHCIRequest* outHandle, int timeOut, void* unknownOut, int alwaysZero);
void BluetoothHCIRequestDelete(BluetoothHCIRequest hciRequest);
OSStatus BluetoothHCIWriteSimplePairingMode(BluetoothHCIRequest hciRequest, BOOL onOff);
#define HCI_TIMEOUT (3000)
void SetSimplePairing(BOOL on)
{
BluetoothHCIRequest hciRequest = nil;
if (BluetoothHCIRequestCreate(&hciRequest, HCI_TIMEOUT, nil, 0) == noErr && hciRequest)
{
OSStatus err = BluetoothHCIWriteSimplePairingMode(hciRequest, on);
if (err)
{
NSLog(@"BluetoothHCIWriteSimplePairingMode: %d", err);
}
BluetoothHCIRequestDelete(hciRequest);
}
else
{
NSLog(@"BluetoothHCIRequestCreate failed");
}
}
작동하는지, 감사합니다! –