Sysclient
Interface for the sysclient.
File information
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 iomux | To hold the architecture string |
class ISocketProvider * tcpSocketProvider | The TCP socket provider |
class ISocketProvider * tlsSocketProvider | The TLS socket provider |
class USysclient * uSysclient | The USysclient instance to receive the callbacks. |
const char * serverURI | The server URI (e.g. the Devices App URL) |
class IInstanceLog * const log | The length of the buffer |
const char * webserverPassword | The webserver password, which could be NULL |
const char * provisioningCode | The provisioning code given by Devices |
const char * macAddress | The 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 * challenge | The challenge, which could be set to NULL if there is no challenge yet |
const char * provisioningCode | The provisioning code provided by Devices |
const char * mac | The MAC address without whitespaces, ":" or "-" and in lowercase |
const char * product | The product name |
const char * version | The version (i.e. 13r1, 13r2...) |
const char * type | The 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 * buffer | The 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 * sysclient | The ISysclient instance which will receive the callbacks. |
SetProvisioningCode
-
The function will be called with the provisioning code.
Parameters
const char * provisioningCode | The provisioning code provided by Devices |
SetManagerSysClientPassword
-
The function will be called with the manager sysclient password for the device.
Parameters
const char * password | The manager sysclient password for the device |
SetPasswords
-
This function will be called with the admin password.
Parameters
const char * admin_pwd | The 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 * buffer | The 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 * sysclient | The ISysclient instance which will receive the callbacks. |