Operating systems, Function documentation, Return values – Kontron KEAPI User Manual
Page 6: Functional errors, Remote connection errors, 2 function documentation, 4 operating systems, 1 return values, 1 functional errors, 2 remote connection errors

Software specification for Kontron EAPI
6
1.4 Operating systems
This document describes KEAPI interface for Linux, Windows XP, Windows Vista - 32/64,
Windows 7 - 32/64, VxWorks.
2 Function Documentation
Main part of Kontron EAPI is dynamic-linked library with API functions. Before using any of these
functions, KEAPI has to be initialized and connection to the board has to be established by calling the
KEApiLibInitialize() function. This function returns a board handle (unique four-byte number) that will
other KEAPI functions take as their first parameter. The KEApiLibInitialize() function may be called
several times for simultaneous connection to several boards. When KEAPI is no longer needed, the
KEApiLibUnInitialize() function should be called.
Memory for structures and variables that will be used by KEAPI functions to store information must be
pre-allocated by the user application.
KEAPI by itself doesn’t allocate memory for output parameters.
2.1 Return values
If everything goes well, all KEAPI functions return KEAPI_RET_SUCCESS. If some error occurs, the
returned error message differs for various functions. Error messages can be basically divided into two
groups: Functionality errors and Connection errors.
2.1.1 Functional errors
KEAPI_RET_ERROR
General Error
KEAPI_RET_PARAM_ERROR
Wrong parameter value
KEAPI_RET_PARAM_NULL
Parameter is NULL (memory not pre-allocated)
KEAPI_RET_WD_TIMEOUT_NOT_SUPPORTED
WD timeout not supported
KEAPI_RET_BUFFER_OVERFLOW
Buffer overflow (probably configuration error)
KEAPI_RET_SETTING_ERROR
Error while setting value or feature (enable, disable)
KEAPI_RET_RETRIEVAL_ERROR
Error while retrieving information
KEAPI_RET_WRITE_ERROR
Cannot write to file
KEAPI_RET_READ_ERROR
Cannot read file
KEAPI_RET_MALLOC_ERROR
Memory allocation failed
KEAPI_RET_LIBRARY_ERROR
Exported function could not be loaded from library
KEAPI_RET_WMI_ERROR
Problems while reading from WMI
KEAPI_RET_NOT_INITIALIZED
KEAPI library is not initialized
KEAPI_RET_PARTIAL_SUCCESS
Part of requested information couldn’t be retrieved.
Returned information isn’t complete.
KEAPI_RET_FUNCTION_NOT_SUPPORTED
Function is not supported on current platform/HW
KEAPI_RET_FUNCTION_NOT_IMPLEMENTED
Function is not yet implemented
2.1.2 Remote connection errors
KEAPI_RET_INVALID_IP
IP address is not in a valid format
KEAPI_RET_RMT_CON_ERROR
Remote connection failed
KEAPI_RET_RPC_ERR_MAX_CONN_COUNT_EXCEEDED
Connection limit on the client side was
reached
KEAPI_RET_RPC_ERR_SOCKET_ERROR
Error with socket manipulation
KEAPI_RET_RPC_ERR_CONNECTION_NOT_FOUND
Connection for given board handle does not
exist
KEAPI_RET_RPC_ERR_NOT_IMPLEMENTED
Remote function call is not implemented
KEAPI_RET_RPC_ERR_SOCKET_TIMEOUT
Time limit for select() function expired
KEAPI_RET_RPC_ERR_PACKET_ERROR
Wrong format of KEAPI packet