atostm  3.2.0
ATOMAS atostm
Startup and Shutdown

Global vars

Call the ato_si_set() method. For example:

ato_si_set("Your Organisation Name Here", "ATO STM Reference Client (C version)", "0.6", buildtime, hash);
ATO_EXPORT int ato_si_set(const char *organisation, const char *product, const char *version, const char *timestamp, const char *source, const char *hash)

Initialise

The following initialises the base SDK and the STM SDK. The ".._INIT_.." flags control the underlying initialisation. However only the given values are currently supported.

int errcode = ATO_ERR_OK;
ato_Ctx *ctx = NULL;
// We need at least one context for the main thread prior to initialisation
// The following is required only if using the ATOAKM SDK
if (errcode == ATO_ERR_OK)
errcode = ato_akm_init(ctx, ATO_AKM_INIT_ALL);
if (errcode == ATO_ERR_OK)
errcode = ato_stm_init(ctx, ATO_STM_INIT_ALL);
ATO_AKM_EXPORT int ato_akm_init(ato_Ctx *ctx, unsigned short flag)
#define ATO_AKM_INIT_ALL
ATO_EXPORT void ato_ctx_create(ato_Ctx **ctx, const char *id)
ATO_EXPORT int ato_base_init(ato_Ctx *ctx, unsigned short flag)
#define ATO_ERR_OK
#define ATO_BASE_INIT_ALL
struct _ato_Ctx ato_Ctx
ATO_STM_EXPORT int ato_stm_init(ato_Ctx *ctx, unsigned short flag)
Initialise the SDK.
#define ATO_STM_INIT_ALL
The ATO_STM_INIT_...
Definition: types.h:33

Configuration

In order to do anything useful, we need to load a configuration as described in

Note
For accessing configuration values see Configuration.

Deinitialise

At the end of the program lifetime, and after all threads are finished, corresponding config/ctx free and deinitialisation methods must be called.

ato_cfgm_free(cfgmgr);
ato_akm_deinit(); // if using ATOAKM
ATO_AKM_EXPORT void ato_akm_deinit(void)
ATO_EXPORT void ato_ctx_free(ato_Ctx *ctx)
ATO_EXPORT void ato_base_deinit(void)
ATO_STM_EXPORT void ato_stm_deinit(void)
Deinitialise the SDK.