Intel AppUp™ Software Development Kit API Reference for C

SDK Version 2.0  Copyright © 2011 Intel Corporation.  All Rights Reserved.   Document Number: 324251-004US.

 

Contents

About this Document

Intended Audience

Using this API Reference

Conventions and Symbols

Related Information

Application Reference Information

Configuration and Build Information

Includes and Definitions

Application Initialization Call

Code Example

Application Authorization Call

Code Example

Application Close Call

Code Example

Instrumentation

Begin Event Call

End Event Call

Crash Reporting

ADP_ReportCrash

Custom Crash Reporting

Return Codes

Code Sample

End User Error Messages

Component Reference Information

IsAppAuthorized Call

Code Sample

 

Revision History

Disclaimer and Legal Information

 

About this Document

This document is for developers using the Intel AppUpTM Software Development Kit 2.0 for C to develop applications and components within a Microsoft Windows* environment and targeted for a Microsoft Windows runtime environment. The SDK (Software Development Kit) includes programming libraries, documentation, and sample code to help developers create, test, and submit C applications and components intended for distribution via the Intel AppUpSM center.

Intended Audience

This document is intended for experienced software developers who are developing applications and components for the Intel AppUpSM center. These can be new applications/components or existing ones being ported for the Intel AppUpSM center. This SDK supports development of C applications/components in a Microsoft* Windows 7* or Windows XP* environment for a Microsoft Windows 7 or Windows XP runtime environment.

Information about the specific editions and versions of the environments that are supported is provided in the Release Notes for the SDK.

Using this API Reference

This API reference contains the following sections:

  • About this Document, introduces the contents and conventions of this document.

  • Application Reference Information, documents the SDK API Calls and Exceptions for applications. Code examples are provided, as appropriate.

  • Component Reference Information, documents the SDK API Calls and Exceptions for components. Code examples are provided, as appropriate.

Conventions and Symbols

The following table shows the conventions used in this document.

  

                               Conventions and Symbols Used in This Document

  

  This type

  style

 

Indicates an element of syntax, reserved word, keyword, filename, computer output, or part of a program example. The text appears in lowercase unless uppercase is significant.

This type style

Indicates the exact characters you type as input. Also used to highlight the elements of a graphical user interface such as buttons and menu names or filenames and labels when discussing program examples.

This type style

Indicates a placeholder for an identifier, an expression, a string, a symbol, or a value. Substitute actual item(s) for the placeholder.

Hyperlink

Indicates a hyperlink to internal or external information. Use CNTL+mouse click to navigate.

Notes, cautions, etc.

Note:  Indicates an important comment or side topic for the user.

Related Information

Getting Started information for the C elements of the SDK is provided in the Intel AppUpTM Software Development Kit Developer Guide for C document, which is shipped with the Intel AppUpTM Software Development Kit for C/C++. The SDK is available on the Intel AppUpSM Developer Program portal.

Application Reference Information

This section documents the SDK API Calls and Returns. The following subsections are provided:

  • Configuration and Build Information — Documents general configuration and build information needed to create applications.

  • Includes and Definitions — Documents Include and Definition requirements needed to create applications.

  • Application Initialization Call — Documents the API call to initialize the SDK library and the resources needed for applications.

  • Application Authorization Call — Documents the API call to determine if the application is authorized to run (or not authorized).

  • Application Close Call — Documents the API call to release application resources and close the SDK library.

  • Instrumentation Calls — Documents the SDK library calls to implement Instrumentation (metering) of applications.

  • Custom Crash Reporting — Documents the method to implement custom Crash Reporting, when default Crash Reporting is not desired.

  • Return Codes — Documents the Return codes that are supported.

  • End User Error Messages — Documents the error messages that can be displayed to end users.

Code examples are provided, as appropriate. Information on components is covered in Component Reference Information.

Configuration and Build Information

