Obtaining Application Context Information

Declare Variables/Constants

#define CONTACT_SERVER "no-net"
static const char *pcScopeAppContextInfo = "<sentinelScope/>";
sntl_licensing_attr_t *pAttrAppContext = NULL;
sntl_licensing_app_context_t *pAppContext = NULL;
char *pcAppContextInfo = NULL;

API Calls

To obtain the application context information, execute the APIs in the specified sequential order only:

sntl_licensing_attr_new(&pAttrAppContext);
sntl_licensing_attr_set(pAttrAppContext, SNTL_ATTR_APPCONTEXT_CONTACT_SERVER, CONTACT_SERVER);
sntl_licensing_attr_set(pAttrAppContext, SNTL_ATTR_APPCONTEXT_CONTROL_REMOTE_SESSION, SNTL_CONTROL_REMOTE_NONE);
sntl_licensing_app_context_new(0, pAttrAppContext, &pAppContext);
sntl_licensing_get_info(pAppContext, pcScopeAppContextInfo, SNTL_QUERY_APPCONTEXT_INFO_VERSION(v), &pcAppContextInfo);

If the sntl_licensing_get_info call is successful, the pcAppContextInfo parameter contains an XML-based output having the detailed appContext information.

Notes

>In the use case described above, appContext Info is obtained when their respective attributes are set (for the remaining attributes, default values are obtained). For example:

SNTL_ATTR_APPCONTEXT_CONTACT_SERVER

SNTL_ATTR_APPCONTEXT_CONTROL_REMOTE_SESSION

>In the case you want to set additional attribute (like network time out or trace level etc) then you may use the macro SNTL_ATTR_APPCONTEXT_NETWORK_TIMEOUT prior to the sntl_licensing_get_info(pAppContext, pcScopeAppContextInfo, SNTL_QUERY_APPCONTEXT_INFO, &pcAppContextInfo); call.
For example, to set the trace level, use the macro SNTL_ATTR_APPCONTEXT_TRACE_LEVEL prior to sntl_licensing_get_info(pAppContext, pcScopeAppContextInfo, SNTL_QUERY_APPCONTEXT_INFO, &pcAppContextInfo); call.