fix compile for posix platforms

This commit is contained in:
matthias.ringwald 2010-01-09 21:27:47 +00:00
parent 2ed6235c61
commit 21113242b1
2 changed files with 11 additions and 8 deletions

View File

@ -55,6 +55,8 @@
#include <unistd.h>
#include <errno.h>
#ifdef USE_BLUETOOL
// minimal IOKit
#ifdef __APPLE__
#include <Availability.h>
@ -72,6 +74,7 @@ kern_return_t IOObjectRelease(mach_port_t object);
#endif
#endif
// minimal BluetoothManager swiped from BigBoss SBSettings Toggle
#import <Foundation/Foundation.h>
@class UIDevice;
@ -118,7 +121,7 @@ void iphone_system_bt_set_enabled(int enabled)
CFPreferencesAppSynchronize(kAppNetwork);
}
#endif
#define BUFF_LEN 80
static char buffer[BUFF_LEN+1];
@ -328,7 +331,12 @@ static int iphone_on (void *transport_config){
hci_uart_config_t * hci_uart_config = (hci_uart_config_t*) transport_config;
#if 0
#ifdef USE_BLUETOOL
if (iphone_system_bt_enabled()){
perror("iphone_on: System Bluetooth enabled!");
return 1;
}
#else
// quick test if Bluetooth UART can be opened
int fd = open(hci_uart_config->device_name, O_RDWR | O_NOCTTY | O_NDELAY);
if (fd == -1) {
@ -337,11 +345,6 @@ static int iphone_on (void *transport_config){
return 1;
}
close(fd);
#else
if (iphone_system_bt_enabled()){
perror("iphone_on: System Bluetooth enabled!");
return 1;
}
#endif
int err = 0;

View File

@ -238,7 +238,7 @@ static int h4_process(struct data_source *ds) {
bytes_to_read = HCI_ACL_DATA_PKT_HDR;
h4_state = H4_W4_ACL_HEADER;
} else {
fprintf(stderr, "h4_process: invalid packet type 0x%02x\n");
fprintf(stderr, "h4_process: invalid packet type 0x%02x\n", hci_packet[0]);
read_pos = 0;
bytes_to_read = 1;
}