Qualcomm Enhanced SDK (QESDK) API Reference (2)

Qualcomm Enhanced SDK (QESDK) API Reference (2)

    • 1.2 QESDK native API overview
      • 1.2.1 qesdk_init
      • 1.2.2 qesdk_initEx
      • 1.2.3 Qesdk event callback
      • 1.2.4 qesdk_deinit
      • 1.2.5 Single subsystem init and de-init
      • 1.2.6 QESDK structure
      • 1.2.7 QESDK enumeration

1.2 QESDK native API overview

The QESDK NDK library provides the main methods for registering Android application packages (APKs), validating corresponding license files, and calling subsystem APIs.

  • qesdk_init
    This API is deprecated. Use qesdk_initEx. Initialize a QESDK session with a user-supplied license key. qesdk_initEx will trigger the authentication call for QESDK. If the authentication is successful, it will return the QESDK service handle; if the authentication fails, it will return NULL.

  • qesdk_initEx
    Initialize a QESDK session with a user-supplied license key. qesdk_initEx will trigger the authentication call for QESDK. If the authentication is successful, it will return the QESDK service handle; if the authentication fails, it will return NULL. This API is called only once per session.

  • Qesdk event callback
    Needs to be registered as a callback during qesdk_init call. Clients should implement this callback to be called when the registered service is unavailable. The specific calling method is to pass parameters, that is, the combination of opcodes and subsystems[] of the failed service.

  • qesdk_deinit
    Terminate QESDK connections initiated by the application. Terminate the QESDK connection after the application exits or by explicitly calling the qesdk_deinit function. Any API callbacks registered through the QESDK framework will be cancelled.

  • Individual subsystem init and de-init
    Applications can initialize and log out of services independently.

  • QESDK structure

  • QESDK enumeration
    Deprecated.

  • function execution
    Deprecated. Describes the function execution API for calling subsystem APIs.

  • Sample code

1.2.1 qesdk_init

This API is deprecated. Use qesdk_initEx. Initialize a QESDK session with a user-supplied license key. qesdk_initEx will trigger the authentication call for QESDK. If the authentication is successful, it will return the QESDK service handle; if the authentication fails, it will return NULL.

qesdk_handle_t qesdk_init(
      char* license,
      size_t license_size,
      fwk_event_callback cb
      )

Note:
This API is called only once per session.

parameter

  • license
    License file content

  • license_size
    License blob size

  • cb
    Callback used to notify the application subsystem that it has been disconnected.

The callback format is as follows:

typedef void (*fwk_event_callback)(uint32_t opcodes, uint32_t subsystems[]);

  • opcode – The opcode of the disconnected subsystem.
  • subsystems – List of opcodes: Disconnected subsystems.

Return results

qesdk_handle_t
Returns the QESDK service handle on success, or NULL on error.

1.2.2 qesdk_initEx

Initialize a QESDK session with a user-supplied license key. qesdk_initEx will trigger the authentication call for QESDK. If the authentication is successful, it will return the QESDK service handle; if the authentication fails, it will return NULL. This API is called only once per session.

qesdk_handle_t qesdk_initEx(char* license, size_t license_size,
                    fwk_event_callback cb)

Parameters

Parameters Description
License License file content
license_size The size of the license blob
Cb Callback used to notify the application subsystem that the connection has been disconnected.
The callback format is as follows:
typedef void (*fwk_event_callback)(uint32_t opcodes, uint32_t subsystems[]);

  • opcode – The opcode of the disconnected subsystem.
  • subsystems – List of opcodes: Disconnected subsystems.

Return results

Return results Description
qesdk_handle_t Returns the QESDK service handle when successful, and returns NULL when an error occurs.

1.2.3 Qesdk event callback

Needs to be registered as a callback during qesdk_init call. Clients should implement this callback to be called when the registered service is unavailable. The specific calling method is to pass parameters, that is, the combination of opcodes and subsystems[] of the failed service.

typedef void (*fwk_event_callback)(
      uint32_t opcodes,
      uint32_t subsystems[]
      )

Parameters

  • opcodes
    Contains an unavailable opcode

  • subsystems
    Contains an unavailable subsystem ID

If the opcode is 0, the application should initialize all services again because opcode 0 indicates that the QESDK framework restarted due to an unexpected problem.

If the opcode is non-zero, the service corresponding to the opcode should be initialized again.

td>

Operation Code Service
11 Modem
19 Performance
17 Sensor
24 Position

If Java/native uses the same service, the given server (deinitialized) will notify native/Java accordingly.

For example: If a service is initialized in both Java and the native API, and the service’s session is deinitialized in the native API, this behavior will trigger a QESDK framework event callback application in Java. vice versa.

1.2.4 qesdk_deinit

Terminate QESDK connections initiated by the application. Terminate the QESDK connection after the application exits or by explicitly calling the qesdk_deinit function. Any API callbacks registered through the QESDK framework will be cancelled.

qesdk_error_t qesdk_deinit(
      qesdk_handle_t qesdk_handle
      )

Parameters

qesdk_handle
QESDK service handle

Return results
qesdk_error_t

  • SUCCESS – Deregistration successful
  • FAILED – Unregistration failed

1.2.5 Single subsystem init and de-init

Applications can initialize and log out of services independently.

init

.init() – Parameters and return values are the same as in the init call.

For example:

  • Java
ModemManager.init( [String license], IQesdkEventCallBack cb )
  • Native
SensorsManager.init(char* license, size_t license_size, fwk_event_callback cb)

deinit

.deinit() – Parameters and return values are the same as in the deinit call.

For example:

  • Java
ModemManager.deinit()
  • Native
SensorsManager.deinit()

1.2.6 QESDK structure

Struct bnry_blb_t

Members Description
size_t
  • Data blob size
uint8_t *
  • Pointer to uint8_t blob data

1.2.7 QESDK Enumeration

  • qesdk_error_t enum
    Error code indicating QESDK native API calls.
Enum value|
0 Success
1 Failed
  • qesdk_type_t enum
    Contains data types supported by the QESDK native library.
Enumeration value
NONE
INT8
FIRSTTYPE = INT8
INT16
INT32
INT64
UINT8
UINT16
UINT32
UINT64
STRING
BOOL
LASTTYPE = BOOL