Wasabi ExpressPlay SDK for Embedded Systems  1.23.0
Data Fields
SHI_EngineConfig Struct Reference

Configuration passed as an argument to the SHI_Engine_Create factory function. More...

#include <ShiEngine.h>

Data Fields

SHI_Flags flags
 Configuration flags. More...
 
SHI_EngineListener listener
 Recipient of event callbacks. More...
 

Detailed Description

Configuration passed as an argument to the SHI_Engine_Create factory function.

Note: In this release of the SDK, no flags are defined, so the flags field should be 0.

Note also that having a listener that properly detects any transaction failure is essential to the error handling in the client application code. The following pseudo code illustrates a listener function and the client code that properly capture any personalization transaction failure:

static void MyOnEvent(SHI_EngineListener self,
const SHI_EngineEvent* event)
{
if (type == SHI_ENGINE_EVENT_TRANSACTION_END && event->cookie) {
// assign transaction_result here:
*(WSB_Result*)(event->cookie) = end_event->result.code;
}
}
WSB_Result MyPersonalization()
{
WSB_Result result;
WSB_Result transaction_result = WSB_ERROR_INTERNAL;
SHI_Engine* engine = NULL;
SHI_EngineListenerInterface iface = {MyOnEvent};
SHI_EngineConfig config = {0, {&iface, NULL}};
result = SHI_Engine_Create(&config, &engine);
if (WSB_FAILED(result)) goto error;
// pass transaction_result pointer as the cookie:
result = SHI_Engine_Personalize(engine,
NULL,
0,
&transaction_result);
if (WSB_FAILED(result)) goto error;
// check the transaction_result!
result = transaction_result;
if (WSB_FAILED(result)) goto error;
// no error, fall thru
error:
if (engine) {
}
return result;
}

Field Documentation

◆ flags

SHI_Flags SHI_EngineConfig::flags

Configuration flags.

◆ listener

SHI_EngineListener SHI_EngineConfig::listener

Recipient of event callbacks.


The documentation for this struct was generated from the following file: