ble_hid.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. #pragma once
  2. #include <furi_ble/profile_interface.h>
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. /**
  7. * Optional arguments to pass along with profile template as
  8. * FuriHalBleProfileParams for tuning profile behavior
  9. **/
  10. typedef struct {
  11. char name[FURI_HAL_BT_ADV_NAME_LENGTH]; /**< Full device name */
  12. uint8_t mac[GAP_MAC_ADDR_SIZE]; /**< Full device address */
  13. bool bonding; /**< Save paired devices */
  14. GapPairing pairing; /**< Pairing security method */
  15. } BleProfileHidParams;
  16. /** Hid Keyboard Profile descriptor */
  17. extern const FuriHalBleProfileTemplate* ble_profile_hid;
  18. /** Press keyboard button
  19. *
  20. * @param profile profile instance
  21. * @param button button code from HID specification
  22. *
  23. * @return true on success
  24. */
  25. bool ble_profile_hid_kb_press(FuriHalBleProfileBase* profile, uint16_t button);
  26. /** Release keyboard button
  27. *
  28. * @param profile profile instance
  29. * @param button button code from HID specification
  30. *
  31. * @return true on success
  32. */
  33. bool ble_profile_hid_kb_release(FuriHalBleProfileBase* profile, uint16_t button);
  34. /** Release all keyboard buttons
  35. *
  36. * @param profile profile instance
  37. * @return true on success
  38. */
  39. bool ble_profile_hid_kb_release_all(FuriHalBleProfileBase* profile);
  40. /** Set the following consumer key to pressed state and send HID report
  41. *
  42. * @param profile profile instance
  43. * @param button key code
  44. */
  45. bool ble_profile_hid_consumer_key_press(FuriHalBleProfileBase* profile, uint16_t button);
  46. /** Set the following consumer key to released state and send HID report
  47. *
  48. * @param profile profile instance
  49. * @param button key code
  50. */
  51. bool ble_profile_hid_consumer_key_release(FuriHalBleProfileBase* profile, uint16_t button);
  52. /** Set consumer key to released state and send HID report
  53. *
  54. * @param profile profile instance
  55. * @param button key code
  56. */
  57. bool ble_profile_hid_consumer_key_release_all(FuriHalBleProfileBase* profile);
  58. /** Set mouse movement and send HID report
  59. *
  60. * @param profile profile instance
  61. * @param dx x coordinate delta
  62. * @param dy y coordinate delta
  63. */
  64. bool ble_profile_hid_mouse_move(FuriHalBleProfileBase* profile, int8_t dx, int8_t dy);
  65. /** Set mouse button to pressed state and send HID report
  66. *
  67. * @param profile profile instance
  68. * @param button key code
  69. */
  70. bool ble_profile_hid_mouse_press(FuriHalBleProfileBase* profile, uint8_t button);
  71. /** Set mouse button to released state and send HID report
  72. *
  73. * @param profile profile instance
  74. * @param button key code
  75. */
  76. bool ble_profile_hid_mouse_release(FuriHalBleProfileBase* profile, uint8_t button);
  77. /** Set mouse button to released state and send HID report
  78. *
  79. * @param profile profile instance
  80. * @param button key code
  81. */
  82. bool ble_profile_hid_mouse_release_all(FuriHalBleProfileBase* profile);
  83. /** Set mouse wheel position and send HID report
  84. *
  85. * @param profile profile instance
  86. * @param delta number of scroll steps
  87. */
  88. bool ble_profile_hid_mouse_scroll(FuriHalBleProfileBase* profile, int8_t delta);
  89. #ifdef __cplusplus
  90. }
  91. #endif