I'm trying to reverse engineer this communication protocol. It goes to a device with 15 buttons, and 15 80x80 LED screens. All I have are some wireshark logs that show successful communication to the device. Can you create a nice, readable rust program that shows an example of communication to this device? It's ok if it just replays the wireshark logs, more importantly it needs to be readable and functional enough to help the reverse engineering efort. 

// The wireshark logs //

"No.","Time","Source","Destination","Protocol","Length","Info"
"1","0.000000","host","3.1.0","USB","36","GET DESCRIPTOR Request DEVICE"
"2","0.000000","3.1.0","host","USB","46","GET DESCRIPTOR Response DEVICE"
"3","0.000000","host","3.1.0","USB","36","GET DESCRIPTOR Request CONFIGURATION"
"4","0.000000","3.1.0","host","USB","319","GET DESCRIPTOR Response CONFIGURATION"
"5","0.000000","host","3.1.0","USB","36","SET CONFIGURATION Request"
"6","0.000000","3.1.0","host","USB","28","SET CONFIGURATION Response"
"7","7.827838","host","3.1.1","USB","27","URB_BULK in"
"8","7.827866","host","3.1.2","USB","27","URB_INTERRUPT in"
"9","7.827892","host","3.1.0","USBCOM","36","GET LINE CODING Request"
"10","7.828076","3.1.0","host","USBCOM","35","GET LINE CODING Response"
"11","7.828097","host","3.1.0","USBCOM","36","GET LINE CODING Request"
"12","7.828449","3.1.0","host","USBCOM","35","GET LINE CODING Response"
"13","7.828540","3.1.1","host","USB","27","URB_BULK in"
"14","7.828617","3.1.2","host","USB","27","URB_INTERRUPT in"
"15","7.828642","host","3.1.0","USBCOM","36","SET CONTROL LINE STATE Request"
"16","7.828701","3.1.0","host","USB","28","URB_CONTROL out"
"17","7.844910","host","3.1.1","USB","27","URB_BULK in"
"18","7.844931","host","3.1.2","USB","27","URB_INTERRUPT in"
"19","7.844969","host","3.1.0","USBCOM","36","GET LINE CODING Request"
"20","7.845202","3.1.0","host","USBCOM","35","GET LINE CODING Response"
"21","7.845219","host","3.1.0","USBCOM","36","GET LINE CODING Request"
"22","7.845574","3.1.0","host","USBCOM","35","GET LINE CODING Response"
"23","7.845614","host","3.1.0","USBCOM","36","GET LINE CODING Request"
"24","7.845951","3.1.0","host","USBCOM","35","GET LINE CODING Response"
"25","7.845967","host","3.1.0","USBCOM","36","GET LINE CODING Request"
"26","7.846319","3.1.0","host","USBCOM","35","GET LINE CODING Response"
"27","7.846340","host","3.1.0","USBCOM","43","SET LINE CODING Request"
"28","7.846953","3.1.0","host","USB","28","URB_CONTROL out"
"29","7.846966","host","3.1.0","USBCOM","36","GET LINE CODING Request"
"30","7.847321","3.1.0","host","USBCOM","35","GET LINE CODING Response"
"31","7.847341","host","3.1.0","USBCOM","36","SET CONTROL LINE STATE Request"
"32","7.847575","3.1.0","host","USB","28","URB_CONTROL out"
"33","7.847592","host","3.1.0","USBCOM","43","SET LINE CODING Request"
"34","7.848203","3.1.0","host","USB","28","URB_CONTROL out"
"35","7.848214","host","3.1.0","USBCOM","36","GET LINE CODING Request"
"36","7.848572","3.1.0","host","USBCOM","35","GET LINE CODING Response"
"37","7.848593","host","3.1.0","USBCOM","36","GET LINE CODING Request"
"38","7.848949","3.1.0","host","USBCOM","35","GET LINE CODING Response"
"39","7.848965","host","3.1.0","USBCOM","36","GET LINE CODING Request"
"40","7.849322","3.1.0","host","USBCOM","35","GET LINE CODING Response"
"41","7.849350","host","3.1.0","USBCOM","43","SET LINE CODING Request"
"42","7.849950","3.1.0","host","USB","28","URB_CONTROL out"
"43","7.849959","host","3.1.0","USBCOM","36","GET LINE CODING Request"
"44","7.850321","3.1.0","host","USBCOM","35","GET LINE CODING Response"
"45","7.850335","host","3.1.0","USBCOM","36","SET CONTROL LINE STATE Request"
"46","7.850571","3.1.0","host","USB","28","URB_CONTROL out"
"47","7.850582","host","3.1.0","USBCOM","43","SET LINE CODING Request"
"48","7.851199","3.1.0","host","USB","28","URB_CONTROL out"
"49","7.851208","host","3.1.0","USBCOM","36","GET LINE CODING Request"
"50","7.851571","3.1.0","host","USBCOM","35","GET LINE CODING Response"
"51","7.851592","host","3.1.0","USBCOM","36","SET CONTROL LINE STATE Request"
"52","7.851824","3.1.0","host","USB","28","URB_CONTROL out"
"53","7.852354","host","3.1.0","USBCOM","36","SEND BREAK Request"
"54","7.852449","3.1.0","host","USB","28","URB_CONTROL out"
"55","7.873691","host","3.1.0","USBCOM","36","SEND BREAK Request"
"56","7.873826","3.1.0","host","USB","28","URB_CONTROL out"
"57","7.982270","host","3.1.0","USBCOM","36","SEND BREAK Request"
"58","7.982456","3.1.0","host","USB","28","URB_CONTROL out"
"59","8.091278","host","3.1.0","USBCOM","36","SEND BREAK Request"
"60","8.091457","3.1.0","host","USB","28","URB_CONTROL out"
"61","8.094230","host","3.1.1","USBCOM","141","URB_BULK out"
"62","8.094299","3.1.1","host","USB","27","URB_BULK out"
"63","8.094495","3.1.1","host","USBCOM","156","URB_BULK in"
"64","8.094525","host","3.1.1","USB","27","URB_BULK in"
"65","8.094560","3.1.1","host","USBCOM","29","URB_BULK in"
"66","8.094564","host","3.1.1","USB","27","URB_BULK in"
"67","8.094600","3.1.1","host","USBCOM","56","URB_BULK in"
"68","8.094607","host","3.1.1","USB","27","URB_BULK in"
"69","8.094644","3.1.1","host","USBCOM","29","URB_BULK in"
"70","8.094648","host","3.1.1","USB","27","URB_BULK in"
"71","8.094688","3.1.1","host","USBCOM","51","URB_BULK in"
"72","8.094697","host","3.1.1","USB","27","URB_BULK in"
"73","8.094734","3.1.1","host","USBCOM","29","URB_BULK in"
"74","8.094743","host","3.1.1","USB","27","URB_BULK in"
"75","8.094772","3.1.1","host","USBCOM","50","URB_BULK in"
"76","8.094779","host","3.1.1","USB","27","URB_BULK in"
"77","8.094813","3.1.1","host","USBCOM","29","URB_BULK in"
"78","8.094821","host","3.1.1","USB","27","URB_BULK in"
"79","8.094853","3.1.1","host","USBCOM","75","URB_BULK in"
"80","8.094861","host","3.1.1","USB","27","URB_BULK in"
"81","8.094894","3.1.1","host","USBCOM","29","URB_BULK in"
"82","8.094901","host","3.1.1","USB","27","URB_BULK in"
"83","8.094939","3.1.1","host","USBCOM","32","URB_BULK in"
"84","8.094944","host","3.1.1","USB","27","URB_BULK in"
"85","8.094979","3.1.1","host","USBCOM","29","URB_BULK in"
"86","8.094987","host","3.1.1","USB","27","URB_BULK in"
"87","8.095022","3.1.1","host","USBCOM","58","URB_BULK in"
"88","8.095029","host","3.1.1","USB","27","URB_BULK in"
"89","8.095064","3.1.1","host","USBCOM","29","URB_BULK in"
"90","8.095070","host","3.1.1","USB","27","URB_BULK in"
"91","8.095102","3.1.1","host","USBCOM","55","URB_BULK in"
"92","8.095107","host","3.1.1","USB","27","URB_BULK in"
"93","8.104238","host","3.1.1","USBCOM","33","URB_BULK out"
"94","8.104284","3.1.1","host","USB","27","URB_BULK out"
"95","8.104323","host","3.1.1","USBCOM","46","URB_BULK out"
"96","8.104339","3.1.1","host","USB","27","URB_BULK out"
"97","8.104381","3.1.1","host","USBCOM","29","URB_BULK in"
"98","8.104391","host","3.1.1","USB","27","URB_BULK in"
"99","8.104423","3.1.1","host","USBCOM","46","URB_BULK in"
"100","8.104428","host","3.1.1","USB","27","URB_BULK in"
"101","8.107755","host","3.1.1","USBCOM","33","URB_BULK out"
"102","8.107811","3.1.1","host","USB","27","URB_BULK out"
"103","8.107840","host","3.1.1","USBCOM","46","URB_BULK out"
"104","8.107855","3.1.1","host","USB","27","URB_BULK out"
"105","8.107905","3.1.1","host","USBCOM","29","URB_BULK in"
"106","8.107914","host","3.1.1","USB","27","URB_BULK in"
"107","8.107948","3.1.1","host","USBCOM","46","URB_BULK in"
"108","8.107956","host","3.1.1","USB","27","URB_BULK in"
"109","8.115181","host","3.1.1","USBCOM","33","URB_BULK out"
"110","8.115224","3.1.1","host","USB","27","URB_BULK out"
"111","8.115278","host","3.1.1","USBCOM","30","URB_BULK out"
"112","8.115300","3.1.1","host","USB","27","URB_BULK out"
"113","8.115330","3.1.1","host","USBCOM","29","URB_BULK in"
"114","8.115340","host","3.1.1","USB","27","URB_BULK in"
"115","8.115379","3.1.1","host","USBCOM","39","URB_BULK in"
"116","8.115384","host","3.1.1","USB","27","URB_BULK in"
"117","8.116179","host","3.1.1","USBCOM","33","URB_BULK out"
"118","8.116214","3.1.1","host","USB","27","URB_BULK out"
"119","8.116246","host","3.1.1","USBCOM","30","URB_BULK out"
"120","8.116259","3.1.1","host","USB","27","URB_BULK out"
"121","8.116292","3.1.1","host","USBCOM","29","URB_BULK in"
"122","8.116298","host","3.1.1","USB","27","URB_BULK in"
"123","8.116341","3.1.1","host","USBCOM","51","URB_BULK in"
"124","8.116347","host","3.1.1","USB","27","URB_BULK in"
"125","8.143966","host","3.1.1","USBCOM","33","URB_BULK out"
"126","8.144013","3.1.1","host","USB","27","URB_BULK out"
"127","8.144071","host","3.1.1","USBCOM","30","URB_BULK out"
"128","8.144103","3.1.1","host","USB","27","URB_BULK out"
"129","8.144125","3.1.1","host","USBCOM","29","URB_BULK in"
"130","8.144141","host","3.1.1","USB","27","URB_BULK in"
"131","8.144171","3.1.1","host","USBCOM","34","URB_BULK in"
"132","8.144175","host","3.1.1","USB","27","URB_BULK in"
"133","8.144670","host","3.1.1","USBCOM","33","URB_BULK out"
"134","8.144701","3.1.1","host","USB","27","URB_BULK out"
"135","8.144748","host","3.1.1","USBCOM","30","URB_BULK out"
"136","8.144767","3.1.1","host","USB","27","URB_BULK out"
"137","8.144801","3.1.1","host","USBCOM","29","URB_BULK in"
"138","8.144808","host","3.1.1","USB","27","URB_BULK in"
"139","8.144840","3.1.1","host","USBCOM","58","URB_BULK in"
"140","8.144846","host","3.1.1","USB","27","URB_BULK in"
"141","8.145832","host","3.1.1","USBCOM","33","URB_BULK out"
"142","8.145860","3.1.1","host","USB","27","URB_BULK out"
"143","8.145895","host","3.1.1","USBCOM","31","URB_BULK out"
"144","8.145917","3.1.1","host","USB","27","URB_BULK out"
"145","8.145954","3.1.1","host","USBCOM","29","URB_BULK in"
"146","8.145961","host","3.1.1","USB","27","URB_BULK in"
"147","8.146003","3.1.1","host","USBCOM","35","URB_BULK in"
"148","8.146008","host","3.1.1","USB","27","URB_BULK in"
"149","8.146632","host","3.1.1","USBCOM","33","URB_BULK out"
"150","8.146680","3.1.1","host","USB","27","URB_BULK out"
"151","8.146706","host","3.1.1","USBCOM","31","URB_BULK out"
"152","8.146730","3.1.1","host","USB","27","URB_BULK out"
"153","8.146754","3.1.1","host","USBCOM","29","URB_BULK in"
"154","8.146759","host","3.1.1","USB","27","URB_BULK in"
"155","8.146800","3.1.1","host","USBCOM","35","URB_BULK in"
"156","8.146805","host","3.1.1","USB","27","URB_BULK in"
"157","8.146950","host","3.1.1","USBCOM","33","URB_BULK out"
"158","8.146968","3.1.1","host","USB","27","URB_BULK out"
"159","8.147001","host","3.1.1","USBCOM","31","URB_BULK out"
"160","8.147019","3.1.1","host","USB","27","URB_BULK out"
"161","8.147058","3.1.1","host","USBCOM","29","URB_BULK in"
"162","8.147065","host","3.1.1","USB","27","URB_BULK in"
"163","8.147101","3.1.1","host","USBCOM","35","URB_BULK in"
"164","8.147107","host","3.1.1","USB","27","URB_BULK in"
"165","8.147241","host","3.1.1","USBCOM","33","URB_BULK out"
"166","8.147263","3.1.1","host","USB","27","URB_BULK out"
"167","8.147292","host","3.1.1","USBCOM","31","URB_BULK out"
"168","8.147311","3.1.1","host","USB","27","URB_BULK out"
"169","8.147344","3.1.1","host","USBCOM","29","URB_BULK in"
"170","8.147350","host","3.1.1","USB","27","URB_BULK in"
"171","8.147390","3.1.1","host","USBCOM","35","URB_BULK in"
"172","8.147397","host","3.1.1","USB","27","URB_BULK in"
"173","8.147898","host","3.1.1","USBCOM","33","URB_BULK out"
"174","8.147929","3.1.1","host","USB","27","URB_BULK out"
"175","8.147963","host","3.1.1","USBCOM","30","URB_BULK out"
"176","8.147982","3.1.1","host","USB","27","URB_BULK out"
"177","8.148035","3.1.1","host","USBCOM","31","URB_BULK in"
"178","8.148044","host","3.1.1","USB","27","URB_BULK in"
"179","8.148082","3.1.1","host","USBCOM","281","URB_BULK in"
"180","8.148089","host","3.1.1","USB","27","URB_BULK in"
"181","8.148127","3.1.1","host","USBCOM","31","URB_BULK in"
"182","8.148135","host","3.1.1","USB","27","URB_BULK in"
"183","8.148169","3.1.1","host","USBCOM","281","URB_BULK in"
"184","8.148178","host","3.1.1","USB","27","URB_BULK in"
"185","8.148206","3.1.1","host","USBCOM","31","URB_BULK in"
"186","8.148214","host","3.1.1","USB","27","URB_BULK in"
"187","8.148254","3.1.1","host","USBCOM","281","URB_BULK in"
"188","8.148261","host","3.1.1","USB","27","URB_BULK in"
"189","8.148294","3.1.1","host","USBCOM","31","URB_BULK in"
"190","8.148301","host","3.1.1","USB","27","URB_BULK in"
"191","8.148331","3.1.1","host","USBCOM","281","URB_BULK in"
"192","8.148337","host","3.1.1","USB","27","URB_BULK in"
"193","8.151686","host","3.1.1","USBCOM","33","URB_BULK out"
"194","8.151724","3.1.1","host","USB","27","URB_BULK out"
"195","8.151757","host","3.1.1","USBCOM","30","URB_BULK out"
"196","8.151771","3.1.1","host","USB","27","URB_BULK out"
"197","8.162377","3.1.1","host","USBCOM","29","URB_BULK in"
"198","8.162391","host","3.1.1","USB","27","URB_BULK in"
"199","8.162418","3.1.1","host","USBCOM","31","URB_BULK in"
"200","8.162424","host","3.1.1","USB","27","URB_BULK in"
"201","8.162554","host","3.1.1","USBCOM","33","URB_BULK out"
"202","8.162584","3.1.1","host","USB","27","URB_BULK out"
"203","8.162620","host","3.1.1","USBCOM","31","URB_BULK out"
"204","8.162640","3.1.1","host","USB","27","URB_BULK out"
"205","8.162679","3.1.1","host","USBCOM","29","URB_BULK in"
"206","8.162686","host","3.1.1","USB","27","URB_BULK in"
"207","8.162719","3.1.1","host","USBCOM","31","URB_BULK in"
"208","8.162724","host","3.1.1","USB","27","URB_BULK in"
"209","8.278383","host","3.1.1","USBCOM","33","URB_BULK out"
"210","8.278441","3.1.1","host","USB","27","URB_BULK out"
"211","8.278494","host","3.1.1","USBCOM","31","URB_BULK out"
"212","8.278521","3.1.1","host","USB","27","URB_BULK out"
"213","8.278553","3.1.1","host","USBCOM","29","URB_BULK in"
"214","8.278564","host","3.1.1","USB","27","URB_BULK in"
"215","8.278596","3.1.1","host","USBCOM","31","URB_BULK in"
"216","8.278602","host","3.1.1","USB","27","URB_BULK in"
"217","16.941001","host","3.1.1","USBCOM","41","URB_BULK out"
"218","16.941059","3.1.1","host","USB","27","URB_BULK out"
"219","16.941102","host","3.1.1","USBCOM","40","URB_BULK out"
"220","16.941123","3.1.1","host","USB","27","URB_BULK out"
"221","16.941231","host","3.1.1","USBCOM","388827","URB_BULK out"
"222","16.965079","3.1.1","host","USB","27","URB_BULK out"
"223","16.965383","host","3.1.1","USBCOM","33","URB_BULK out"
"224","16.965449","3.1.1","host","USB","27","URB_BULK out"
"225","16.965508","host","3.1.1","USBCOM","32","URB_BULK out"
"226","16.965676","3.1.1","host","USB","27","URB_BULK out"
"227","16.965709","3.1.1","host","USBCOM","29","URB_BULK in"
"228","16.965721","host","3.1.1","USB","27","URB_BULK in"
"229","16.965751","3.1.1","host","USBCOM","31","URB_BULK in"
"230","16.965756","host","3.1.1","USB","27","URB_BULK in"
"231","16.965788","3.1.1","host","USBCOM","29","URB_BULK in"
"232","16.965793","host","3.1.1","USB","27","URB_BULK in"
"233","16.965836","3.1.1","host","USBCOM","31","URB_BULK in"
"234","16.965844","host","3.1.1","USB","27","URB_BULK in"
"235","17.119740","host","3.1.1","USBCOM","35","URB_BULK out"
"236","17.119897","3.1.1","host","USB","27","URB_BULK out"
"237","17.119970","host","3.1.1","USBCOM","40","URB_BULK out"
"238","17.120005","3.1.1","host","USB","27","URB_BULK out"
"239","17.120058","host","3.1.1","USBCOM","15579","URB_BULK out"
"240","17.121011","3.1.1","host","USB","27","URB_BULK out"
"241","17.121069","host","3.1.1","USBCOM","33","URB_BULK out"
"242","17.121109","3.1.1","host","USBCOM","29","URB_BULK in"
"243","17.121129","3.1.1","host","USB","27","URB_BULK out"
"244","17.121136","host","3.1.1","USB","27","URB_BULK in"
"245","17.121151","3.1.1","host","USBCOM","31","URB_BULK in"
"246","17.121155","host","3.1.1","USB","27","URB_BULK in"
"247","17.121169","host","3.1.1","USBCOM","32","URB_BULK out"
"248","17.121194","3.1.1","host","USB","27","URB_BULK out"
"249","17.121227","3.1.1","host","USBCOM","29","URB_BULK in"
"250","17.121234","host","3.1.1","USB","27","URB_BULK in"
"251","17.121271","3.1.1","host","USBCOM","31","URB_BULK in"
"252","17.121280","host","3.1.1","USB","27","URB_BULK in"
"253","18.131971","host","3.1.1","USBCOM","35","URB_BULK out"
"254","18.132039","3.1.1","host","USB","27","URB_BULK out"
"255","18.132093","host","3.1.1","USBCOM","40","URB_BULK out"
"256","18.132127","3.1.1","host","USB","27","URB_BULK out"
"257","18.132176","host","3.1.1","USBCOM","15579","URB_BULK out"
"258","18.133087","3.1.1","host","USB","27","URB_BULK out"
"259","18.133155","host","3.1.1","USBCOM","33","URB_BULK out"
"260","18.133183","3.1.1","host","USBCOM","29","URB_BULK in"
"261","18.133201","3.1.1","host","USB","27","URB_BULK out"
"262","18.133209","host","3.1.1","USB","27","URB_BULK in"
"263","18.133229","3.1.1","host","USBCOM","31","URB_BULK in"
"264","18.133234","host","3.1.1","USB","27","URB_BULK in"
"265","18.133244","host","3.1.1","USBCOM","32","URB_BULK out"
"266","18.133265","3.1.1","host","USB","27","URB_BULK out"
"267","18.133300","3.1.1","host","USBCOM","29","URB_BULK in"
"268","18.133308","host","3.1.1","USB","27","URB_BULK in"
"269","18.133342","3.1.1","host","USBCOM","31","URB_BULK in"
"270","18.133350","host","3.1.1","USB","27","URB_BULK in"
"271","18.249030","host","3.1.1","USBCOM","41","URB_BULK out"
"272","18.249084","3.1.1","host","USB","27","URB_BULK out"
"273","18.249125","host","3.1.1","USBCOM","40","URB_BULK out"
"274","18.249140","3.1.1","host","USB","27","URB_BULK out"
"275","18.249230","host","3.1.1","USBCOM","388827","URB_BULK out"
"276","18.271391","3.1.1","host","USB","27","URB_BULK out"
"277","18.271470","host","3.1.1","USBCOM","33","URB_BULK out"
"278","18.271487","3.1.1","host","USB","27","URB_BULK out"
"279","18.271550","host","3.1.1","USBCOM","32","URB_BULK out"
"280","18.271998","3.1.1","host","USB","27","URB_BULK out"
"281","18.272025","3.1.1","host","USBCOM","29","URB_BULK in"
"282","18.272039","host","3.1.1","USB","27","URB_BULK in"
"283","18.272063","3.1.1","host","USBCOM","31","URB_BULK in"
"284","18.272082","host","3.1.1","USB","27","URB_BULK in"
"285","18.272106","3.1.1","host","USBCOM","29","URB_BULK in"
"286","18.272113","host","3.1.1","USB","27","URB_BULK in"
"287","18.272233","3.1.1","host","USBCOM","31","URB_BULK in"
"288","18.272241","host","3.1.1","USB","27","URB_BULK in"
"289","19.144587","host","3.1.1","USBCOM","35","URB_BULK out"
"290","19.144645","3.1.1","host","USB","27","URB_BULK out"
"291","19.144680","host","3.1.1","USBCOM","40","URB_BULK out"
"292","19.144697","3.1.1","host","USB","27","URB_BULK out"
"293","19.144717","host","3.1.1","USBCOM","15579","URB_BULK out"
"294","19.145675","3.1.1","host","USB","27","URB_BULK out"
"295","19.145715","host","3.1.1","USBCOM","33","URB_BULK out"
"296","19.145732","3.1.1","host","USB","27","URB_BULK out"
"297","19.145750","host","3.1.1","USBCOM","32","URB_BULK out"
"298","19.145773","3.1.1","host","USB","27","URB_BULK out"
"299","19.145778","3.1.1","host","USBCOM","29","URB_BULK in"
"300","19.145789","host","3.1.1","USB","27","URB_BULK in"
"301","19.145823","3.1.1","host","USBCOM","31","URB_BULK in"
"302","19.145828","host","3.1.1","USB","27","URB_BULK in"
"303","19.145867","3.1.1","host","USBCOM","29","URB_BULK in"
"304","19.145871","host","3.1.1","USB","27","URB_BULK in"
"305","19.145908","3.1.1","host","USBCOM","31","URB_BULK in"
"306","19.145914","host","3.1.1","USB","27","URB_BULK in"
"307","19.258295","host","3.1.1","USBCOM","41","URB_BULK out"
"308","19.258358","3.1.1","host","USB","27","URB_BULK out"
"309","19.258406","host","3.1.1","USBCOM","40","URB_BULK out"
"310","19.258428","3.1.1","host","USB","27","URB_BULK out"
"311","19.258486","host","3.1.1","USBCOM","388827","URB_BULK out"
"312","19.282109","3.1.1","host","USB","27","URB_BULK out"
"313","19.282177","host","3.1.1","USBCOM","33","URB_BULK out"
"314","19.282206","3.1.1","host","USB","27","URB_BULK out"
"315","19.282228","host","3.1.1","USBCOM","32","URB_BULK out"
"316","19.282722","3.1.1","host","USB","27","URB_BULK out"
"317","19.282771","3.1.1","host","USBCOM","29","URB_BULK in"
"318","19.282785","host","3.1.1","USB","27","URB_BULK in"
"319","19.282813","3.1.1","host","USBCOM","31","URB_BULK in"
"320","19.282817","host","3.1.1","USB","27","URB_BULK in"
"321","19.282851","3.1.1","host","USBCOM","29","URB_BULK in"
"322","19.282856","host","3.1.1","USB","27","URB_BULK in"
"323","19.282900","3.1.1","host","USBCOM","31","URB_BULK in"
"324","19.282904","host","3.1.1","USB","27","URB_BULK in"
"325","20.153812","host","3.1.1","USBCOM","35","URB_BULK out"
"326","20.154057","3.1.1","host","USB","27","URB_BULK out"
"327","20.154099","host","3.1.1","USBCOM","40","URB_BULK out"
"328","20.154122","3.1.1","host","USB","27","URB_BULK out"
"329","20.154144","host","3.1.1","USBCOM","15579","URB_BULK out"
"330","20.155067","3.1.1","host","USB","27","URB_BULK out"
"331","20.155097","host","3.1.1","USBCOM","33","URB_BULK out"
"332","20.155118","3.1.1","host","USB","27","URB_BULK out"
"333","20.155131","host","3.1.1","USBCOM","32","URB_BULK out"
"334","20.155161","3.1.1","host","USB","27","URB_BULK out"
"335","20.155183","3.1.1","host","USBCOM","29","URB_BULK in"
"336","20.155194","host","3.1.1","USB","27","URB_BULK in"
"337","20.155225","3.1.1","host","USBCOM","31","URB_BULK in"
"338","20.155231","host","3.1.1","USB","27","URB_BULK in"
"339","20.155262","3.1.1","host","USBCOM","29","URB_BULK in"
"340","20.155266","host","3.1.1","USB","27","URB_BULK in"
"341","20.155305","3.1.1","host","USBCOM","31","URB_BULK in"
"342","20.155310","host","3.1.1","USB","27","URB_BULK in"
"343","21.165669","host","3.1.1","USBCOM","35","URB_BULK out"
"344","21.165732","3.1.1","host","USB","27","URB_BULK out"
"345","21.165769","host","3.1.1","USBCOM","40","URB_BULK out"
"346","21.165786","3.1.1","host","USB","27","URB_BULK out"
"347","21.165821","host","3.1.1","USBCOM","15579","URB_BULK out"
"348","21.166773","3.1.1","host","USB","27","URB_BULK out"
"349","21.166819","host","3.1.1","USBCOM","33","URB_BULK out"
"350","21.166844","3.1.1","host","USB","27","URB_BULK out"
"351","21.166860","host","3.1.1","USBCOM","32","URB_BULK out"
"352","21.166878","3.1.1","host","USBCOM","29","URB_BULK in"
"353","21.166879","3.1.1","host","USB","27","URB_BULK out"
"354","21.166891","host","3.1.1","USB","27","URB_BULK in"
"355","21.166923","3.1.1","host","USBCOM","31","URB_BULK in"
"356","21.166929","host","3.1.1","USB","27","URB_BULK in"
"357","21.166963","3.1.1","host","USBCOM","29","URB_BULK in"
"358","21.166968","host","3.1.1","USB","27","URB_BULK in"
"359","21.167011","3.1.1","host","USBCOM","31","URB_BULK in"
"360","21.167017","host","3.1.1","USB","27","URB_BULK in"
"361","22.177455","host","3.1.1","USBCOM","35","URB_BULK out"
"362","22.177518","3.1.1","host","USB","27","URB_BULK out"
"363","22.177557","host","3.1.1","USBCOM","40","URB_BULK out"
"364","22.177577","3.1.1","host","USB","27","URB_BULK out"
"365","22.177598","host","3.1.1","USBCOM","15579","URB_BULK out"
"366","22.178528","3.1.1","host","USB","27","URB_BULK out"
"367","22.178582","host","3.1.1","USBCOM","33","URB_BULK out"
"368","22.178613","3.1.1","host","USB","27","URB_BULK out"
"369","22.178629","host","3.1.1","USBCOM","32","URB_BULK out"
"370","22.178636","3.1.1","host","USBCOM","29","URB_BULK in"
"371","22.178649","host","3.1.1","USB","27","URB_BULK in"
"372","22.178663","3.1.1","host","USB","27","URB_BULK out"
"373","22.178684","3.1.1","host","USBCOM","31","URB_BULK in"
"374","22.178690","host","3.1.1","USB","27","URB_BULK in"
"375","22.178719","3.1.1","host","USBCOM","29","URB_BULK in"
"376","22.178724","host","3.1.1","USB","27","URB_BULK in"
"377","22.178758","3.1.1","host","USBCOM","31","URB_BULK in"
"378","22.178764","host","3.1.1","USB","27","URB_BULK in"
"379","22.843739","host","3.1.1","USBCOM","33","URB_BULK out"
"380","22.843815","3.1.1","host","USB","27","URB_BULK out"
"381","22.843861","host","3.1.1","USBCOM","30","URB_BULK out"
"382","22.843883","3.1.1","host","USB","27","URB_BULK out"
"383","22.854493","3.1.1","host","USBCOM","29","URB_BULK in"
"384","22.854528","host","3.1.1","USB","27","URB_BULK in"
"385","22.854550","3.1.1","host","USBCOM","31","URB_BULK in"
"386","22.854556","host","3.1.1","USB","27","URB_BULK in"
"387","22.854710","host","3.1.1","USBCOM","33","URB_BULK out"
"388","22.854742","3.1.1","host","USB","27","URB_BULK out"
"389","22.854772","host","3.1.1","USBCOM","31","URB_BULK out"
"390","22.854788","3.1.1","host","USB","27","URB_BULK out"
"391","22.854827","3.1.1","host","USBCOM","29","URB_BULK in"
"392","22.854835","host","3.1.1","USB","27","URB_BULK in"
"393","22.854875","3.1.1","host","USBCOM","31","URB_BULK in"
"394","22.854881","host","3.1.1","USB","27","URB_BULK in"
"395","22.969347","host","3.1.0","USBCOM","36","SEND BREAK Request"
"396","22.969463","3.1.0","host","USB","28","URB_CONTROL out"
"397","22.983221","host","3.1.0","USBCOM","36","SEND BREAK Request"
"398","22.983349","3.1.0","host","USB","28","URB_CONTROL out"
"399","23.094059","host","3.1.0","USBCOM","36","SEND BREAK Request"
"400","23.094213","3.1.0","host","USB","28","URB_CONTROL out"
"401","23.204050","host","3.1.0","USBCOM","36","SEND BREAK Request"
"402","23.204215","3.1.0","host","USB","28","URB_CONTROL out"
"403","23.204506","host","3.1.0","USBCOM","36","SET CONTROL LINE STATE Request"
"404","23.204583","3.1.0","host","USB","28","URB_CONTROL out"
"405","23.204690","3.1.1","host","USB","27","URB_BULK in"
"406","23.204783","3.1.2","host","USB","27","URB_INTERRUPT in"
"407","23.204809","host","3.1.0","USBCOM","36","SET CONTROL LINE STATE Request"
"408","23.204831","3.1.0","host","USB","28","URB_CONTROL out"

