Necessary adjustments for upcoming Touchscreen mod

* Make some LCD display related things globally accessible
* Deprecate `read_data` to avoid confusion (use `send_cmnd` instead)
* Allow arbitrary data for `send_msg` and `get_msg` (with optional parameter)
master
Thomas--S 2020-11-05 20:04:21 +01:00
parent bff2824f2c
commit 997b6f3562
2 changed files with 5 additions and 10 deletions

View File

@ -240,9 +240,9 @@ techage.lua_ctlr.register_function("get_msg", {
return msg.src, data
end
end,
help = ' $get_msg([raw]) --> any value or nil\n'..
' If the optional `raw` parameter is not set or false,\n'..
' the return value is guaranteed to be a string.\n'..
help = ' $get_msg([raw]) --> number and any value or nil\n'..
' If the optional `raw` parameter is not set or false,\n'..
' the second return value is guaranteed to be a string.\n'..
' Read a received messages. Number is the node\n'..
' number of the sender.\n'..
' example: num,msg = $get_msg().'

View File

@ -413,15 +413,10 @@ In contrast the Controller can send text strings to the terminal.
### Further Functions
Messages are used to transport data between Controllers. Messages are always converted to text strings. Incoming messages are stored in order (up to 10) and can be read one after the other.
* `$get_msg()` - Read a received message. The function returns the sender number and the message. (see example "Emails")
Messages are used to transport data between Controllers. Messages can contain arbitrary data. Incoming messages are stored in order (up to 10) and can be read one after the other.
* `$get_msg([raw])` - Read a received message. The function returns the sender number and the message. (see example "Emails"). If the _raw_ parameter is not set or false, the message is guaranteed to be a string.
* `$send_msg(num, msg)` - Send a message to another Controller. _num_ is the destination number. (see example "Emails")
Similiar to the concept above you can also exchange arbitrary data. Please note that external devices might also send such data.
* `$get_data()` - Read received data. The function returns the sender number and the data.
* `$send_data(num, data)` - Send data to another Controller. _num_ is the destination number.
* `$chat(text)` - Send yourself a chat message. _text_ is a text string.
* `$door(pos, text)` - Open/Close a door at position "pos".