[FL-3302] Part 2 of hooking C2 IPC (#2662)

This commit is contained in:
hedger 2023-05-11 05:25:06 +03:00 committed by GitHub
parent eebc6241b7
commit 9914aa40bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 1 deletions

View File

@ -2,6 +2,7 @@
#include "app_common.h" #include "app_common.h"
#include "ble_app.h" #include "ble_app.h"
#include <ble/ble.h> #include <ble/ble.h>
#include <hci_tl.h>
#include <interface/patterns/ble_thread/tl/tl.h> #include <interface/patterns/ble_thread/tl/tl.h>
#include <interface/patterns/ble_thread/shci/shci.h> #include <interface/patterns/ble_thread/shci/shci.h>
@ -72,6 +73,20 @@ void shci_register_io_bus(tSHciIO* fops) {
fops->Send = ble_glue_TL_SYS_SendCmd; fops->Send = ble_glue_TL_SYS_SendCmd;
} }
static int32_t ble_glue_TL_BLE_SendCmd(uint8_t* buffer, uint16_t size) {
if(furi_hal_bt_get_hardfault_info()) {
furi_crash("ST(R) Copro(R) HardFault");
}
return TL_BLE_SendCmd(buffer, size);
}
void hci_register_io_bus(tHciIO* fops) {
/* Register IO bus services */
fops->Init = TL_BLE_Init;
fops->Send = ble_glue_TL_BLE_SendCmd;
}
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
void ble_glue_init() { void ble_glue_init() {

View File

@ -48,7 +48,10 @@ sources += Glob(
) )
sources += Glob( sources += Glob(
"stm32wb_copro/wpan/interface/patterns/ble_thread/tl/*_tl*.c", "stm32wb_copro/wpan/interface/patterns/ble_thread/tl/*_tl*.c",
exclude="stm32wb_copro/wpan/interface/patterns/ble_thread/tl/shci_tl_if.c", exclude=[
"stm32wb_copro/wpan/interface/patterns/ble_thread/tl/hci_tl_if.c",
"stm32wb_copro/wpan/interface/patterns/ble_thread/tl/shci_tl_if.c",
],
source=True, source=True,
) )
sources += [ sources += [