I wanna turn to diverse functional entry acording to the received datas. The datas received from the serial port are at the length of 2 bytes . so I can't simply use Switch sentence. How can I make it?
a map of function pointers using the received bytes (turned into a string maybe) as a key would work nicely.
but my gcc complier seems not support the string type ,when I transform the two bytes data to a string and then use switch sentence, the complier says:"switch quantity is not an integer constant" ,"case label does not reduce to an integer constant"