// Some rust code containing a few constants I've already figured out //

use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, PartialEq)]
#[repr(u16)]
pub enum MessageHeader {
    Confirm = 0x0302,
    SerialOut = 0x0303,
    VersionOut = 0x0307,
    Tick = 0x0400,
    SetBrightness = 0x0409,
    ConfirmFrameBuffer = 0x0410,
    ButtonPress = 0x0500,
    Reset = 0x0506,
    DrawOut = 0x050F,
    DrawIn = 0x040F,
    SetColor = 0x0702,
    VersionIn = 0x0c07,
    MCU = 0x180d,
    SerialIn = 0x1f03,
    WriteFrameBuffer = 0xff10,
}

impl TryFrom<u16> for MessageHeader 
{
    type Error = u16;
    fn try_from(value: u16) -> Result<Self, Self::Error> 
    {
        let result = match value 
        {
            0x0302 => Ok(MessageHeader::Confirm),
            0x0303 => Ok(MessageHeader::SerialOut),
            0x0307 => Ok(MessageHeader::VersionOut),
            0x0400 => Ok(MessageHeader::Tick),
            0x0409 => Ok(MessageHeader::SetBrightness),
            0x0410 => Ok(MessageHeader::ConfirmFrameBuffer),
            0x0500 => Ok(MessageHeader::ButtonPress),
            0x050F => Ok(MessageHeader::DrawOut),
            0x040F => Ok(MessageHeader::DrawIn),
            0x0506 => Ok(MessageHeader::Reset),
            0x0702 => Ok(MessageHeader::SetColor),
            0x0c07 => Ok(MessageHeader::VersionIn),
            0x180d => Ok(MessageHeader::MCU),
            0x1f03 => Ok(MessageHeader::SerialIn),
            0xff10 => Ok(MessageHeader::WriteFrameBuffer),
            value => Err(value),
        };
        println!("Message: {result:?}");
        result
    }
}

