ISysInfo.GetNotification()

Description:

The GetNotification method notifies the client when the value of a system attribute is changed.

This is an asynchronous method.

Syntax:

result = so.ISysInfo.GetNotification(criteria, callback);

Arguments:

  • criteria:

    This is an object that specifies the system attribute to monitor for changes. For more information about the object properties and how to define them, see section Criteria for change notifications.

  • callback:

    The callback argument is the name of the method that is executed when a GetNotification call has results or status information to return. You must define this method separately. Follow the instructions in section Defining the callback handler for an asynchronous method to define the callback method.

Return value:

The GetNotification method returns an object that contains the initial return value for the asynchronous call it started (see the following table). The actual notification information is returned by the callback method in the ReturnValue property of its result object.

Table: Return value properties for GetNotification

Property

Description

Value

result.TransactionID

This is a number used as an identification to match transactions started with the asynchronous GetNotification call to one or more calls it generates to callback.

 

result.ErrorCode

This is a number that specifies a predefined error code.

See Service API error codes.

result.ErrorMessage

This is a text string that describes the error.

See SystemInfo Service API error messages.

Table: Return value properties for GetNotification callback

Property

Description

Value

result.ReturnValue

This is an object (a system attribute object) that contains the information for the changed system attribute.

This object contains the properties Entity and Key as well as one or more additional properties representing the system attribute value. The name and type of these properties depend on the specific system attribute and its system data type.

For example, if you request notification for the Connectivity - ConnectionStatus system attribute, whose system data type is ConnectionInfo, callback returns the following properties:

  • ReturnValue.Entity

  • ReturnValue.Key

  • ReturnValue.ConnectionStatus

  • ReturnValue.IAPID

  • ReturnValue.ConnectionType

  • ReturnValue.IAPName

  • ReturnValue.NetworkName

  • ReturnValue.IAPConnectionName

See System attributes.

result.ErrorCode

This is a number that specifies a predefined error code.

See Service API error codes.

result.ErrorMessage

This is a text string that describes the error.

See SystemInfo Service API error messages.

Remarks:

Example code:

For the complete source of a sample widget that demonstrates how to use this Service API, see the full example.