u2f.h 765 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #pragma once
  2. #ifdef __cplusplus
  3. extern "C" {
  4. #endif
  5. #include <furi.h>
  6. typedef enum {
  7. U2fNotifyRegister,
  8. U2fNotifyAuth,
  9. U2fNotifyAuthSuccess,
  10. U2fNotifyWink,
  11. U2fNotifyConnect,
  12. U2fNotifyDisconnect,
  13. } U2fNotifyEvent;
  14. typedef struct U2fData U2fData;
  15. typedef void (*U2fEvtCallback)(U2fNotifyEvent evt, void* context);
  16. U2fData* u2f_alloc();
  17. bool u2f_init(U2fData* instance);
  18. void u2f_free(U2fData* instance);
  19. void u2f_set_event_callback(U2fData* instance, U2fEvtCallback callback, void* context);
  20. void u2f_confirm_user_present(U2fData* instance);
  21. uint16_t u2f_msg_parse(U2fData* instance, uint8_t* buf, uint16_t len);
  22. void u2f_wink(U2fData* instance);
  23. void u2f_set_state(U2fData* instance, uint8_t state);
  24. #ifdef __cplusplus
  25. }
  26. #endif