Rate This Document
Findability
Accuracy
Completeness
Readability

InitVmiEngine

Function Usage

Initializes the cloud phone server.

Restrictions

This API cannot be called repeatedly. That is, it cannot be called after the initialization is complete.

Prototype

VmiErrCode InitVmiEngine(VmiConfigEngine *config);

Parameter Description

Field Name

Input/Output

Field Type

Description

config

Input

VmiConfigEngine

This structure consists of the version and DataTypeConfig arrays.

version indicates the current version number. The DataTypeConfig array specifies whether each module needs to be initialized and the size of the memory space that needs to be reserved before the data packet header during initialization so that developers can fill in required data. The VmiConfigEngine structure is defined as follows:

struct DataTypeConfig {
    bool shouldInit = false;
    uint32_t sendDataOffset = 0;                // Space (in bytes) reserved before the data packet header when the callback is used to send data.
};

struct VmiConfigEngine {
    uint32_t version;                           // Current version
    DataTypeConfig dataTypeConfig[DATA_TYPE_MAX];
} __attribute__((packed));

Return Value Description

Data type: enum VmiErrCode: int32_t

The value can be any of the following:

  • OK (0): The initialization is successful.
  • Negative error code: Initialization failed.