06-17-2016 08:33 AM
Hi,
I have a TCP connection that are going to send 3 different types of data, numeric, boolean and string. I choose the datatype to send with enumerated control and case structures. I first choose datatype and send the message with the press of a button.
I am able to recive all datatypes but the numeric and boolean are not displayed correctly as TCP read output i string, I know that I can convert the data type with type cast, but this will only work if I know the datatype I am sending, er there anyway to somehow figure out what datatype are recived from the TCP read String? Then convert the data to correct type and display the data correctly? I was thinking about sending a string with some code for the datatype sendt, and then converting the TCP read string accordingly, but is there an easier way to solve this?
Thanks for any help.
With kind regards
Espen Olsen
06-17-2016 08:52 AM - last edited on 03-19-2024 10:08 AM by Content Cleaner
I highly recommend you have a look at the STM library. It does exactly what you are looking for.