seos_profile.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #pragma once
  2. #include <furi_ble/profile_interface.h>
  3. #include "seos_service.h"
  4. #ifdef __cplusplus
  5. extern "C" {
  6. #endif
  7. #define BLE_PROFILE_SEOS_PACKET_SIZE_MAX BLE_SVC_SEOS_DATA_LEN_MAX
  8. typedef enum {
  9. FuriHalBtSeosRpcStatusNotActive,
  10. FuriHalBtSeosRpcStatusActive,
  11. } FuriHalBtSeosRpcStatus;
  12. /** Seos service callback type */
  13. typedef SeosServiceEventCallback FuriHalBtSeosCallback;
  14. /** Seos profile descriptor */
  15. extern const FuriHalBleProfileTemplate* ble_profile_seos;
  16. /** Send data through BLE
  17. *
  18. * @param profile Profile instance
  19. * @param data data buffer
  20. * @param size data buffer size
  21. *
  22. * @return true on success
  23. */
  24. bool ble_profile_seos_tx(FuriHalBleProfileBase* profile, uint8_t* data, uint16_t size);
  25. /** Set BLE RPC status
  26. *
  27. * @param profile Profile instance
  28. * @param active true if RPC is active
  29. */
  30. void ble_profile_seos_set_rpc_active(FuriHalBleProfileBase* profile, bool active);
  31. /** Notify that application buffer is empty
  32. * @param profile Profile instance
  33. */
  34. void ble_profile_seos_notify_buffer_is_empty(FuriHalBleProfileBase* profile);
  35. /** Set Seos service events callback
  36. *
  37. * @param profile Profile instance
  38. * @param buffer_size Applicaition buffer size
  39. * @param calback FuriHalBtSeosCallback instance
  40. * @param context pointer to context
  41. */
  42. void ble_profile_seos_set_event_callback(
  43. FuriHalBleProfileBase* profile,
  44. uint16_t buff_size,
  45. FuriHalBtSeosCallback callback,
  46. void* context);
  47. #ifdef __cplusplus
  48. }
  49. #endif