impl From<MessageHeader> for Vec<u8> {
    fn from(value: MessageHeader) -> Vec<u8> {
        vec![((value.clone() as u16) >> 8) as u8, value.clone() as u8]
    }
}

#[derive(Debug, Serialize, Clone)]
#[repr(u8)]
pub enum Button 
{
    B00 = 27,
    B10 = 28,
    B20 = 29,
    B30 = 30,
    B40 = 31,
    B01 = 32,
    B11 = 33,
    B21 = 34,
    B31 = 35,
    B41 = 36,
    B02 = 37,
    B12 = 38,
    B22 = 39,
    B32 = 40,
    B42 = 41,
}

impl Button
{
    pub fn get_x(&self) -> u8
    {
        match self
        {
            Self::B00 | Self::B01 | Self::B02 => 0,
            Self::B10 | Self::B11 | Self::B12 => 1,
            Self::B20 | Self::B21 | Self::B22 => 2,
            Self::B30 | Self::B31 | Self::B32 => 3,
            Self::B40 | Self::B41 | Self::B42 => 4,
        }
    }

    pub fn get_y(&self) -> u8
    {
        match self
        {
            Self::B00 | Self::B10 | Self::B20 | Self::B30 | Self::B40 => 0,
            Self::B01 | Self::B11 | Self::B21 | Self::B31 | Self::B41 => 1,
            Self::B02 | Self::B12 | Self::B22 | Self::B32 | Self::B42 => 2,
        }
    }
}

