30 views
in System Integration by
Hello World!

I want to display Serial Number sequence in hexadecimal format that is generated by MCU. I am currently using sprintf function to convert unsigned 32 bit data to string including hexnumber and I need to send hex numbers in a format which char based like string to the GUI application from devicedriver. I have tried to write DeviceClass methods which have string arguments to receive not corrupted data in order to display on the screen. Unfortunately, method does not receive the string as characters and it converts to the "\x" started sequence. I need complete string including pure hex number.

 

Thanks for all your supports.

Best Regards,

Burak Cebesoy

1 Answer

0 votes
by

Hello Burak Cebesoy,

I don't really understand your question. Do you have a problem to format hex string? Or do you have problem to pass the string to Embedded Wizard?

Following documentation may help you:

- To convert a number in a string in hex notation use the Instant constructor string(). See there the form 3 and form 6. To get hexadecimal notation pass 16 in the parameter aRadix.

- To pass a string created outside of the GUI application, you have to use appropriate functions for this purpose. See the section: Be careful when exchanging strings. If the original string is a char string, you will need to use EwNewStringAnsi() or EwNewStringUtf8() function to convert the string in Embedded Wizard correct string. The resulting string can then be passed via DeviceClass method.

I hope it helps you further.

Best regards

Paul Banach

by
Thanks for your immediate response Paul!

I was struggling with passing a string created outside of the GUI application which is including hex number. Your second solution is worked and nothing gone wrong.

Thanks a lot!

 

Best regards.

Burak Cebesoy

Embedded Wizard Website | Privacy Policy | Imprint

...