Conversion problem

Hello and happy good weekend :slight_smile:
I need some help for converting uint8_t to string

uint8_t mydata = DriverRxMsgData[2] ;

How can I convert mydata to string ? I searched but I dint find anything for 2 days. Please help?

Hi Aleyna

What do want to do with the string once you have it?

And what type is DriverRxMsgData[]?

Regards

Ray

Aleyna:
Hello and happy good weekend :slight_smile:
I need some help for converting uint8_t to string

uint8_t mydata = DriverRxMsgData[2] ;

How can I convert mydata to string ? I searched but I dint find anything for 2 days. Please help?

Can you explain where info in the DriverRxMsgData array comes from
and what it represents? And how you want the string representation to appear?

uint8_t is the same as byte or unsigned char, so might represent an 8 bit
unsigned quantity, or be packed collection of bits or the two bytes in the
array might be representing a 16 bit quantity...

DriverRxMsgData[2] is uint8_t

I want to send this data to web service. normally I can send string data to webservice succesfully. But when I try to send DriverRxMsgData[2] , I see error. This data is changing structure of data which I want to send. For example

successfull "http://www.example.com/test.ashx?test1=testdata&test2=testdata2"

when I try to send DriverRxMsgData[2] I see error, bad request, web page not found.. because

error "http://www.example.com/test.ashx?test1=testdata&test2="+DriverRxMsgData[2]

To give us an example, if the value of DriverRxMsgData[2] were 65 decimal, how would you want the URL to be?

"http://www.example.com/test.ashx?test1=testdata&test2=65"

or

"http://www.example.com/test.ashx?test1=testdata&test2=A" (65 being the ASCII code for character 'A')

Aleyna:
DriverRxMsgData[2] is uint8_t

Clearly not, its type is uint8_t (array of byte)...

Without knowing the interpretation of those bytes its hard to know
how to proceed - what are they?
Where did they come from?

MarkT:

Aleyna:
DriverRxMsgData[2] is uint8_t

Clearly not, its type is uint8_t (array of byte)…

Without knowing the interpretation of those bytes its hard to know
how to proceed - what are they?
Where did they come from?

It is coming from CanBus. I need to send this value to web service.
I must convert this to string and then send

It is coming from CanBus.

So, it's binary data?

I need to send this value to web service.

As binary data? Or as ASCII data?

I must convert this to string

That is not what the code you have posted attempts to do. That code attempts to interpret the data as a string. Not the same thing AT ALL.