Setting the command ending

View previous topic View next topic Go down

Setting the command ending

Post by Admin on Fri Mar 11, 2016 12:46 pm

The command ending is a string that is automatically appended at the end of each command. Default command ending is "\n", which is LF (line feed) character / hex code 0x0A.
For example: a button with press action "up" will send "up\n" when pressed.
The command ending is also used to parse the received commands. App searches for that string to know where a command ends, then executes it, then waits for the next command.
For example, to turn on an LED that has id "led1", app should receive "led1 1\n". To turn it off - should receive "led1 0\n".

You can change the command ending if you want (menu -> interface -> set command ending).
Each interface uses its own command ending.

The most used command endings are:
"\n" - LF / line feed / 0x0A
"\r" - CR / carriage return / 0x0D
"\r\n" - CRLF / carriage return + line feed / 0x0D 0x0A

Admin
Admin

Posts : 111
Join date : 2016-03-08

View user profile http://roboremo.makeforum.net

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum