2022-11-28 11:33 AM
I need to pass a 6 characters string to a function in a custom container, but the string is cut to 4 characters.
The function is called in the screen where the container is, like this: container.function(str).
If I pass a string smaller than 5 characters it works ok, but greater not. I'm sure at this moment the 6 characters string is complete.
In the custom container the string and the function are defined as follows:
Unicode::UnicodeChar str[7];
function (Unicode::unicodechar * str);
Is there a limitation to pass strings greater than 4 characters in TouchGFX? How could I solve it?
Thanks.
2022-12-01 02:57 AM
Hello ALuiz.1,
I've tested to show logs with a function in a container with a string given by my main screen. I don't reproduce the error you describe. You'll find attached an example of how I get a string with my container.
Do want to use it on a text Area in your container? If yes, what did you put as your buffer size in your wildcard ?
/Osman
2022-12-05 09:48 AM
Thanks for the answer.
I solved the problem changing the type of the variable passed.
In screen I created an uint8_t buffer and I used the commands:
Unicode::toUTF8(str, buffer, 7);
container.function((char *)buffer);
In custom container I did:
function(char * str)
{
Unicode::fromUTF8((uint8_t *)str, localBuffer, 7);
...
}