我正在尝试从Mac OS X模拟HandsFree设备。
不幸的是,SCO频道似乎从未打开过。我的Android手机仍在自己的扬声器上发出声音(即:按拨号盘时)。
当进入Mac OS X的声音偏好时,我可以将我的设备视为输入/输出设备,但声音级别永远不会改变。
这是我的代码:
(void)rfcommChannelData:(IOBluetoothRFCOMMChannel*)rfcommChannel data:(void *)dataPointer length:(size_t)dataLength
{
... STATE MACHINE GOES HERE and SEND AT COMMANDS ...
... AT CMER OK RECEIVED ...
ret = IOBluetoothAddSCOAudioDevice([[rfcommChannel getDevice] getDeviceRef], NULL);
if (ret != kIOReturnSuccess ){
IOBluetoothRemoveSCOAudioDevice([[rfcommChannel getDevice] getDeviceRef]);
NSLog(@"%@", @"Deleting previously audio device");
ret = IOBluetoothAddSCOAudioDevice([[rfcommChannel getDevice] getDeviceRef], NULL);
if (ret != kIOReturnSuccess) {
NSLog(@"%@", @"Can't install Audio Driver");
}
}
有关为什么系统安装和报告音频驱动程序但无法打开SCO连接的任何想法?