CRI ADX  Last Updated: 2024-07-17 10:47 p
Dynamic library interface for connection

The following APIs are provided for the dynamic library interface for connection.

Function Description
criAcApiClient_Initialize Initializes the connection library
criAcApiClient_Finalize Terminates the connection library
criAcApiClient_Connect Connects with CRI Atom Craft
criAcApiClient_Disconnect Disconnects with CRI Atom Craft
criAcApiClient_GetStatus Obtains the connection status with CRI Atom Craft
criAcApiClient_Call Sends the command string to CRI Atom Craft, and waits for completion
criAcApiClient_GetResponseBufferLength Gets the length of JSON string storing the API execution result in CRI Atom Craft
criAcApiClient_GetResponseBuffer Gets the JSON string storing the API execution result in CRI Atom Craft
Note
The dynamic library for connection is only used when executing Robot from programming languages other than Python.
For details, refer to Execution from other programming languages .


criAcApiClient_Initialize

Initializes the connection library.

Format

int criAcApiClient_Initialize(void);

Input parameter

None

Return value

0 if succeed, non-zero value if failed


criAcApiClient_Finalize

Terminates the connection library.

Format

void criAcApiClient_Finalize(void);

Input parameter

None

Return value

None


criAcApiClient_Connect

Connects with CRI Atom Craft.

Format

int criAcApiClient_Connect(const char* hostIpAddress, unsigned short port);

Input parameter

Name Value
hostIpAddress IP address of CRI Atom Craft
port Port number used for connection

Return value

0 if succeed, non-zero value if failed


criAcApiClient_Disconnect

Disconnects with CRI Atom Craft.

Format

void criAcApiClient_Disconnect(void);

Input parameter

None

Return value

None


criAcApiClient_GetStatus

Obtains the connection status with CRI Atom Craft.

Format

int criAcApiClient_GetStatus(void);

Input parameter

None

Return value

0 if connected, non-zero value if not connected


criAcApiClient_Call

Sends the command string to CRI Atom Craft, and waits for completion.

Format

int criAcApiClient_Call(const char* json_request, int json_request_len);

Input parameter

Name Value
hostIpAddress IP address of CRI Atom Craft
port Port number used for connection

Return value

0 or above if succeed
Less than 0 if failed


criAcApiClient_GetResponseBufferLength

Gets the length of JSON string storing the API execution result in CRI Atom Craft.

Format

int criAcApiClient_GetResponseBufferLength(void);

Input parameter

None

Return value

Length of JSON string(excluding null character)


criAcApiClient_GetResponseBuffer

Gets the JSON string storing the API execution result in CRI Atom Craft. The buffer requires the length of null character in addition to criAcApiClient_GetResponseBufferLength .
Therefore, you need a buffer with a length of at least criAcApiClient_GetResponseBufferLength plus 1.

Format

int criAcApiClient_GetResponseBuffer(char* buffer, int buffer_length);

Input parameter

Name Value
buffer String buffer for writing the API execution result string
buffer_length Length of the string that can be written to the buffer

Return value

0 if succeed, non-zero value if failed