The following list provides basic configuration and build information needed to create applications:

  • The Intel AppUpTM SDK library uses a default cdecl calling convention, even though no explicit _cdecl prefix appears for calls in the SDK headers, samples, and documents. Applications must also use cdecl to link to the SDK library.

  • Verify that Visual Studio has statically linked the application to the Application Service library for the target runtimes. These libraries are as follows:

  •   

    Microsoft* Visual Studio* 2008

    Debug Runtime

    Release Runtime

    Adpcored.lib

    Adpcore.lib

    Psapi.lib

    Psapi.lib

    Shlwapi.lib

    Shlwapi.lib

    Microsoft* Visual Studio* 2010

    Debug Runtime

    Release Runtime

    Adpcorevc10d.lib

    Adpcorevc10.lib

    Psapi.lib

    Psapi.lib

    Shlwapi.lib

    Shlwapi.lib

  • The default pathname to the libraries is: Program Files/Intel/IntelAppUpSDK/Cpp/lib/.

Includes and Definitions

The SDK library header, adpcore.h, must be included in the “#includes” area of your application, as shown below.

 

#include "adpcore.h"

The Authorized Application Debug ID, shown below, must also be defined. 128-bit number, expressed as a string using predefined constants. The value of the Authorized Application Debug ID is contained in the SDK library. You can also use the absolute value (all one’s), as shown in the sample. You must replace the Debug ID with a Production ID after testing. The Production ID is discussed in detail later in this section. There is also an Expired Application Debug ID to allow you to test the “expired” branch of your application.

 

    // Debug application ID

    const ADP_APPLICATIONID myApplicationID = (0x11111111, 0x11111111,

            0x11111111, 0x11111111);

    // API return code

    ADP_RET_CODE ret_code;;

The SDK return code must be defined, as shown above.

Note that an Authorized Application Debug ID is used. During development, this Debug ID allows testing with the Intel AppUpTM Software Debugger. An alternate way to define the Authorized Application Debug ID is to reference the constant in the SDK library, as shown below:

 

    // Debug application ID

    const ADP_APPLICATIONID myApplicationID = (ADP_DEBUG_APPLICATIONID);

Application Initialization Call

The Application Initialization call, ADP_Initialize, initializes the SDK library and allocates the resources needed by the library. It also makes sure the version of the Intel AppUpSM center client software on the system is compatible with the SDK library version. ADP_Initialize should be inserted in the initialization section of the applications main routine. The call should be followed by an error handler.

Syntax

    

     RETURN = ADP_Initialize();

 

Parameters

None.

Return Codes

Value

Meaning

ADP_SUCCESS

Operation was successful.

ADP_FAILURE

Operation was unsuccessful. It can also indicate that more than one instantiation of the application was attempted.

ADP_NOT_AVAILABLE

Operation failed because the SDK library was not available. This can occur if the Intel AppUpSM center software is not installed properly.

ADP_INCOMPATIBLE_VERSION

Operation failed because the API version of the application is not supported by the current Intel AppUpSM center client software.

ADP_TIMEOUT

Operation failed because the connection between the SDK and the Intel AppUpSM center client software timed out.

  

Notes

  • The SDK library must be included prior to invoking this call.

  • The return code must be defined prior to invoking this call.

Code Example

The following example shows the use of the ADP_Initialize call. A basic exception handler is used.

 

 

    // Initialize the adpcore data structure data structures, and determine

    // whether the system is compatible. It must be called before calling

    // any other call to the adpcore.

    ret_code = ADP_Initialize();

    if (ret_code != ADP_SUCCESS)

    {

        printf("FAIL: ADP_Initialize failed with error code %d \n", ret_code);

        exit (1);

    }

 

Application Authorization Call

The Application Authorization call, ADP_IsAuthorized, authorizes the application via the Intel AppUpSM center. The return code indicates authorization status or errors. ADP_IsAuthorized should be inserted in the initialization section of the applications main routine. The call should be followed by an error handler.

Syntax

 

     RETURN = ADP_IsAuthorized(ApplicationID);

 

Parameters

ApplicationID:  Application GUID in string or integer format. The data type of the GUID is four unsigned, long integers, as follows:

 

ApplicationID(unsigned long l1, unsigned long l2, unsigned long l3, unsigned long l4)

See the Application IDs discussion later.

Return Codes

Value

Meaning

ADP_FAILURE

Operation was unsuccessful. It can also indicate that more than one instantiation of the application was attempted.

ADP_NOT_AVAILABLE

Operation failed because the SDK library was not available. This can occur if the Intel AppUpSM center software is not installed properly.

