diff --git a/ledger_device_sdk/src/io.rs b/ledger_device_sdk/src/io.rs index 886bd33d..eee6d000 100644 --- a/ledger_device_sdk/src/io.rs +++ b/ledger_device_sdk/src/io.rs @@ -1,4 +1,4 @@ -#[cfg(target_os = "nanox")] +#[cfg(any(target_os = "nanox", target_os = "stax", target_os = "flex"))] use crate::ble; #[cfg(not(any(target_os = "stax", target_os = "flex")))] use ledger_secure_sdk_sys::buttons::{get_button_event, ButtonEvent, ButtonsState}; @@ -196,7 +196,7 @@ impl Comm { APDU_USB_CCID => { ccid::send(&self.apdu_buffer[..self.tx]); } - #[cfg(target_os = "nanox")] + #[cfg(any(target_os = "nanox", target_os = "stax", target_os = "flex"))] APDU_BLE => { ble::send(&self.apdu_buffer[..self.tx]); } @@ -387,7 +387,7 @@ impl Comm { } seph::Events::CAPDUEvent => seph::handle_capdu_event(&mut self.apdu_buffer, spi_buffer), - #[cfg(target_os = "nanox")] + #[cfg(any(target_os = "nanox", target_os = "stax", target_os = "flex"))] seph::Events::BleReceive => ble::receive(&mut self.apdu_buffer, spi_buffer), seph::Events::TickerEvent => { diff --git a/ledger_device_sdk/src/lib.rs b/ledger_device_sdk/src/lib.rs index 7d76c310..0c14c0f6 100644 --- a/ledger_device_sdk/src/lib.rs +++ b/ledger_device_sdk/src/lib.rs @@ -7,7 +7,7 @@ #![feature(generic_const_exprs)] #![feature(cfg_version)] -#[cfg(target_os = "nanox")] +#[cfg(any(target_os = "nanox", target_os = "stax", target_os = "flex"))] pub mod ble; #[cfg(feature = "ccid")] diff --git a/ledger_secure_sdk_sys/build.rs b/ledger_secure_sdk_sys/build.rs index b109f923..801efe87 100644 --- a/ledger_secure_sdk_sys/build.rs +++ b/ledger_secure_sdk_sys/build.rs @@ -570,6 +570,12 @@ impl SDKBuilder { .to_str() .unwrap(), ) + .header( + self.bolos_sdk + .join("lib_blewbxx_impl/include/ledger_ble.h") + .to_str() + .unwrap(), + ) } _ => (), } @@ -745,6 +751,19 @@ fn finalize_flex_configuration(command: &mut cc::Build, bolos_sdk: &Path) { command .target("thumbv8m.main-none-eabi") + .file(bolos_sdk.join("src/ledger_protocol.c")) + .file(bolos_sdk.join("lib_blewbxx/core/auto/ble_gap_aci.c")) + .file(bolos_sdk.join("lib_blewbxx/core/auto/ble_gatt_aci.c")) + .file(bolos_sdk.join("lib_blewbxx/core/auto/ble_hal_aci.c")) + .file(bolos_sdk.join("lib_blewbxx/core/auto/ble_hci_le.c")) + .file(bolos_sdk.join("lib_blewbxx/core/auto/ble_l2cap_aci.c")) + .file(bolos_sdk.join("lib_blewbxx/core/template/osal.c")) + .file(bolos_sdk.join("lib_blewbxx_impl/src/ledger_ble.c")) + .include(bolos_sdk.join("lib_blewbxx/include")) + .include(bolos_sdk.join("lib_blewbxx/core")) + .include(bolos_sdk.join("lib_blewbxx/core/auto")) + .include(bolos_sdk.join("lib_blewbxx/core/template")) + .include(bolos_sdk.join("lib_blewbxx_impl/include")) .include(bolos_sdk.join("target/flex/include/")) .flag("-fropi") .flag("-frwpi") diff --git a/ledger_secure_sdk_sys/src/c/src.c b/ledger_secure_sdk_sys/src/c/src.c index 7b92b374..5542e4d1 100644 --- a/ledger_secure_sdk_sys/src/c/src.c +++ b/ledger_secure_sdk_sys/src/c/src.c @@ -327,7 +327,7 @@ int c_main(void) { #ifdef HAVE_BLE memset(&G_io_asynch_ux_callback, 0, sizeof(G_io_asynch_ux_callback)); - LEDGER_BLE_init(); + BLE_power(1, NULL); #endif #if !defined(HAVE_BOLOS) && defined(HAVE_PENDING_REVIEW_SCREEN)