aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/device.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/device.rs b/src/device.rs
index b25cfb7..8f6f6ef 100644
--- a/src/device.rs
+++ b/src/device.rs
@@ -3,6 +3,7 @@
use serde::{Deserialize, Serialize};
use serde_big_array::big_array;
+use static_assertions::assert_eq_size;
use usb_device::bus::{UsbBus, UsbBusAllocator};
use usb_device::device::{UsbDevice, UsbDeviceBuilder, UsbVidPid};
@@ -65,6 +66,8 @@ struct Request {
pub crc: u32,
}
+assert_eq_size!(request; [u8; REPORT_LEN], Request);
+
#[derive(Serialize)]
struct Response {
pub device_status: DeviceStatus,
@@ -76,6 +79,8 @@ struct Response {
pub crc: u32,
}
+assert_eq_size!(response; [u8; REPORT_LEN], Response);
+
impl Response {
fn new(device_status: DeviceStatus, command_id: u8, last_crc: u32) -> Response {
Response {