Updating Button Text

GTT Designer Software Support

Moderator: Mods

Post Reply
jvank6
LCD?
Posts: 5
Joined: Tue Aug 09, 2022 1:56 pm

Updating Button Text

Post by jvank6 »

Hello, I've been working with the GTT70A and have had success with updating labels on the touchscreen based on variables in a c-code. I found the GTT2.25 Manual, and followed the protocol for updating label text. I found success when sending:

send_byte(254, port); // Command prefix
send_byte(250, port); // Protocol-specific prefix
send_byte(1, port); // Command ID: Update Property
send_byte(10, port); // Property Command: Set Text
send_u16(label_id, port); // Send the Object ID (Label ID 2)
send_u16(0x0906, port); // Send the Property ID for text
send_byte(encoding, port); // Encoding: 1 for ASCII
send_u16(text_length + 1, port); // Send the Byte Length of the text (+1 for null terminator)
send_string(variable_string, port); // Send the variable string
send_byte(0, port); // Send the Null Terminator

I'm trying to do the same thing with Buttons now. I want to be able to update the text on buttons based on variables in my c code. I've set up my button text update function similar to how the label update function works. According to the GTT 2.5 protocol, the following should allow for button text updates, but I am not seeing any success in my testing. Is this the correct protocol for Raw Button (GTT2.5)? Is the "SET TEXT" property command different between the two? Am I perhaps looking in the wrong place, or executing this wrong?

send_byte(254, port); // Command prefix
send_byte(250, port); // Protocol-specific prefix
send_byte(1, port); // Command ID: Update Property
send_byte(10, port); // Property Command: Set Text
send_u16(button_id, port); // Send the Object ID (Button ID)
send_u16(0x0F03, port); // Property ID for Button Text Send the Property ID for text (specific to buttons)
send_byte(encoding, port); // Encoding: 1 for ASCII
send_u16(text_length + 1, port);// Send the Byte Length of the text (+1 for null terminator)
send_string(value_string, port);// Send the Value string
send_byte(0, port);// Send the Null Terminator

Thank you for your help!

Raquel
Matrix Orbital
Matrix Orbital
Posts: 834
Joined: Thu Aug 19, 2004 3:37 pm
Location: MO Office

Re: Updating Button Text

Post by Raquel »

Hello jvank6,

Thank you for posting on the forum.

It is quite a task to have all the commands (legacy and GTT2.5) implemented for the GTT.
We have a client library you can use.
If you are using GTT Designer, projects output .c and .h files for convenient use.

I will test your code here and update you.
But as noted above, with the client code you can conveniently call "gtt25_set_button_text" to update the text on a button.
All you need to do it to supply the hardware implementation of single byte write/read.

Thank you,
Raquel
Raquel Malinis
Design and Development
Matrix Orbital

Post Reply