work on launchd plist

This commit is contained in:
matthias.ringwald 2009-08-20 22:54:29 +00:00
parent d02d25349c
commit c1f4fa9737
4 changed files with 18 additions and 9 deletions

View File

@ -4,20 +4,21 @@ Last milestone reached: Restart client app without restarting BTdaemon possible
NEXT:
- autostart by launchd: ch.ringwald.BTstack.plist
- get to work
- get it to work on iPhone
- launchd check in neccessary?
- set path for stdout
- better deal with Apple stack
- detect that it is running
- detect if it is running
- figure out how to shut it down
- user interface
- iPhone status icon support
- set BTstack SpringBoard icon from background deamon
- possible without MobileSubstrate
- MobileSubstrate used by veency
- extend hci_logger to write to /var/hci_dump.txt as text
- Detect and handle iPhone sleep mode
- Cocoa User Interface Components
- Alert and shutdown of Apple's stack
- Inquiry
- Detect iPhone sleep mode
=== BTdaemon can run always
- implement rest of L2CAP state machine
- incoming connections

View File

@ -91,7 +91,11 @@ void event_handler(uint8_t *packet, uint16_t size){
}
int main (int argc, const char * argv[]){
bt_open();
int err = bt_open();
if (err) {
printf("Failed to open connection to BTdaemon\n");
return err;
}
bt_register_event_packet_handler(event_handler);
bt_register_data_packet_handler(data_handler);
bt_send_cmd(&btstack_set_power_mode, HCI_POWER_ON );

View File

@ -9,10 +9,14 @@
<key>Program</key>
<string>/usr/bin/BTdaemon</string>
<key>ServiceIPC</key>
<false/>
<key>Debug</key>
<true/>
<key>ProgramArguments</key>
<array/>
<key>StandardErrorPath</key>
<string>/var/log/BTstack.err</string>
<key>StandardOutPath</key>
<string>/var/log/BTstack.log</string>
<key>Sockets</key>
<dict>

View File

@ -196,11 +196,11 @@ int main (int argc, const char * argv[]){
timeout.process = daemon_no_connections_timeout;
// @TODO: make choice of socket server configurable (TCP and/or Unix Domain Socket)
// @TODO: make port and/or socket configurable per config.h
// create server
// socket_connection_create_tcp(BTSTACK_PORT);
socket_connection_create_unix(BTSTACK_UNIX);
socket_connection_register_packet_callback(daemon_client_handler);
// handle CTRL-c
@ -209,9 +209,9 @@ int main (int argc, const char * argv[]){
signal(SIGTERM, daemon_sigint_handler);
// make stderr unbuffered
setbuf(stderr, NULL);
bluetooth_status_handler(BLUETOOTH_ACTIVE);
setbuf(stdout, NULL);
printf("BTdaemon started - stdout\n");
fprintf(stderr,"BTdaemon started - stderr\n");
// go!
run_loop_execute();