custom_protocols
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
custom_protocols [2020/01/02 10:31] – [readRegister] emozolyak | custom_protocols [2020/01/02 10:56] – [readRegister] emozolyak | ||
---|---|---|---|
Line 108: | Line 108: | ||
These parameters are passed in order to be able to correctly and fully compose a request according to the protocol. | These parameters are passed in order to be able to correctly and fully compose a request according to the protocol. | ||
- | To send a request to the device // | + | To send a request to the device // |
- | The sendBytes | + | ^ Function ^ Arguments ^ Returns ^ |
- | The sendString | + | |sendBytes |
- | На вход | + | |sendString |
- | На вход | + | |readBytes |
- | Если необходимо закрыть соединение | + | |readString |
- | Если необходимо сделать паузу, то можно вызвать функцию sleep. Ее единственным аргументом должно быть время в микросекундах. Пример: | + | To close connection |
- | Для работы с битами можно использовать библиотеку bitop [4]. | + | To make a delay, //sleep// function can be used. Its only argument is time in microseconds, |
- | Для отладки и вывода диагностических сообщений можно использовать процедуры ERROR, INFO, DEBUG и TRACE которые доступны и в обычных сценариях Lua [5]. | + | For bit processing refer to bitop library and this [[useful_programs# |
- | Что бы лучше понять как это все работает давайте рассмотрим пример функции | + | For debugging and diagnostic messages you can use ERROR, INFO, DEBUG or TRACE from the users Lua scripts - see [[write_to_logs | this]]. |
+ | |||
+ | To better understand the custom protocol application, | ||
<code lua> | <code lua> |
custom_protocols.txt · Last modified: 2023/02/21 17:52 by emozolyak