All Files Functions Typedefs Enumerations Enumerator Macros Pages
Macros | Functions
BconAdapterApi.h File Reference

Definition of the BCON adapter interface. More...

#include <stddef.h>
#include "BconAdapterDefines.h"
#include "BconAdapterTypes.h"

Macros

#define BCON_ADAPTER_API_MAJORVERSION   3u
 Current major version of the BCON adapter API. A change to the major version number indicates a breaking change. The BCON adapter will not be loaded if the version is different from the supported version.
 
#define BCON_ADAPTER_API_MINORVERSION   0u
 Current minor version of the BCON adapter API. If only the minor version number differs, the API differences will be handled correctly by the caller.
 

Functions

BCONSTATUS BCON_ADAPTER_CALL BconAdapterInit (BconTraceFunc pTraceFunc)
 Initializes/opens the BCON adapter layer. This function is called when the library is loaded. Re-initialization is possible after calling BconAdapterExit(). More...
 
BCONSTATUS BCON_ADAPTER_CALL BconAdapterExit (void)
 Closes the BCON adapter layer. This function is called before the library is unloaded. It should free all resources. More...
 
BCONSTATUS BCON_ADAPTER_CALL BconAdapterGetVersion (unsigned int *apiMajorVersion, unsigned int *apiMinorVersion, unsigned int *adapterMajorVersion, unsigned int *adapterMinorVersion)
 Returns the version of the library. This function is called to check the API version implemented by the library. Two different sets of major/minor version numbers are returned: More...
 
BCONSTATUS BCON_ADAPTER_CALL BconAdapterGetStatusMessage (BCONSTATUS statusToDecode, char *pBuffer, size_t bufferSize, size_t *pRequiredSize)
 Retrieves the message text of a status code. This function is called to decode a user-defined status code into a readable string. More...
 

Detailed Description

Definition of the BCON adapter interface.

Function Documentation

BCONSTATUS BCON_ADAPTER_CALL BconAdapterExit ( void  )

Closes the BCON adapter layer. This function is called before the library is unloaded. It should free all resources.

Returns
Status of the library.
Return values
BCON_OKResources have been freed.
AnyOther BCON adapter error code.
Precondition
Library has been initialized successfully.
Postcondition
Library resources have been freed and can be unloaded.
Thread Safety:
This function does not need to be thread-safe. All objects created are destroyed before BconAdapterExit() is called.
Note
This function must be implemented.
BCONSTATUS BCON_ADAPTER_CALL BconAdapterGetStatusMessage ( BCONSTATUS  statusToDecode,
char *  pBuffer,
size_t  bufferSize,
size_t *  pRequiredSize 
)

Retrieves the message text of a status code. This function is called to decode a user-defined status code into a readable string.

Parameters
[in]statusToDecodeStatus to decode into string.
[out]pBufferBuffer for the returned string. This parameter can be NULL to retrieve the required buffer size.
[in]bufferSizeSize in number of characters. This parameter can be 0 to retrieve the required buffer size.
[out]pRequiredSizeRequired size of the buffer including a terminating zero. If the buffer is not large enough to hold the full string, it will be truncated. The returned string will always be zero-terminated.
Returns
Status of the retrieval.
Return values
BCON_OKSuccess.
BCON_E_NOT_FOUNDStatus code was not found.
AnyOther BCON adapter error code.
Thread Safety:
This function must be thread-safe.
Note
This function can be implemented.
BCONSTATUS BCON_ADAPTER_CALL BconAdapterGetVersion ( unsigned int *  apiMajorVersion,
unsigned int *  apiMinorVersion,
unsigned int *  adapterMajorVersion,
unsigned int *  adapterMinorVersion 
)

Returns the version of the library. This function is called to check the API version implemented by the library. Two different sets of major/minor version numbers are returned:

  • Version of the BCON adapter API implemented by the library.
  • Version of the adapter library. Only used for display.
Parameters
[out]apiMajorVersionMajor version of the BCON adapter API (BCON_ADAPTER_API_MAJORVERSION ).
[out]apiMinorVersionMinor version of the BCON adapter API (BCON_ADAPTER_API_MINORVERSION ).
[out]adapterMajorVersionMajor version of the adapter library.
[out]adapterMinorVersionMinor version of the adapter library.
Returns
Status of the retrieval.
Return values
BCON_OKSuccess.
AnyOther BCON adapter error code.
Thread Safety:
This function must be thread-safe.
Note
This function must be implemented.
BCONSTATUS BCON_ADAPTER_CALL BconAdapterInit ( BconTraceFunc  pTraceFunc)

Initializes/opens the BCON adapter layer. This function is called when the library is loaded. Re-initialization is possible after calling BconAdapterExit().

Parameters
[in]pTraceFuncOptional. Pointer to a function. If this parameter is not NULL, you can call this to write to the host application.
Returns
Initialization status.
Return values
BCON_OKSuccess.
AnyOther BCON adapter error code.
Postcondition
Library is ready to use.
Thread Safety:
This function is only called once before BconAdapterExit() is called. This function does not need to be thread-safe.
Note
This function must be implemented.

BCONAdapterAPI 3.0
© 2016-2017 Basler AG (Tue May 30 2017 17:24:55)