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 * macAddress, const char * product, const char * version, const char * platformJson, const char * ethIfsJson = nullptr, const char * major = nullptr, bool isInnovaphoneDevice = false, const char * webserverRootPage = nullptr,
        const char * firmwareVersion = nullptr, const char * bootcodeVersion = nullptr, const char * firmwareFileName = nullptr, const char * bootcodeFileName = nullptr);
    virtual void SendIdentify(const char * provisioningCode);
    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 logA log object for logging.
const char * webserverPasswordThe webserver password, which could be NULL
const char * macAddressThe MAC address of the device
const char * productThe product name
const char * versionThe complete version string (i.e. 13r1 1234566, 13r2...)
const char * platformJsonThe type of the device in JSON format (e.g. for a phone it will be { "type": "PHONE" })
const char * ethIfsJsonA JSON string with an array of ethernet interfaces, e.g. [{"if":"ETH0","ipv4":"172.16.14.40","ipv6":"2002:91fd:9d07:14:290:33ff:fe3e:4f67"}]
const char * majorJust the major version (i.e. 13r1, 13r2...)
bool isInnovaphoneDeviceBoolean if this is an innovaphone device or not.
const char * webserverRootPageThe root page of the local webserver which shall be displayed by the Devices App in an IFrame. If empty, Devices itself tries to guess the root page depending on the platformJson.
const char * firmwareVersionThe firmware version, e.g. 14200033 .
const char * bootcodeVersionThe bootcode version, e.g. 14200033 .
const char * firmwareFileNameThe firmware filename, e.g. ip311.bin .
const char * bootcodeFileNameThe bootcode filename, e.g. boot311.bin .
word webserverPortThe local webserverPort, default is 80.

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 * provisioningCodeThe provisioning code provided by Devices
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 SysClientSetProvisioningCode(class ISysClient * sysClient, const char * provisioningCode);
    virtual void SysClientSetSysClientPassword(class ISysClient * sysClient, const char * password);
    virtual void SysClientSetAdminPassword(class ISysClient * sysClient, const char * password);
    virtual void SysClientSetConfig(class ISysClient * sysClient, char * buffer);
    virtual const char * SysClientGetPassword(class ISysClient * sysClient);
    virtual void SysClientClosed(class ISysClient * sysClient);
};

Public functions

SysClientConnected
The function is called if the sysclient is connected.
You now need to call sysclient->SendIdentify(), with or without a provisioning code, which depends on your setup.

Parameters

class ISysClient * sysClientThe ISysClient instance which will receive the callbacks.
SysClientSetProvisioningCode
The function will be called with a provisioning code, normally to delete it.

Parameters

class ISysClient * sysClientThe ISysClient instance which will receive the callbacks.
const char * provisioningCodeThe provisioning code provided by Devices.
SysClientSetSysClientPassword
The function will be called with the sysclient password for the device.

Parameters

class ISysClient * sysClientThe ISysClient instance which will receive the callbacks.
const char * passwordThe sysclient password for the device
SysClientSetAdminPassword
This function will be called with the admin password.

Parameters

class ISysClient * sysClientThe ISysClient instance which will receive the callbacks.
const char * passwordThe admin password
SysClientSetConfig
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

class ISysClient * sysClientThe ISysClient instance which will receive the callbacks.
char * bufferThe buffer with config data on JSON format
SysClientGetPassword
The function returns the sysclient password.

Parameters

class ISysClient * sysClientThe ISysClient instance which will receive the callbacks.

Return value

Returns the 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.