ble_glue.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #pragma once
  2. #include <stdint.h>
  3. #include <stdbool.h>
  4. #include <shci/shci.h>
  5. #ifdef __cplusplus
  6. extern "C" {
  7. #endif
  8. typedef void (
  9. *BleGlueKeyStorageChangedCallback)(uint8_t* change_addr_start, uint16_t size, void* context);
  10. /** Initialize start core2 and initialize transport */
  11. void ble_glue_init();
  12. /** Start Core2 Radio stack
  13. *
  14. * @return true on success
  15. */
  16. bool ble_glue_start();
  17. /** Is core2 alive and at least FUS is running
  18. *
  19. * @return true if core2 is alive
  20. */
  21. bool ble_glue_is_alive();
  22. bool ble_glue_wait_for_fus_start(WirelessFwInfo_t* info);
  23. /** Is core2 radio stack present and ready
  24. *
  25. * @return true if present and ready
  26. */
  27. bool ble_glue_is_radio_stack_ready();
  28. /** Set callback for NVM in RAM changes
  29. *
  30. * @param[in] callback The callback to call on NVM change
  31. * @param context The context for callback
  32. */
  33. void ble_glue_set_key_storage_changed_callback(
  34. BleGlueKeyStorageChangedCallback callback,
  35. void* context);
  36. /** Stop SHCI thread */
  37. void ble_glue_thread_stop();
  38. /** Restart MCU to launch radio stack firmware if necessary
  39. *
  40. * @return true on radio stack start command
  41. */
  42. bool ble_glue_radio_stack_fw_launch_started();
  43. #ifdef __cplusplus
  44. }
  45. #endif