I’m making some software which communicates with serial communication to some electronics through the COM port on my PC. I have to communicate with the SimplicTI protocol which I haven’t used before. I have found a library which enables me to do the communication but since I would like to evolve as a programmer I would like to understand every single statement of this library. In the source code of the library I stumbled upon the following variable declaration:
byte len = (data == null) ? (byte)0 : (byte)data.Length
What is going on here? I can’t seem to grasp this statement.
By the way the variable “data” is a byte array.
Equivalent to: