StopObserving Method
Unregisters the class as an observer for a given resource.
Syntax
coap.stopObserving(URI, [callback])
Callback
The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).
The callback for this method is defined as:
function(err){ }
'err' is the error that occurred. If there was no error, then 'err' is 'null'.
'err' has 2 properties which hold detailed information:
err.code err.message
Remarks
This method unregisters the class as an observer for the resource identified by URI. This method operates in the exact same manner as the Get method, with the exception of the two things below; refer to the Get method's documentation for more information:
- When constructing the request, the class automatically includes an Observe option with a value of 1. The presence of this option indicates to the server that the class wishes to unregister from further change notifications.
- This method, unlike Get, does not return a request Id.
Note: This method can only be called when the class is operating in client mode (i.e., when the Listening property is disabled).