Lucon SDK 1.0.7
Loading...
Searching...
No Matches
lucon_api.h File Reference

Header file defining the full Lucon C API. More...

#include "lucon_base.h"
#include "lucon_channel.h"
#include "lucon_connection.h"
#include "lucon_device.h"

Go to the source code of this file.

Functions

LuconResult LUCON_FreeHandle (LuconHandle handle)
 Frees the memory and all resources attached to the handle.
LuconResult LUCON_GetLastApiResult (LuconResult *lastresult, char *const strbuf, const size_t buf_len, size_t *requiredLength)
 Get the result of the last API call from this thread, including a descriptive message.

Detailed Description

Header file defining the full Lucon C API.

Contains global Lucon functionality and includes all Lucon API headers.

Function Documentation

◆ LUCON_GetLastApiResult()

LuconResult LUCON_GetLastApiResult ( LuconResult * lastresult,
char *const strbuf,
const size_t buf_len,
size_t * requiredLength )
extern

Get the result of the last API call from this thread, including a descriptive message.

Results of API calls are stored in thread-local storage, except for calls of LUCON_GetLastErrorStatus. The function can be used to retrieve error messages, after an API call failed (LuconResult != LUCON_OK) If the output buffer strbuf is shorter than the full status message, it will be filled with a truncated copy. The full message may be retrieved by repeating the call with a larger buffer with a minimum capacity as returned in requiredLength

Parameters
lastresultA buffer receiveing the result code of the last API.
strbufA string-buffer retrieving the message related the last API result. NULL
buf_lenThe capacity of the strbuf
requiredLengthA (optional) buffer receiving the required length of the output buffer to receive the full status message
Returns
true if reading the result from TLS succeeded. true is also returned if the the message was truncated check requiredLength!