impl TryFrom<u8> for Button 
{
    type Error = u8;
    fn try_from(value: u8) -> Result<Self, Self::Error>
    {
        match value 
        {
            27 => Ok(Button::B00),
            28 => Ok(Button::B10),
            29 => Ok(Button::B20),
            30 => Ok(Button::B30),
            31 => Ok(Button::B40),
            32 => Ok(Button::B01),
            33 => Ok(Button::B11),
            34 => Ok(Button::B21),
            35 => Ok(Button::B31),
            36 => Ok(Button::B41),
            37 => Ok(Button::B02),
            38 => Ok(Button::B12),
            39 => Ok(Button::B22),
            40 => Ok(Button::B32),
            41 => Ok(Button::B42),
            value => Err(value),
        }
    }
}

struct Display {
    id: u16,
    width: u16,
    height: u16,
}

#[derive(Debug, Serialize, Clone)]
#[repr(u8)]
pub enum PressDirection {
    Up = 0x00,
    Down = 0x01,
}

impl TryFrom<u8> for PressDirection 
{
    type Error = u8;
    fn try_from(value: u8) -> Result<Self, Self::Error> 
    {
        match value 
        {
            0x00 => Ok(PressDirection::Down),
            0x01 => Ok(PressDirection::Up),
            value => Err(value),
        }
    }
}

