add initial framework

This commit is contained in:
Conor Patrick
2018-04-28 13:40:28 -04:00
parent 0d0eff153e
commit 999ea34634
9 changed files with 212 additions and 0 deletions

33
usbhid.c Normal file
View File

@@ -0,0 +1,33 @@
#include <stdint.h>
#include "usbhid.h"
#include "udp_bridge.h"
static int serverfd = 0;
void usbhid_init()
{
// just bridge to UDP for now for pure software testing
serverfd = udp_server();
}
// Receive 64 byte USB HID message
void usbhid_recv(uint8_t * msg)
{
udp_recv(serverfd, msg, HID_MESSAGE_SIZE);
}
// Send 64 byte USB HID message
void usbhid_send(uint8_t * msg)
{
udp_send(serverfd, msg, HID_MESSAGE_SIZE);
}
void usbhid_close()
{
udp_close(serverfd);
}