Skip to content

Commit a87eade

Browse files
committed
Activate BT on Stax OK
1 parent efa1939 commit a87eade

File tree

4 files changed

+24
-5
lines changed

4 files changed

+24
-5
lines changed

ledger_device_sdk/src/io.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#[cfg(target_os = "nanox")]
1+
#[cfg(any(target_os = "nanox", target_os = "stax", target_os = "flex"))]
22
use crate::ble;
33
#[cfg(not(any(target_os = "stax", target_os = "flex")))]
44
use ledger_secure_sdk_sys::buttons::{get_button_event, ButtonEvent, ButtonsState};
@@ -196,7 +196,7 @@ impl Comm {
196196
APDU_USB_CCID => {
197197
ccid::send(&self.apdu_buffer[..self.tx]);
198198
}
199-
#[cfg(target_os = "nanox")]
199+
#[cfg(any(target_os = "nanox", target_os = "stax", target_os = "flex"))]
200200
APDU_BLE => {
201201
ble::send(&self.apdu_buffer[..self.tx]);
202202
}
@@ -387,7 +387,7 @@ impl Comm {
387387
}
388388
seph::Events::CAPDUEvent => seph::handle_capdu_event(&mut self.apdu_buffer, spi_buffer),
389389

390-
#[cfg(target_os = "nanox")]
390+
#[cfg(any(target_os = "nanox", target_os = "stax", target_os = "flex"))]
391391
seph::Events::BleReceive => ble::receive(&mut self.apdu_buffer, spi_buffer),
392392

393393
seph::Events::TickerEvent => {

ledger_device_sdk/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#![feature(generic_const_exprs)]
88
#![feature(cfg_version)]
99

10-
#[cfg(target_os = "nanox")]
10+
#[cfg(any(target_os = "nanox", target_os = "stax", target_os = "flex"))]
1111
pub mod ble;
1212

1313
#[cfg(feature = "ccid")]

ledger_secure_sdk_sys/build.rs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,12 @@ impl SDKBuilder {
570570
.to_str()
571571
.unwrap(),
572572
)
573+
.header(
574+
self.bolos_sdk
575+
.join("lib_blewbxx_impl/include/ledger_ble.h")
576+
.to_str()
577+
.unwrap(),
578+
)
573579
}
574580
_ => (),
575581
}
@@ -745,6 +751,19 @@ fn finalize_flex_configuration(command: &mut cc::Build, bolos_sdk: &Path) {
745751

746752
command
747753
.target("thumbv8m.main-none-eabi")
754+
.file(bolos_sdk.join("src/ledger_protocol.c"))
755+
.file(bolos_sdk.join("lib_blewbxx/core/auto/ble_gap_aci.c"))
756+
.file(bolos_sdk.join("lib_blewbxx/core/auto/ble_gatt_aci.c"))
757+
.file(bolos_sdk.join("lib_blewbxx/core/auto/ble_hal_aci.c"))
758+
.file(bolos_sdk.join("lib_blewbxx/core/auto/ble_hci_le.c"))
759+
.file(bolos_sdk.join("lib_blewbxx/core/auto/ble_l2cap_aci.c"))
760+
.file(bolos_sdk.join("lib_blewbxx/core/template/osal.c"))
761+
.file(bolos_sdk.join("lib_blewbxx_impl/src/ledger_ble.c"))
762+
.include(bolos_sdk.join("lib_blewbxx/include"))
763+
.include(bolos_sdk.join("lib_blewbxx/core"))
764+
.include(bolos_sdk.join("lib_blewbxx/core/auto"))
765+
.include(bolos_sdk.join("lib_blewbxx/core/template"))
766+
.include(bolos_sdk.join("lib_blewbxx_impl/include"))
748767
.include(bolos_sdk.join("target/flex/include/"))
749768
.flag("-fropi")
750769
.flag("-frwpi")

ledger_secure_sdk_sys/src/c/src.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ int c_main(void) {
327327

328328
#ifdef HAVE_BLE
329329
memset(&G_io_asynch_ux_callback, 0, sizeof(G_io_asynch_ux_callback));
330-
LEDGER_BLE_init();
330+
BLE_power(1, NULL);
331331
#endif
332332

333333
#if !defined(HAVE_BOLOS) && defined(HAVE_PENDING_REVIEW_SCREEN)

0 commit comments

Comments
 (0)