u2f.h 785 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. U2fNotifyError,
  14. } U2fNotifyEvent;
  15. typedef struct U2fData U2fData;
  16. typedef void (*U2fEvtCallback)(U2fNotifyEvent evt, void* context);
  17. U2fData* u2f_alloc();
  18. bool u2f_init(U2fData* instance);
  19. void u2f_free(U2fData* instance);
  20. void u2f_set_event_callback(U2fData* instance, U2fEvtCallback callback, void* context);
  21. void u2f_confirm_user_present(U2fData* instance);
  22. uint16_t u2f_msg_parse(U2fData* instance, uint8_t* buf, uint16_t len);
  23. void u2f_wink(U2fData* instance);
  24. void u2f_set_state(U2fData* instance, uint8_t state);
  25. #ifdef __cplusplus
  26. }
  27. #endif