diff --git a/right/src/system_properties.h b/right/src/system_properties.h index 5938496..14ea8ba 100644 --- a/right/src/system_properties.h +++ b/right/src/system_properties.h @@ -15,6 +15,8 @@ SystemPropertyId_BridgeProtocolVersion = 1, SystemPropertyId_DataModelVersion = 2, SystemPropertyId_FirmwareVersion = 3, + SystemPropertyId_HardwareConfigSize = 4, + SystemPropertyId_UserConfigSize = 5, } system_property_t; #endif diff --git a/right/src/usb_protocol_handler.c b/right/src/usb_protocol_handler.c index 47d68b0..517907c 100644 --- a/right/src/usb_protocol_handler.c +++ b/right/src/usb_protocol_handler.c @@ -24,12 +24,16 @@ void setGenericError(void) setError(UsbResponse_GenericError); } -// Set a single byte as the response. void SetResponseByte(uint8_t response) { GenericHidOutBuffer[1] = response; } +void SetResponseWord(uint16_t response) +{ + *((uint16_t*)(GenericHidOutBuffer+1)) = response; +} + // Per command protocol command handlers void getSystemProperty(void) { @@ -48,6 +52,12 @@ void getSystemProperty(void) { case SystemPropertyId_FirmwareVersion: SetResponseByte(SYSTEM_PROPERTY_FIRMWARE_VERSION); break; + case SystemPropertyId_HardwareConfigSize: + SetResponseWord(HARDWARE_CONFIG_SIZE); + break; + case SystemPropertyId_UserConfigSize: + SetResponseWord(USER_CONFIG_SIZE); + break; default: setGenericError(); break;