Sysclient

Interface for the sysclient.

File information

Filecommon/interface/sysclient.h

Classes ISysclient
USysclient

Classes

ISysclient

class ISysclient {
public:
    static class ISysclient * Create(class IIoMux * const iomux, class ISocketProvider * tcpSocketProvider, class ISocketProvider * tlsSocketProvider, class USysclient * uSysclient, const char * serverURI, class IInstanceLog * const log, const char * webserverPassword, const char * provisioningCode, const char * macAddress);
    virtual void SendIdentify(const char * challenge, const char * provisioningCode, const char * mac, const char * product, const char * version, const char * type);
    virtual void SendCustomIdentify(const void * buff, size_t len);
    virtual void Close();
};

Public functions

Create (static function)
The function is used to create a sysclient object.

Parameters

class IIoMux * const iomuxTo hold the architecture string
class ISocketProvider * tcpSocketProviderThe TCP socket provider
class ISocketProvider * tlsSocketProviderThe TLS socket provider
class USysclient * uSysclientThe USysclient instance to receive the callbacks.
const char * serverURIThe server URI (e.g. the Devices App URL)
class IInstanceLog * const log The length of the buffer
const char * webserverPasswordThe webserver password, which could be NULL
const char * provisioningCodeThe provisioning code given by Devices
const char * macAddressThe MAC address of the device

Return value

Returns the sysclient object.
SendIdentify
The function is used to send the Identify message, which is built using the parameters.

Parameters

const char * challengeThe challenge, which could be set to NULL if there is no challenge yet
const char * provisioningCodeThe provisioning code provided by Devices
const char * macThe MAC address without whitespaces, ":" or "-" and in lowercase
const char * productThe product name
const char * versionThe version (i.e. 13r1, 13r2...)
const char * typeThe type of the device in JSON format (e.g. for a phone it will be { "type": "PHONE" })
SendCustomIdentify
The function is used to send a custom Identify message.

Parameters

const char * bufferThe buffer with the JSON message
size_t len The length of the buffer
Close
Closes the sysclient object. After it is closed, the function SysClientClosed will be called.

USysclient

class USysclient {
public:
    virtual void SysclientConnected(class ISysclient * sysclient);
    virtual void SetProvisioningCode(const char * provisioningCode);
    virtual void SetManagerSysClientPassword(const char * password);
    virtual void SetPasswords(const char * admin_pwd);
    virtual void SetConfig(char * buffer);
    virtual const char * GetManagerSysClientPassword();
    virtual void SysClientClosed(class ISysclient * sysclient);
};

Public functions

SysclientConnected
The function is used to create a sysclient object.

Parameters

class ISysclient * sysclientThe ISysclient instance which will receive the callbacks.
SetProvisioningCode
The function will be called with the provisioning code.

Parameters

const char * provisioningCodeThe provisioning code provided by Devices
SetManagerSysClientPassword
The function will be called with the manager sysclient password for the device.

Parameters

const char * passwordThe manager sysclient password for the device
SetPasswords
This function will be called with the admin password.

Parameters

const char * admin_pwdThe admin password
SetConfig
Called with the config data of the device sent by Devices. This will be called several times and the last time the flag "last" will be set to too.

Parameters

char * bufferThe buffer with config data on JSON format
GetManagerSysClientPassword
The function returns the manager sysclient password.

Return value

Returns the manager sysclient password.
SysClientClosed
After the sysclient object is closed, this function is called so that the object can be deleted.

Parameters

class ISysclient * sysclientThe ISysclient instance which will receive the callbacks.