@@ -1452,15 +1452,9 @@ char* create_port_status_json(int port, int port_status, const struct descriptor
1452
1452
char * flags_json = create_status_flags_json (port_status );
1453
1453
char * hr_json = create_human_readable_json (port_status );
1454
1454
1455
- // For USB3 hubs, get link state and port speed capability
1455
+ // For USB3 hubs, get link state
1456
1456
const char * link_state_str = NULL ;
1457
- const char * port_speed_str = NULL ;
1458
1457
if (port_status & USB_SS_PORT_STAT_POWER ) {
1459
- // Check port speed capability
1460
- if ((port_status & USB_SS_PORT_STAT_SPEED ) == USB_PORT_STAT_SPEED_5GBPS ) {
1461
- port_speed_str = "5gbps" ;
1462
- }
1463
-
1464
1458
int link_state = port_status & USB_PORT_STAT_LINK_STATE ;
1465
1459
switch (link_state ) {
1466
1460
case USB_SS_PORT_LS_U0 : link_state_str = "U0" ; break ;
@@ -1526,7 +1520,7 @@ char* create_port_status_json(int port, int port_status, const struct descriptor
1526
1520
1527
1521
// Return port with basic device info
1528
1522
// Note: even when ignored, parameters still count towards total
1529
- return mkjson (MKJSON_OBJ , 16 ,
1523
+ return mkjson (MKJSON_OBJ , 17 ,
1530
1524
MKJSON_INT , "port" , port ,
1531
1525
MKJSON_STRING , "status" , status_hex ,
1532
1526
MKJSON_JSON_FREE , "flags" , flags_json ,
@@ -1541,6 +1535,7 @@ char* create_port_status_json(int port, int port_status, const struct descriptor
1541
1535
MKJSON_STRING , "usb_version" , usb_version ,
1542
1536
MKJSON_STRING , "device_version" , device_version ,
1543
1537
MKJSON_INT , "nconfigs" , desc .bNumConfigurations ,
1538
+ ds -> serial [0 ] ? MKJSON_STRING : MKJSON_IGN_STRING , "serial" , ds -> serial ,
1544
1539
is_mass_storage ? MKJSON_BOOL : MKJSON_IGN_BOOL , "is_mass_storage" , is_mass_storage ,
1545
1540
MKJSON_STRING , "description" , ds -> description [0 ] ? ds -> description : NULL
1546
1541
);
0 commit comments