ADP_NOT_INITIALIZED

Operation failed because the SDK library is not initialized. Any API call made prior to initialization causes this code to be generated.

ADP_AUTHORIZED

The application is authorized to run.

ADP_NOT_AUTHORIZED

The application is not authorized to run. Applications can choose how to respond, such as preventing an application from running, allowing the application to run for a grace period so the user can obtain a license, allowing the application to run with limited functionality, etc.

ADP_AUTHORIZATION_EXPIRED

The application’s license has expired. Applications can choose how to respond, such as preventing an application from running, allowing the application to run for a grace period so the user can obtain a license, allowing the application to run with limited functionality, etc.

ADP_TIMEOUT

Operation failed because the connection between the SDK and the Intel AppUpSM center client software timed out.

  

Application IDs

The Application ID is a unique identifier for Intel AppUpSM Developer Program applications. There are two types of application GUIDs:  (1) a Debug Application ID, and (2) a Production Application ID. Debug Application IDs are used for testing applications. You must replace the Debug Application ID with a Production Application ID after testing in order to upload your application to the Intel AppUpSM Developer Program portal.

Debug Application ID — During development, the Application Debug ID allows testing with the Intel AppUpTM Software Debugger. This Debug ID is a 128-bit number, expressed as a string using predefined constants. Two versions of a Debug ID exist:

  • ADP_DEBUG_APPLICATIONID:  Used with the Intel AppUpTM Software Debugger to get an ADP_AUTHORIZED response back. This allows most of the application to be tested and debugged. The value of this Debug ID is all one's.

  • ADP_EXPIRED_APPLICATIONID:  Used with the Intel AppUpTM Software Debugger to get an ADP_AUTHORIZATION_EXPIRED response back. This allows the “expired” branch of the application to be tested and debugged. The value of this Debug ID is all zero's.

Production Application ID — Production IDs are obtained from the Intel AppUpSM Developer Program portal, which requires that you enroll in the Intel AppUpSM Developer Program. The Production ID is a 128-bit number organized as four integers in hex format.

  

Notes

  • A successful ADP_Initialize call must be completed before invoking this call.

  • A sensible approach to handling an ADP_TIMEOUT error during the first authorization attempt is to attempt authorization again.

  • Multiple Application Constructor calls can be made, but the Application ID from the first call is the only one used in the application (e.g., in a crash report)

 

Code Example

The following example uses an Application Debug ID and includes a basic error handler. The ADP_Initialize call has already completed successfully.

 

 

    // Check the application is authorized to run.

    ret_code = ADP_IsAuthorized(ADP_DEBUG_APPLICATIONID);

    // TODO: Application specific stuff goes here

    if( ret_code == ADP_AUTHORIZED )

    {

        printf( "Hello World \n" );

    }

    else

    {

        printf( "Not authorized to run \n" );

        exit (1);

    }

    // Application code goes here

 

Application Close Call

On application or process exit, the SDK library must be instructed to release the object and close the SDK library. The ADP_Close call performs these tasks. ADP_Close should be inserted in the shutdown section of the applications main routine. The call should be followed by an error handler.

Syntax

 

    RETURN = ADP_Close();

 

Parameters

None.

Return Codes

Value

Meaning

ADP_SUCCESS

Operation was successful.

ADP_FAILURE

Operation was unsuccessful. It can also indicate that more than one instantiation of the application was attempted.

  

Notes

  • None at present.

Code Example

The following example shows the use of the ADP_Close call. A basic error handler is used.

 

 

    // Cleanup the SDK data structure, and shutdown connections used by the SDK.

    ret_code = ADP_Close();

    if( ret_code != ADP_SUCCESS )

    {

        printf("FAIL: ADP_Close failed with error code %d \n", ret_code);

    }

    return 0;

 

 

Instrumentation

The SDK supports the following Instrumentation events to measure application usage:

  • Application Begin Event – Triggers sending a Begin Event message to the Intel AppUpSM center for the application.

  • Application End Event – Triggers sending an End Event message to the Intel AppUpSM center for the application.

A usage record is only generated when a Begin Event is followed eventually by an End Event. A Begin Event alone does not cause a usage record to be generated.

Begin Event Call

