Welcome to mirror list, hosted at ThFree Co, Russian Federation.

furi_hal_usb_hid_u2f.h « furi_hal_include « targets « firmware - github.com/ClusterM/flipperzero-firmware.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e9bf57657dcf50bf310dbfe039e4cda7061fe12e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#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);