#[derive(Debug, Serialize, Clone)]
pub struct ButtonPressEvent {
    pub tx_id: u8,
    pub button: Button,
    pub dir: PressDirection,
}

#[derive(Debug, Serialize, Clone)]
pub struct FallbackEvent {
    pub tx_id: u8,
}

#[derive(Debug, Serialize, Clone)]
pub struct SerialInEvent {
    pub tx_id: u8,
    pub serial_number: String,
}

#[derive(Debug, Serialize, Clone)]
pub struct ConfirmFrameBufferInEvent {
    pub tx_id: u8,
}

#[derive(Debug, Serialize, Clone)]
pub struct VersionInEvent {
    pub tx_id: u8,
    pub version: String,
}

#[derive(Debug, Serialize, Clone)]
pub struct DrawInEvent {
    pub tx_id: u8,
}

#[derive(Debug, Serialize, Clone)]
pub enum Event {
    ButtonPress(ButtonPressEvent),
    Other(FallbackEvent),
    SerialIn(SerialInEvent),
    VersionIn(VersionInEvent),
    ConfirmFrameBufferIn(ConfirmFrameBufferInEvent),
    DrawIn(DrawInEvent),
}

pub static KEY_SIZE: u16 = 80;

#[derive(Debug, Serialize, Copy, Clone, Hash, PartialEq, Eq, PartialOrd, Ord, Deserialize)]
pub struct KeyLocation {
    pub x: u8,
    pub y: u8,
}