It is recommended that you insert the ADP_ApplicationBeginEvent call immediately after the application authorization call. This starts usage measurement when the application is first authorized.

Syntax

 

    RETURN = ADP_ApplicationBeginEvent();

 

Parameters

None.

Return Codes

Value

Meaning

ADP_SUCCESS

Operation was successful.

ADP_FAILURE

Operation was unsuccessful. It can also indicate that more than one instantiation of the application was attempted.

ADP_NOT_AVAILABLE

Operation failed because the SDK library was not available. This can occur if the Intel AppUpSM center software is not installed properly.

ADP_NOT_INITIALIZED

Operation failed because the SDK library is not initialized. Any API call made prior to initialization causes this code to be generated.

ADP_NOT_AUTHORIZED

The application is not authorized to run. Applications can choose how to respond, such as preventing an application from running, allowing the application to run for a grace period so the user can obtain a license, allowing the application to run with limited functionality, etc.

ADP_TIMEOUT

Operation failed because the connection between the SDK library and the Intel AppUpSM center client software timed out.

  

Notes

  • An ADP_BeginEvent call must be preceded by a successful ADP_IsAuthorized call or an error is returned.

Code Example

The following example shows the use of the ADP_ApplicationBeginEvent call to trigger a Begin Event message. The error handler is assumed.

 

 

{

    // Initialize and Authorize Application;

    // Record Application Start

    if (( ret_code = ADP_ApplicationBeginEvent())!= ADP_SUCCESS) {

        // handle error conditions

    }

    // Application code goes here

}

 

 

End Event Call

End Events must be preceded by Begin Events, or a warning code is returned. The ADP_ApplicationEndEvent call is typically used as part of the application shutdown sequence.

Syntax

 

    RETURN = ADP_ApplicationEndEvent();

 

Parameters

None.

Return Codes

Value

Meaning

ADP_SUCCESS

Operation was successful.

ADP_FAILURE

Operation was unsuccessful. It can also indicate that more than one instantiation of the application was attempted.

ADP_NOT_AVAILABLE

Operation failed because the SDK library was not available. This can occur if the Intel AppUpSM center software is not installed properly.

ADP_NOT_INITIALIZED

Operation failed because the SDK library is not initialized. Any API call made prior to initialization causes this code to be generated.

ADP_NOT_AUTHORIZED

The application is not authorized to run. Applications can choose how to respond, such as preventing an application from running, allowing the application to run for a grace period so the user can obtain a license, allowing the application to run with limited functionality, etc.

ADP_NO_APP_BEGIN_EVENT

Operation failed because an End Event has been attempted with no prior Begin Event. A Begin Event call must precede an End Event call in the application.

ADP_TIMEOUT

Operation failed because the connection between the SDK library and the Intel AppUpSM center client software timed out.

  

Notes

  • A successful ADP_ApplicationBeginEvent call must have been previously completed or the ADP_NO_APP_BEGIN_EVENT warning code is returned.

  • A sensible approach to handing the first occurrence of an ADP_FAILURE return code (in critical situations) is to attempt the authorization sequence. This may re-establish a valid session with the Intel AppUpSM center software.

Code Example

The following example shows the use of the ADP_ApplicationEndEvent call to trigger an End Event message. The error handler is assumed.

 

 

{

    // Application code goes here

    // Record Application End

    if (( ret_code = ADP_ApplicationEndEvent())!= ADP_SUCCESS) {

        // handle error and warning conditions

    }

    // Application code goes here

}

 

 

 

 

Crash Reporting

The SDK supports Crash Reporting to provide a snapshot of the state of the application when it does crash. Default Crash Reporting is implemented using a pre-defined SDK library routine. Custom Crash Reporting can be implemented by changing elements of the pre-defined routine.

Note:  For C, no integrated error handling/crash reporting is provided (other SDKs, such as the C++, .NET, and Java SDKs, support a more integrated approach).

For default Crash Reporting, all information in the report is pre-defined by the SDK library code. Default crash reports are viewable via My Dashboard on the Intel AppUpSM Developer Program portal. This information includes application context information, runtime environment information, SDK identification information, and a core stack dump. You can view the complete report by clicking on the Details link for a specific report. The Intel AppUpTM Software Development Kit Developer Guide for C provides more information on My Dashboard and how Crash Reporting works at the client system level.

