167 views
in System Integration by

Hello EW Team,

I have a text input field in emwi.

When you press the "Finish" button, the entered text is saved in Device::Device.TestMessage and passed to my external variable.

Now I have my variable in my C code, see "XString TestMessage".

The TestMessage is now processed below.

The Line, because the picture is out of focus:

sprintf(msg, "[{\"Starttime:\": \"%s\"},{\"Endtime:\": \"%s\"},{\"Duration:\": \"%s\"},{\"Successful:\": \"%s\"},{\"Message:\": \"%S\"}]}]", startdate_buffer, enddate_buffer, duration_buffer, testsucces, TestMessage);

However, the "\n" characters are not written down.

How can I solve the problem that the "\n" characters are also there?

 

Best regards

Justin

1 Answer

0 votes
by
 
Best answer

Okay, i found my problem.

 

It was the %S, it must be a %s.

So:

sprintf(msg, "[{\"Starttime:\": \"%s\"},{\"Endtime:\": \"%s\"},{\"Duration:\": \"%s\"},{\"Successful:\": \"%s\"},{\"Message:\": \"%s\"}]}]", startdate_buffer, enddate_buffer, duration_buffer, testsucces, TestMessage);

Best regards

Justin

Ask Embedded Wizard

Welcome to the question and answer site for Embedded Wizard users and UI developers.

Ask your question and receive answers from the Embedded Wizard support team or from other members of the community!

Embedded Wizard Website | Privacy Policy | Imprint

...