furi-hal-usb-hid-u2f.h 750 B

123456789101112131415161718192021222324252627282930313233343536
  1. #pragma once
  2. #define HID_U2F_PACKET_LEN 64
  3. typedef enum {
  4. HidU2fDisconnected,
  5. HidU2fConnected,
  6. HidU2fRequest,
  7. } HidU2fEvent;
  8. typedef void (*HidU2fCallback)(HidU2fEvent ev, void* context);
  9. /** Get HID U2F connection state
  10. *
  11. * @return true / false
  12. */
  13. bool furi_hal_hid_u2f_is_connected();
  14. /** Set HID U2F event callback
  15. *
  16. * @param cb callback
  17. * @param ctx callback context
  18. */
  19. void furi_hal_hid_u2f_set_callback(HidU2fCallback cb, void* ctx);
  20. /** Get received U2F HID packet
  21. *
  22. */
  23. uint32_t furi_hal_hid_u2f_get_request(uint8_t* data);
  24. /** Send U2F HID response packet
  25. *
  26. * @param data response data
  27. * @param len packet length
  28. */
  29. void furi_hal_hid_u2f_send_response(uint8_t* data, uint8_t len);