Sending messages
The Appliance Statistics cluster server resides on the appliance (e.g. a washing machine) and the cluster client resides on a controlling device (normally a remote control unit).
Messages can be sent between the client and the server in the following ways:
The client can enquire whether any data logs are available on the appliance (server) by sending a ‘Log Queue Request’ to the server (which will reply with a ‘Log Queue Response’ message)
The server can notify the client that data logs are available by sending an unsolicited ‘Statistics Available’ message to the client
The client can request a current data log from the appliance (server) by sending a ‘Log Request’ message to the server (which will reply with a ‘Log Response’ message)
The server can send an unsolicited data log to the client in a ‘Log Notification’ message
Sending the above messages is described in the sub-sections below.
‘Log Queue Request’ messages from client to server
The application on the cluster client can enquire about the availability of data logs on the appliance by sending a ‘Log Queue Request’ message to the server. This message is sent by calling the function eCLD_ASCLogQueueRequestSend(). This function returns immediately and the log availability is later returned in an E_CLD_APPLIANCE_STATISTICS_CMD_LOG_QUEUE_RESPONSE event, which is generated when a response arrives from the server (Appliance Statistics events are described in Section 48.5).
Note: The cluster server handles the ‘Log Queue Request’ message automatically and returns the requested information in a ‘Log Queue Response’ message to the client.
The log availability information from the message payload is contained in the above event, and comprises the number of logs currently in the log queue and their log IDs - for details of this payload and the availability information, refer to Section 48.9.4.
Parent topic:Sending messages
‘Statistics Available’ messages from server to client
The cluster server can notify the client when data logs are available by sending an unsolicited ‘Statistics Available’ message to the client. This message contains the number of logs in the log queue and the log IDs. A message of this kind can be sent by the application on the server by calling either of the following functions:
eCLD_ASCStatisticsAvailableSend()
eCLD_ASCLogQueueResponseORStatisticsAvailableSend()
Note:
The latter function is also used internally by the cluster server to send a ‘Log Queue Response’ message - see Section 48.3.1.
Before calling either function, the relevant log(s) should be added to the local log queue as described in Section 48.4.1. This is because the logs need to be in the queue to allow the server to perform further actions on them - for example, to process a ‘Log Request’.
The log availability information from the ‘Statistics Available’ message is reported to the application on the cluster client through the event E_CLD_APPLIANCE_STATISTICS_CMD_STATISTICS_AVAILABLE, which is generated when the message arrives from the server (Appliance Statistics events are described in Section 48.5). The availability information from the message payload is contained in the above event - for details of this payload and the availability information, refer to Section 48.9.4.
Parent topic:Sending messages
‘Log Request’ messages from client to server
The application on the cluster client can request the log with a particular log ID from the appliance by sending a ‘Log Request’ message to the server. This message is sent by calling the function eCLD_ASCLogRequestSend(). This function returns immediately and the requested log information is later returned in an E_CLD_APPLIANCE_STATISTICS_CMD_LOG_QUEUE_RESPONSE event, which is generated when a response arrives from the server (Appliance Statistics events are described in Section 48.5).
Note:
This function should normally be called after a ‘Log Queue Response’ or ‘Statistics Available’ message has been received by the client, indicating that logs are available on the server.
The cluster server handles the ‘Log Request’ message automatically and returns the requested log information in a ‘Log Response’ message to the client.
The log information from the message payload is contained in the above event - for details of this payload and the supplied log information, refer to Section 48.9.3.
Parent topic:Sending messages
‘Log Notification’ messages from server to client
The cluster server can supply the client with an individual data log by sending an unsolicited ‘Log Notification’ message to the client. This message is sent by the application on the server by calling either of the following functions:
eCLD_ASCLogNotificationSend()
eCLD_ASCLogNotificationORLogResponseSend()
Note:
The latter function is also used internally by the cluster server to send a ‘Log Response’ message - see Section 48.3.1.
Before calling either function, the relevant log should be in the local log queue (see Section 48.4.1). This is because the log needs to be in the queue to allow the server to perform further actions on it - for example, to process a ‘Log Request’.
The function eCLD_ASCAddLog() used to add a log to the local log queue (see Section 48.4.1) automatically sends a ‘Log Notification’ message to all bound Appliance Statistics cluster clients.
The log information from the ‘Log Notification’ message is reported to the application on the cluster client through the event E_CLD_APPLIANCE_STATISTICS_CMD_LOG_NOTIFICATION, which is generated when the message arrives from the server (Appliance Statistics events are described in Section 48.5). The log information from the message payload is contained in the above event - for details of this payload and the supplied log information, refer to Section 48.9.3.
Parent topic:Sending messages
Parent topic:Appliance Statistics Cluster