ADP_CrashReport

The ADP_ReportCrash call is used by an application to report a crash. The Intel AppUpSM center client software is responsible for delivering the report and dump information to the Intel AppUpSM Developer Program portal. Refer to the syntax information below for implementation details.

Syntax

 

    typedef struct {

        wchar_t *name;

        wchar_t *value;

    } ADP_CrashReportField;

    RETURN ADP_ReportCrash(

        const wchar_t            *Module,

        unsigned long            LineNumber,

        const wchar_t            *Message,

        const wchar_t            *Category,

        const wchar_t            *ErrorData,

        unsigned long            ErrorDataSize,

        ADP_CrashReportField     *CustomFields,

        unsigned long            CustomFieldNumber

    );

 

Parameters

Module [in, required]

The name of the application module where the error/crash occurred. Must not exceed 80 characters.

LineNumber [in, required]

The line number where the error/crash occurred.

Message [in, required]

A short message describing the error/crash or some basic information.  Must not exceed 80 characters.

Category [in, required]

A text field that can be used for sorting and grouping crash reports in the Developer Dashboard. Must not exceed 80 characters.

ErrorData [in, optional]

The detailed error data in text format to be attached to the crash record.

ErrorDataSize [in, required if ErrorData is provided]

The size of data to be attached to the crash record. Must not exceed 4000 characters.

CustomFields [in, optional]

The customized data field to be attached to the crash record, in the format of ADP_CrashReportField. Name and value fields must not exceed 80 characters each.

CustomFieldNumber [in, required if CustomFields is provided]. Must not exceed 20.

The number of customized data fields to be attached to the crash record. Must not exceed 20.

Return Codes

Value

Meaning

ADP_SUCCESS

Operation was successful.

ADP_FAILURE

Operation was unsuccessful. It can also indicate that more than one instantiation of the application was attempted.

ADP_NOT_AVAILABLE

Operation failed because the SDK library was not available. This can occur if the Intel AppUpSM center software is not installed properly.

ADP_NOT_INITIALIZED

Operation failed because the SDK library is not initialized. Any API call made prior to initialization causes this code to be generated.

ADP_NOT_AUTHORIZED

The application is not authorized to run. Applications can choose how to respond, such as preventing an application from running, allowing the application to run for a grace period so the user can obtain a license, allowing the application to run with limited functionality, etc.

ADP_TIMEOUT

Operation failed because the connection between the SDK library and the Intel AppUpSM center client software timed out.

 

Custom Crash Reporting

The table below lists the possible fields in a crash report, with the Source column defining the source (SDK or Developer) of the information for the respective field. As a developer, you can modify the fields where the Source is listed as Developer. Fields are modified by overriding the default field.

Note:  It is your responsibility to ensure that custom Crash Reports do not include any data that violates Intel Privacy rules. See http://appdeveloper.intel.com for details.

 

                                              Custom Crash Report Fields and Sources

Crash Report Fields

My Dashboard Column

Source

Application Name

No (but included in Details)

SDK

Application ID

No (but included in Details)

SDK

ModuleName

Module (and in Details)

Developer

LineNumber

Line (and in Details)

Developer

Category

No (but included in Details)

Developer

Message

Messages (and in Details)

Developer

ErrorData

No (but included in Details)

Developer

SDK API Level

No (but included in Details)

SDK

Runtime

Runtime (and in Details)

SDK

Runtime version

No (but included in Details)

SDK

OS

OS (and in Details)

SDK

OS version

No (but included in Details)

SDK

Timestamp

Timestamp (and in Details)

SDK

Up to 20 custom fields

(reserved for future use)

Developer

  

The fields with the greatest flexibility for customization are listed below:

  • The Category field allows you to create categories to sort your crash reports on the Intel AppUpSM Developer Program portal. For example, you may wish to create categories called “MEMORY”, “IO”, “USER ERROR”, etc.
  • The Error Data field allows you to create your own stack dumps or long error messages to help you understand why your application crashed.

