#include // This function is called when a packet is received on the raw HID interface. // `length` will always be the size of the output (host to device) report in bytes - 32 in current QMK, but will eventually be raised to 64. // Thus, if you wish to send variable length data, you should send the length along with the payload, splitting across multiple reports // if needed, and handle the parsing yourself. // // In this simple example, we check that the first byte of the received data is the ASCII character 'A', // in which case we respond with 'B' and toggle the backlight. void raw_hid_receive(uint8_t *data, uint8_t length) { uint8_t response[RAW_EPSIZE]; memset(response, 0, RAW_EPSIZE); response[0] = 'B'; if(data[0] == 'A') { raw_hid_send(response, RAW_EPSIZE); backlight_toggle(); } }