@@ -1545,15 +1545,9 @@ char* create_port_status_json(int port, int port_status, const struct descriptor
1545
1545
char * flags_json = create_status_flags_json (port_status );
1546
1546
char * hr_json = create_human_readable_json (port_status );
1547
1547
1548
- // For USB3 hubs, get link state and port speed capability
1548
+ // For USB3 hubs, get link state
1549
1549
const char * link_state_str = NULL ;
1550
- const char * port_speed_str = NULL ;
1551
1550
if (port_status & USB_SS_PORT_STAT_POWER ) {
1552
- // Check port speed capability
1553
- if ((port_status & USB_SS_PORT_STAT_SPEED ) == USB_PORT_STAT_SPEED_5GBPS ) {
1554
- port_speed_str = "5gbps" ;
1555
- }
1556
-
1557
1551
int link_state = port_status & USB_PORT_STAT_LINK_STATE ;
1558
1552
switch (link_state ) {
1559
1553
case USB_SS_PORT_LS_U0 : link_state_str = "U0" ; break ;
@@ -1619,7 +1613,7 @@ char* create_port_status_json(int port, int port_status, const struct descriptor
1619
1613
1620
1614
// Return port with basic device info
1621
1615
// Note: even when ignored, parameters still count towards total
1622
- return mkjson (MKJSON_OBJ , 16 ,
1616
+ return mkjson (MKJSON_OBJ , 17 ,
1623
1617
MKJSON_INT , "port" , port ,
1624
1618
MKJSON_STRING , "status" , status_hex ,
1625
1619
MKJSON_JSON_FREE , "flags" , flags_json ,
@@ -1634,6 +1628,7 @@ char* create_port_status_json(int port, int port_status, const struct descriptor
1634
1628
MKJSON_STRING , "usb_version" , usb_version ,
1635
1629
MKJSON_STRING , "device_version" , device_version ,
1636
1630
MKJSON_INT , "nconfigs" , desc .bNumConfigurations ,
1631
+ ds -> serial [0 ] ? MKJSON_STRING : MKJSON_IGN_STRING , "serial" , ds -> serial ,
1637
1632
is_mass_storage ? MKJSON_BOOL : MKJSON_IGN_BOOL , "is_mass_storage" , is_mass_storage ,
1638
1633
MKJSON_STRING , "description" , ds -> description [0 ] ? ds -> description : NULL
1639
1634
);
0 commit comments