9e62f08e4d
* U2F implementation prototype * U2F data encryption and store, user confirmation request * remove debug prints * fix notification bug in chrome * split u2f_alloc into u2f_init and u2f_alloc * typo fix, furi-hal-trng -> furi-hal-random * rand/srand redefinition * SubGhz: a little bit of Dante. * u2f_data naming fix Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
37 lines
750 B
C
37 lines
750 B
C
#pragma once
|
|
|
|
#define HID_U2F_PACKET_LEN 64
|
|
|
|
typedef enum {
|
|
HidU2fDisconnected,
|
|
HidU2fConnected,
|
|
HidU2fRequest,
|
|
} HidU2fEvent;
|
|
|
|
typedef void (*HidU2fCallback)(HidU2fEvent ev, void* context);
|
|
|
|
/** Get HID U2F connection state
|
|
*
|
|
* @return true / false
|
|
*/
|
|
bool furi_hal_hid_u2f_is_connected();
|
|
|
|
/** Set HID U2F event callback
|
|
*
|
|
* @param cb callback
|
|
* @param ctx callback context
|
|
*/
|
|
void furi_hal_hid_u2f_set_callback(HidU2fCallback cb, void* ctx);
|
|
|
|
/** Get received U2F HID packet
|
|
*
|
|
*/
|
|
uint32_t furi_hal_hid_u2f_get_request(uint8_t* data);
|
|
|
|
/** Send U2F HID response packet
|
|
*
|
|
* @param data response data
|
|
* @param len packet length
|
|
*/
|
|
void furi_hal_hid_u2f_send_response(uint8_t* data, uint8_t len);
|