|
| LuconResult | LUCON_ConnectionSetTimeouts (LuconHandle handle, uint32_t timeout) |
| | Set custom timeouts for awaiting answers from the device to sent commands. SetTimeouts works only while the connection is closed!
|
| LuconResult | LUCON_ConnectionSetHintCallback (LuconHandle handle, const LuconHintCallback callback) |
| | Set a function to be called, when a hint message is received from the Lucon device.
|
| LuconResult | LUCON_ConnectionOpen (LuconHandle handle) |
| | Open the connection to the device. Once opened, the connection listens for incoming messages and may be used for communication.
|
| LuconResult | LUCON_ConnectionClose (LuconHandle handle) |
| | Close a opened connection.
|
| LuconResult | LUCON_ConnectionIsOpened (LuconHandle handle, int32_t *isOpened) |
| | Checks whether the connection is opened and ready for communication.
|
| LuconResult | LUCON_ConnectionSendCommand (LuconHandle handle, const char *const cstring, const char *strbuf, size_t buf_len) |
| | Send the given string over the connection and checks for a device response.
|
| LuconResult | LUCON_ConnectionGetInfo (LuconHandle handle, const char *result, size_t buf_len) |
| | Write a zero-terminated C string with a description of a connection into the result buffer.
|
| LuconResult LUCON_ConnectionSendCommand |
( |
LuconHandle | handle, |
|
|
const char *const | cstring, |
|
|
const char * | strbuf, |
|
|
size_t | buf_len ) |
|
extern |
Send the given string over the connection and checks for a device response.
If not present, the protocols terminating character sequence is appended internally before sending. Users must take care of the protocol, e.g. include properly formatted module address. If the device reports any error, the command will be resent multiple times until the tiemout is hit or a success received. If the device does not report a success, an error LuconResult is received. See LUCON_GetLastApiResult
- Parameters
-
| handle | A handle to a connection |
| cstring | A zero-terminated ASCII string to be sent over the connection. Example: "S01V|15000" |
| strbuf | output string buffer, receiving the device response. |
| buf_len | the usable length of result buffer. |
- Returns