34 #define CTAP_HID_INIT_PAYLOAD_SIZE (CONFIG_USBUS_HID_INTERRUPT_EP_SIZE - 7)
35 #define CTAP_HID_CONT_PAYLOAD_SIZE (CONFIG_USBUS_HID_INTERRUPT_EP_SIZE - 5)
41 #define CTAP_HID_PROTOCOL_VERSION 0x02
48 #define CTAP_HID_INIT_PACKET 0x80
49 #define CTAP_HID_CONT_PACKET 0x00
55 #define CTAP_HID_INIT_NONCE_SIZE 8
60 #ifdef CONFIG_FIDO2_CTAP_TRANSPORT_HID_TRANSACTION_TIMEOUT
61 #define CTAP_HID_TRANSACTION_TIMEOUT_MS (CONFIG_FIDO2_CTAP_TRANSPORT_HID_TRANSACTION_TIMEOUT)
63 #define CTAP_HID_TRANSACTION_TIMEOUT_MS (500)
71 #define CTAP_HID_BUFFER_SIZE 7609
78 #define CTAP_HID_COMMAND_PING (0x01 | CTAP_HID_INIT_PACKET)
79 #define CTAP_HID_COMMAND_MSG (0x03 | CTAP_HID_INIT_PACKET)
80 #define CTAP_HID_COMMAND_LOCK (0x04 | CTAP_HID_INIT_PACKET)
81 #define CTAP_HID_COMMAND_INIT (0x06 | CTAP_HID_INIT_PACKET)
82 #define CTAP_HID_COMMAND_WINK (0x08 | CTAP_HID_INIT_PACKET)
83 #define CTAP_HID_COMMAND_CBOR (0x10 | CTAP_HID_INIT_PACKET)
84 #define CTAP_HID_COMMAND_CANCEL (0x11 | CTAP_HID_INIT_PACKET)
85 #define CTAP_HID_COMMAND_KEEPALIVE (0x3b | CTAP_HID_INIT_PACKET)
86 #define CTAP_HID_COMMAND_ERROR (0x3f | CTAP_HID_INIT_PACKET)
94 #define CTAP_HID_CAPABILITY_WINK 0x01
95 #define CTAP_HID_CAPABILITY_CBOR 0x04
96 #define CTAP_HID_CAPABILITY_NMSG 0x08
104 #define CTAP_HID_OK 0x00
105 #define CTAP_HID_ERR_INVALID_CMD 0x01
106 #define CTAP_HID_ERR_INVALID_PAR 0x02
107 #define CTAP_HID_ERR_INVALID_LEN 0x03
108 #define CTAP_HID_ERR_INVALID_SEQ 0x04
109 #define CTAP_HID_ERR_MSG_TIMEOUT 0x05
110 #define CTAP_HID_ERR_CHANNEL_BUSY 0x06
111 #define CTAP_HID_ERR_LOCK_REQUIRED 0x0a
112 #define CTAP_HID_ERR_INVALID_CHANNEL 0x0b
113 #define CTAP_HID_ERR_OTHER 0x7f
121 #define CTAP_HID_STATUS_PROCESSING 0x01
122 #define CTAP_HID_STATUS_UPNEEDED 0x02
129 #define CTAP_HID_CIDS_MAX 0x08
134 #define CTAP_HID_WINK_DELAY 400
140 #define CTAP_HID_BROADCAST_CID 0xffffffff
147 #define CTAP_HID_BUFFER_STATUS_BUFFERING 0x00
148 #define CTAP_HID_BUFFER_STATUS_DONE 0x01
149 #define CTAP_HID_BUFFER_STATUS_ERROR 0x02
189 typedef struct __attribute__((packed)){
#define CTAP_HID_CONT_PAYLOAD_SIZE
endpoint size - cont packet metadata
#define CTAP_HID_INIT_PAYLOAD_SIZE
endpoint size - init packet metadata
#define CTAP_HID_INIT_NONCE_SIZE
CTAP_HID size of nonce for init request.
void fido2_ctap_transport_hid_init(event_queue_t *queue)
Initialize CTAPHID.
bool fido2_ctap_transport_hid_should_cancel(void)
Check if CTAPHID layer has received CANCEL command.
void fido2_ctap_transport_hid_check_timeouts(void)
Check logical channels for timeouts.
void fido2_ctap_transport_hid_handle_packet(void *pkt_raw)
Handle CTAP_HID packet.
CTAP_HID channel identifier struct.
uint32_t last_used
timestamp of last usage
uint32_t cid
channel identifier
CTAP_HID continuation packet struct.
uint8_t seq
packet sequence number
CTAP_HID initialization packet struct.
uint8_t cmd
CTAP_HID command.
CTAP_HID initialization response struct.
uint8_t protocol_version
CTAP_HID protocol version.
uint8_t version_minor
minor device version
uint8_t version_major
major device version
uint32_t cid
channel identifier
uint8_t build_version
build device version
uint8_t capabilities
capabilities flags
ctap_hid_cont_pkt_t cont
continuation packet
ctap_hid_init_pkt_t init
initialization packet
uint32_t cid
channel identifier
Interface and definitions for USB HID type interfaces in USBUS.