mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-29 13:20:39 +00:00
update to use baudrate_init
This commit is contained in:
parent
8b3e57c885
commit
343c015d0b
@ -422,8 +422,8 @@ static int iphone_on (void *transport_config){
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// if baud == 0 use system default
|
// if baud == 0 use system default
|
||||||
if (hci_uart_config->baudrate == 0) {
|
if (hci_uart_config->baudrate_init == 0) {
|
||||||
hci_uart_config->baudrate = transport_speed;
|
hci_uart_config->baudrate_init = transport_speed;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_BLUETOOL
|
#ifdef USE_BLUETOOL
|
||||||
@ -493,17 +493,17 @@ static int iphone_on (void *transport_config){
|
|||||||
}
|
}
|
||||||
|
|
||||||
// advanced config - use custom baud rate
|
// advanced config - use custom baud rate
|
||||||
if (hci_uart_config->baudrate != transport_speed) {
|
if (hci_uart_config->baudrate_init != transport_speed) {
|
||||||
FILE * outputFile = popen(bluetool, "r+");
|
FILE * outputFile = popen(bluetool, "r+");
|
||||||
setvbuf(outputFile, NULL, _IONBF, 0);
|
setvbuf(outputFile, NULL, _IONBF, 0);
|
||||||
int output = fileno(outputFile);
|
int output = fileno(outputFile);
|
||||||
|
|
||||||
if (os4x) {
|
if (os4x) {
|
||||||
// 4.x - send custom config
|
// 4.x - send custom config
|
||||||
iphone_write_configscript(output, hci_uart_config->baudrate);
|
iphone_write_configscript(output, hci_uart_config->baudrate_init);
|
||||||
} else {
|
} else {
|
||||||
// 3.x - modify original script on the fly
|
// 3.x - modify original script on the fly
|
||||||
iphone_write_initscript(output, hci_uart_config->baudrate);
|
iphone_write_initscript(output, hci_uart_config->baudrate_init);
|
||||||
}
|
}
|
||||||
|
|
||||||
// log output
|
// log output
|
||||||
@ -679,15 +679,14 @@ void iphone_register_for_power_notifications(void (*cb)(POWER_NOTIFICATION_t eve
|
|||||||
|
|
||||||
// single instance
|
// single instance
|
||||||
bt_control_t bt_control_iphone = {
|
bt_control_t bt_control_iphone = {
|
||||||
iphone_on,
|
.on = iphone_on,
|
||||||
iphone_off,
|
.off = iphone_off,
|
||||||
iphone_sleep,
|
.sleep = iphone_sleep,
|
||||||
iphone_wake,
|
.wake = iphone_wake,
|
||||||
iphone_valid,
|
.valid = iphone_valid,
|
||||||
iphone_name,
|
.name = iphone_name,
|
||||||
NULL, // custom init sequence
|
|
||||||
#ifdef IOKIT
|
#ifdef IOKIT
|
||||||
iphone_register_for_power_notifications
|
.register_for_power_notifications = iphone_register_for_power_notifications
|
||||||
#else
|
#else
|
||||||
NULL // register_for_power_notifications
|
NULL // register_for_power_notifications
|
||||||
#endif
|
#endif
|
||||||
|
@ -113,8 +113,8 @@ static int h4_open(void *transport_config){
|
|||||||
perror("init_serialport: Couldn't get term attributes");
|
perror("init_serialport: Couldn't get term attributes");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
speed_t brate = hci_uart_config->baudrate; // let you override switch below if needed
|
speed_t brate = hci_uart_config->baudrate_init; // let you override switch below if needed
|
||||||
switch(hci_uart_config->baudrate) {
|
switch(hci_uart_config->baudrate_init) {
|
||||||
case 57600: brate=B57600; break;
|
case 57600: brate=B57600; break;
|
||||||
case 115200: brate=B115200; break;
|
case 115200: brate=B115200; break;
|
||||||
#ifdef B230400
|
#ifdef B230400
|
||||||
|
Loading…
x
Reference in New Issue
Block a user