From 7400fe0c154eaf849b59ea92abf939ff28b0f8f1 Mon Sep 17 00:00:00 2001 From: "matthias.ringwald" Date: Wed, 16 Mar 2011 10:44:17 +0000 Subject: [PATCH] unload BTServer while BTstack is active --- src/bt_control_iphone.m | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/bt_control_iphone.m b/src/bt_control_iphone.m index 5633a8a79..dc32f80b6 100644 --- a/src/bt_control_iphone.m +++ b/src/bt_control_iphone.m @@ -427,6 +427,9 @@ static int iphone_on (void *transport_config){ return 1; } + // unload BTServer + err = system ("launchctl unload /System/Library/LaunchDaemons/com.apple.BTServer.plist"); + #if 0 // use tmp file for testing on os 3.x int output = open("/tmp/bt.init", O_WRONLY | O_CREAT | O_TRUNC); @@ -444,7 +447,7 @@ static int iphone_on (void *transport_config){ // NSLog(@"OS Version: %@, ox4x = %u", systemVersion, os4x); [pool release]; - // set correct BlueTool version, BlueToolH4 on OS 4.0+ + // OS 4.0 char * bluetool = os3xBlueTool; if (os4x) { bluetool = os4xBlueTool; @@ -542,9 +545,12 @@ static int iphone_off (void *config){ // power off (all models) system ("echo \"power off\nquit\" | BlueTool"); - // kill Apple BTServer as it gets confused and fails to start anyway - system("killall BTServer"); + // system("killall BTServer"); + + // reload BTServer + system ("launchctl load /System/Library/LaunchDaemons/com.apple.BTServer.plist"); + return 0; }