Note: Some crashes can lead to a client system eventually halting. In these cases, the time to store a crash report on the client system may be limited. To maximize obtaining crash information, you should consider the tradeoffs between the amount of information to include in a custom crash report versus a potentially narrow window of time to store the information on the client system.

  

Return Codes

The following table is a comprehensive list of the return/error codes returned by SDK API calls to the calling routine, along with description of possible conditions that caused each code to be returned. Not every result code is returned for every API call. Refer to the information for a specific API call to see what codes may be returned for that call. (The information on a specific API call also may contain additional details on specific conditions that may cause a code to be returned for that call.) The table groups return codes into the following categories:  Success, Authorization Status, Error, and Warning.

                                                        API Call Return Codes

Success

Value

Meaning

ADP_SUCCESS

Operation was successful.

Authorization Status

Value

Meaning

ADP_AUTHORIZED

The application is authorized to run.

ADP_NOT_AUTHORIZED

The application is not authorized to run. Applications can choose how to respond, such as preventing an application from running, allowing the application to run for a grace period so the user can obtain a license, allowing the application to run with limited functionality, etc.

ADP_AUTHORIZATION_EXPIRED

The application’s license has expired. Applications can choose how to respond, such as preventing an application from running, allowing the application to run for a grace period so the user can obtain a license, allowing the application to run with limited functionality, etc.

Error

Value

Meaning

ADP_NOT_AVAILABLE

Operation failed because the SDK library was not available. This can occur if the Intel AppUpSM center software is not installed properly.

ADP_NOT_INITIALIZED

Operation failed because the SDK library is not initialized. Any API call made prior to initialization causes this code to be generated.

ADP_INCOMPATIBLE_VERSION

Operation failed because the API version of the application is not supported by the current Intel AppUpSM center software.

ADP_TIMEOUT

Operation failed because the connection between the SDK library and the Intel AppUpSM center client software timed out.

ADP_FAILURE

Operation was unsuccessful.

Warning

Value

Meaning

ADP_NO_APP_BEGIN_EVENT

Operation failed because an End Event has been attempted with no prior Begin Event. A Begin Event call must precede an End Event call in the application.

 

Code Sample

The following code sample shows a switch case routine for handling errors after the ADP_Initialize call. Variations of this routine can be used to handle errors and warnings for the other calls.

 

 

    if ((ret_code = ADP_Initialize()) != ADP_SUCCESS ){

        switch( ret_code ) {

            case ADP_INCOMPATIBLE_VERSION:

                printf( "ERROR: Incompatible version" );

                break;

            case ADP_NOT_AVAILABLE:

                printf("ERROR: Client Agent not running" );

                break;

            case ADP_TIMEOUT:

                default:

                printf("ERROR: Timeout error" );

                break;

            case ADP_FAILURE:

                default:

                printf("ERROR: Unknown error" );

                break;

        } // switch

    exit( -1 );

    } // if-then

 

End User Error Messages

The SDK contains error message strings that can be retrieved by applications and displayed to end users. These messages are accessed via their unique Message ID. They do not map directly to the Return Codes.

                                                         End User Error Messages

Message ID

Message Text

String_ADP_AUTHORIZATION_EXPIRED

The license for this application has expired.

String_ADP_BEGINEVENT_ERROMSG

The application experienced an error while starting a usage record.

String_ADP_ENDEVENT_ERRORMSG

The application experienced an error while ending a usage record.

String_ADP_FAILURE

The application experienced a critical error.

String_ADP_INCOMPATIBLE_VERSION

The current Intel AppUpSM center software does not support this version of the application.

String_ADP_NO_APP_BEGIN_EVENT

The application did not complete a start of usage record.

String_ADP_NOT_AUTHORIZED

The application is not authorized to run under this account on this device.

String_ADP_NOT_AVAILABLE

The application cannot connect to the Intel AppUpSM center.

String_ADP_NOT_INITIALIZED

The application did not initialize properly.

String_ADP_TIMEOUT

The Intel AppUpSM center response timed out.

 

Component Reference Information

This section provides reference information on components. Code examples are provided, as appropriate.

Note: An application is licensed to use a component if there is a pre-arranged agreement between the developer of the component and the developer of the application. It is the responsibility of you, the component developer, to enforce the license, i.e., to ensure that the calling application has a license to use your component.

IsAppAuthorized Call

