mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-04-01 22:20:58 +00:00
unload BTServer while BTstack is active
This commit is contained in:
parent
d0b5eda730
commit
7400fe0c15
@ -427,6 +427,9 @@ static int iphone_on (void *transport_config){
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// unload BTServer
|
||||||
|
err = system ("launchctl unload /System/Library/LaunchDaemons/com.apple.BTServer.plist");
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
// use tmp file for testing on os 3.x
|
// use tmp file for testing on os 3.x
|
||||||
int output = open("/tmp/bt.init", O_WRONLY | O_CREAT | O_TRUNC);
|
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);
|
// NSLog(@"OS Version: %@, ox4x = %u", systemVersion, os4x);
|
||||||
[pool release];
|
[pool release];
|
||||||
|
|
||||||
// set correct BlueTool version, BlueToolH4 on OS 4.0+
|
// OS 4.0
|
||||||
char * bluetool = os3xBlueTool;
|
char * bluetool = os3xBlueTool;
|
||||||
if (os4x) {
|
if (os4x) {
|
||||||
bluetool = os4xBlueTool;
|
bluetool = os4xBlueTool;
|
||||||
@ -542,9 +545,12 @@ static int iphone_off (void *config){
|
|||||||
// power off (all models)
|
// power off (all models)
|
||||||
system ("echo \"power off\nquit\" | BlueTool");
|
system ("echo \"power off\nquit\" | BlueTool");
|
||||||
|
|
||||||
|
|
||||||
// kill Apple BTServer as it gets confused and fails to start anyway
|
// 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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user