IPWorks IoT 2020 ActiveX Edition

Questions / Feedback?

Register Event

Fires when a client wishes to register for notifications.

Syntax

Sub coapcontrol_Register(RemoteHost As String, RemotePort As Integer, URI As String, URIHost As String, URIPort As Integer, URIPath As String, URIQuery As String, Token As String, Accept As Boolean)

Remarks

This event fires anytime a client wishes to register itself as an observer for the resource identified by URI. Refer to the StartObserving and SendNotification methods, as well as the Notification event, for more information about observing resources and resource change notifications.

Any options included in the request can be obtained by querying the RequestOption* properties.

To correctly handle this event, populate the ResponseCode, ResponseData, ResponseContentFormat, ResponseETag, and ResponseOption* properties as desired before this event finishes. (This must be done regardless of the Accept parameter's final value; see below for more information on why).

The RemoteHost parameter reflects the client's IP address or hostname.

The RemotePort parameter reflects the client's port.

The URI parameter reflects the exact resource URI that the client wishes to observe (the CoAP specification states that the full URI must be used to track observers). This value must be passed exactly as-is to the SendNotification method to notify observers of changes to the resource.

The URIHost, URIPort, URIPath, and URIQuery parameters are provided for additional convenience

The Token parameter reflects the token included in the registration request.

The Accept parameter specifies whether the control should accept the registration. By default, it is False, and the request will be treated like a normal GET request. Setting it to True will cause the control to add the client to its internal list of registered observers for the specified URI.

Note: This event is only used when the control is operating in server mode (i.e., when the Listening property is enabled).

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks IoT 2020 ActiveX Edition - Version 20.0 [Build 8265]