The ADP_IsAppAuthorized call ensures that the application is authorized to use the component. The call should be included in the component initialization sequence and the result should be communicated to the application. The return code indicates authorization status or errors. The call should be followed by an error handler.

Syntax

 

    RETURN = ADP_IsAppAuthorized(ComponentID);

 

Parameters

        ComponentID:  Component GUID in string format. The data type of the GUID is four unsigned,
        long integers, as follows:
 

ADP_IsAppAuthorized(unsigned long l1, unsigned long l2, unsigned long l3, unsigned long l4)

See the Component IDs discussion later.

Return Codes

Value

Meaning

ADP_FAILURE

Operation was unsuccessful. It can also indicate that more than one instantiation of the application was attempted.

ADP_NOT_AVAILABLE

Operation failed because the SDK library was not available. This can occur if the Intel AppUpSM center software is not installed properly.

ADP_NOT_INITIALIZED

Operation failed because the SDK library is not initialized. Any API call made prior to initialization causes this code to be generated.

ADP_AUTHORIZED

The application is authorized to use the component.

ADP_NOT_AUTHORIZED

The application is not authorized to use the component. Components can choose how to respond, such as preventing the application from using the component, allowing the application to use the component for a grace period so the user can obtain a license, allowing the application to use the component with limited functionality, etc.

ADP_AUTHORIZATION_EXPIRED

The application’s license to use the component has expired. Components can choose how to respond, such as preventing the application from using the component, allowing the application to use the component for a grace period so the user can obtain a license, allowing the application to use the component with limited functionality, etc.

ADP_TIMEOUT

Operation failed because the connection between the SDK and the Intel AppUpSM center client software timed out.

 

Component IDs

The Component ID is a unique identifier for Intel AppUpSM Developer Program components. There are two types of Component IDs:  (1) a Debug Component ID, and (2) a Production Component ID. Debug Component IDs are used for testing. You must replace the Debug Component ID with a Production Component ID after testing in order to upload your application to the Intel AppUpSM Developer Program portal.

  • Debug Component ID — During development, the Debug ID allows testing with the Intel AppUp™ Software Debugger. This Debug ID is a 128-bit number, expressed as a string using predefined constants. Two versions of a Debug ID exist:

    • ADP_DEBUG_COMPONENTID:  Used with the Intel AppUp™ Software Debugger to get an ADP_AUTHORIZED response back. This allows most of the application to be tested and debugged. The actual values of this Debug ID is contained in the SDK library.

    • ADP_EXPIRED_COMPONENTID:  Used with the Intel AppUp™ Software Debugger to get an ADP_AUTHORIZATION_EXPIRED response back. This allows the “expired” branch of the application to be tested and debugged. The actual values of this Debug ID is contained in the SDK library.

  • Production Component ID — Production IDs are obtained from the Intel AppUpSM Developer Program portal, which requires that you enroll in the Intel AppUpSM Developer Program. The Production ID is a 128-bit number organized as four integers in hex format.

Notes

  • The application developer must obtain a license to use the component prior to using a component in a production environment.

  • The application must complete a successful ADP_Initialize call and a successful ADP_Authorize call prior to invoking this call.

  • A sensible approach to handling an ADP_TIMEOUT error during the first authorization attempt is to attempt authorization again.

 

Code Sample

The following code shows use of the ADP_IsAppAuthorized call. The error handler is assumed.

 

 

    bool ApplicationAuthorized = FALSE;

    ADP_RET_CODE AuthorizeMe() {

        if (ret_code = ADP_IsAppAuthorized(ADP_DEBUG_COMPONENTID)) == ADP_AUTHORIZED )

            ApplicationAuthorized = TRUE

    };

    // Error handling

 

 

 

 

Revision History

Document Number

Revision Number

Description

Revision Date

324251

001

Initial document release to support C/C++ SDK V1.0

August 2010

 

002

Updated to support C/C++ SDK V1.1:

• Added End User Error Message Information.

• Clarifications to existing content.

December 2010

 

003

Updated to support C/C++ SDK V1.1.1:

• Clarifications to existing content.

February 2011

  004 Updated to support C/C++ SDK V2.0 November 2011

 

Disclaimer and Legal Information

0