2021-12-22 23:04:08 +03:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <furi.h>
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
U2fNotifyRegister,
|
|
|
|
U2fNotifyAuth,
|
2022-01-03 02:33:28 +03:00
|
|
|
U2fNotifyAuthSuccess,
|
2021-12-22 23:04:08 +03:00
|
|
|
U2fNotifyWink,
|
2022-01-03 02:33:28 +03:00
|
|
|
U2fNotifyConnect,
|
|
|
|
U2fNotifyDisconnect,
|
2022-02-07 16:34:09 +03:00
|
|
|
U2fNotifyError,
|
2021-12-22 23:04:08 +03:00
|
|
|
} U2fNotifyEvent;
|
|
|
|
|
|
|
|
typedef struct U2fData U2fData;
|
|
|
|
|
|
|
|
typedef void (*U2fEvtCallback)(U2fNotifyEvent evt, void* context);
|
|
|
|
|
2024-03-25 13:53:32 +03:00
|
|
|
U2fData* u2f_alloc(void);
|
2021-12-22 23:04:08 +03:00
|
|
|
|
|
|
|
bool u2f_init(U2fData* instance);
|
|
|
|
|
|
|
|
void u2f_free(U2fData* instance);
|
|
|
|
|
|
|
|
void u2f_set_event_callback(U2fData* instance, U2fEvtCallback callback, void* context);
|
|
|
|
|
|
|
|
void u2f_confirm_user_present(U2fData* instance);
|
|
|
|
|
|
|
|
uint16_t u2f_msg_parse(U2fData* instance, uint8_t* buf, uint16_t len);
|
|
|
|
|
|
|
|
void u2f_wink(U2fData* instance);
|
|
|
|
|
2022-01-03 02:33:28 +03:00
|
|
|
void u2f_set_state(U2fData* instance, uint8_t state);
|
|
|
|
|
2021-12-22 23:04:08 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|