Lucon SDK 1.0.7
Loading...
Searching...
No Matches
lucon_connection.h
Go to the documentation of this file.
1
4
5#ifndef LUCON_CONNECTION_H
6#define LUCON_CONNECTION_H
7
8#include <stdint.h>
9#include <stdbool.h>
10#include "lucon_base.h"
11
16
20
31extern LUCON_EXPORTS LuconHandle LUCON_NewUdpConnection(const char* const raddr, uint16_t lport, const char* const laddr);
32
40extern LUCON_EXPORTS LuconHandle LUCON_NewRs232Connection(const char* const name, uint32_t baudRate);
41
47 // defgroup ConnectionConstructors
49
61
74
78
91
101 // defgroup ConnectionComMonitoring
103
114
121
131
146extern LUCON_EXPORTS LuconResult LUCON_ConnectionSendCommand(LuconHandle handle, const char* const cstring, const char* strbuf, size_t buf_len);
147
159extern LUCON_EXPORTS LuconResult LUCON_ConnectionGetInfo(LuconHandle handle, const char* result, size_t buf_len);
160 // end of addtrogroupg GroupConnection
162
163#endif
void(* LuconHintCallback)(const char *, LuconHintLevel level, const LuconHandle caller)
Signature of a callback function to receive hints from a Lucon module.
Definition lucon_base.h:126
LuconResult LUCON_ConnectionSetWriteCallback(LuconHandle handle, const LuconStringCallback callback)
Set a callback function to be executed after data was sent over the connection given by handle.
LuconResult LUCON_ConnectionSetReadCallback(LuconHandle handle, const LuconStringCallback callback)
Set a callback function to be executed after the connection received data from the device.
LuconHandle LUCON_NewRs232Connection(const char *const name, uint32_t baudRate)
New RS232 serial-port connection.
LuconHandle LUCON_NewFakeConnection()
Creates a new fake connection, which may be used for simulation / testing without real hardware.
LuconHandle LUCON_NewUdpConnection(const char *const raddr, uint16_t lport, const char *const laddr)
New UDP connection.
LuconResult LUCON_ConnectionOpen(LuconHandle handle)
Open the connection to the device. Once opened, the connection listens for incoming messages and may ...
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_ConnectionClose(LuconHandle handle)
Close a opened connection.
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_ConnectionIsOpened(LuconHandle handle, int32_t *isOpened)
Checks whether the connection is opened and ready for communication.
LuconResult LUCON_ConnectionSetTimeouts(LuconHandle handle, uint32_t timeout)
Set custom timeouts for awaiting answers from the device to sent commands. SetTimeouts works only whi...
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.
struct LuconObject * LuconHandle
LuconHandle A handle to an object within the Lucon SDK.
Definition lucon_base.h:110
basic type definitions
#define LUCON_EXPORTS
Marks symbols exported by the library.
Definition lucon_base.h:14
LuconResult
Inidcates the result of API calls.
Definition lucon_base.h:23
void(* LuconStringCallback)(const char *message, const LuconHandle caller)
Signature of a callback function to receive strings.
Definition lucon_base.h:115