api-hal-bt.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #pragma once
  2. #include <m-string.h>
  3. #include <stdbool.h>
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. /** Initialize */
  8. void api_hal_bt_init();
  9. /** Start BLE app */
  10. bool api_hal_bt_start_app();
  11. /** Get BT/BLE system component state */
  12. void api_hal_bt_dump_state(string_t buffer);
  13. /** Get BT/BLE system component state */
  14. bool api_hal_bt_is_alive();
  15. /**
  16. * Lock shared access to flash controller
  17. * @return true if lock was successful, false if not
  18. */
  19. bool api_hal_bt_lock_flash();
  20. /** Unlock shared access to flash controller */
  21. void api_hal_bt_unlock_flash();
  22. /** Start ble tone tx at given channel and power */
  23. void api_hal_bt_start_tone_tx(uint8_t channel, uint8_t power);
  24. /** Stop ble tone tx */
  25. void api_hal_bt_stop_tone_tx();
  26. /** Start sending ble packets at a given frequency and datarate */
  27. void api_hal_bt_start_packet_tx(uint8_t channel, uint8_t pattern, uint8_t datarate);
  28. /** Stop sending ble packets */
  29. uint16_t api_hal_bt_stop_packet_test();
  30. /** Start receiving packets */
  31. void api_hal_bt_start_packet_rx(uint8_t channel, uint8_t datarate);
  32. /** Set up the RF to listen to a given RF channel */
  33. void api_hal_bt_start_rx(uint8_t channel);
  34. /** Stop RF listenning */
  35. void api_hal_bt_stop_rx();
  36. /** Get RSSI */
  37. float api_hal_bt_get_rssi();
  38. /** Get number of transmitted packets */
  39. uint32_t api_hal_bt_get_transmitted_packets();
  40. #ifdef __cplusplus
  41. }
  42. #endif