PXREARobotSDK
Robot SDK for client-side communication
Loading...
Searching...
No Matches
PXREARobotSDK.h File Reference

Robot SDK header file for client-side communication. More...

Go to the source code of this file.

Data Structures

struct  PXREADevStateJson
 Device state in JSON format. More...
 
struct  PXREADevCustomMessage
 

Typedefs

typedef void(* pfPXREAClientCallback) (void *context, PXREAClientCallbackType type, int status, void *userData)
 Client callback for receiving server messages.
 

Enumerations

enum  PXREAClientCallbackType {
  PXREAServerConnect = 1<<2 , PXREAServerDisconnect = 1<<3 , PXREADeviceFind = 1<<4 , PXREADeviceMissing = 1<<5 ,
  PXREADeviceConnect = 1<<9 , PXREADeviceStateJson = 1<<25 , PXREADeviceCustomMessage = 1<<26 , PXREAFullMask = 0xffffffff
}
 

Functions

PXREACLIENTSDK_EXPORT int PXREAInit (void *context, pfPXREAClientCallback cliCallback, unsigned mask)
 SDK initialization interface.
 
PXREACLIENTSDK_EXPORT int PXREADeinit ()
 Termination interface.
 
PXREACLIENTSDK_EXPORT int PXREADeviceControlJson (const char *devID, const char *parameterJson)
 Send JSON format command to device.
 
PXREACLIENTSDK_EXPORT int PXREASendBytesToDevice (const char *devID, const char *data, unsigned len)
 Send byte stream to specified device.
 

Detailed Description

Robot SDK header file for client-side communication.

Typedef Documentation

◆ pfPXREAClientCallback

typedef void(* pfPXREAClientCallback) (void *context, PXREAClientCallbackType type, int status, void *userData)

Client callback for receiving server messages.

Parameters
contextCallback context, passed from #Init parameter 1 context
typeCallback type
statusCallback status code
userDataCallback data pointer, determined by parameter 2 type

Enumeration Type Documentation

◆ PXREAClientCallbackType

Enumerator
PXREAServerConnect 

Server connected.

PXREAServerDisconnect 

Server disconnected.

PXREADeviceFind 

Device online.

PXREADeviceMissing 

Device offline.

PXREADeviceConnect 

Device connected.

PXREADeviceStateJson 

Device state in JSON format.

PXREADeviceCustomMessage 

Custom message.

PXREAFullMask 

Mask for enabling all callbacks.

Function Documentation

◆ PXREADeinit()

PXREACLIENTSDK_EXPORT int PXREADeinit ( )

Termination interface.

Disconnect from service

◆ PXREADeviceControlJson()

PXREACLIENTSDK_EXPORT int PXREADeviceControlJson ( const char * devID,
const char * parameterJson )

Send JSON format command to device.

Parameters
devIDDevice serial number
parameterJsonFunction and parameters in JSON format, refer to robot SDK documentation for specific usage
Returns
0 Success
-1 Failure

◆ PXREAInit()

PXREACLIENTSDK_EXPORT int PXREAInit ( void * context,
pfPXREAClientCallback cliCallback,
unsigned mask )

SDK initialization interface.

Connect to service and register callback

Parameters
contextCallback context for passing user-defined data to callback function
cliCallbackCallback function pointer for listening to server messages
maskCallback mask for filtering certain server messages

◆ PXREASendBytesToDevice()

PXREACLIENTSDK_EXPORT int PXREASendBytesToDevice ( const char * devID,
const char * data,
unsigned len )

Send byte stream to specified device.

Note
This command is suitable for SDK caller's custom messages
Parameters
devIDDevice serial number
dataStarting address of byte stream
lenLength of byte stream
Returns
0 Success
-1 Failure