Contenido principal

registerEventCallback

Class: wnet.Node
Namespace: wnet

Register callback for event notification from node

Since R2026a

Description

registerEventCallback(wirelessNode,eventName,callback) registers the callback function callback for the specified event notification eventName, from the node wirelessNode. You can override this method so it triggers the callbacks registered for the specified event.

Input Arguments

expand all

Wireless node, specified as an object of a subclass of wnet.Node.

Name of the event, specified as a string scalar, character vector, vector of strings, or cell array of character vectors.

Data Types: string | char

Callback function to run when wnet.Node notifies an event, specified as a function handle.

Note that, the syntax for the callback function must be @(eventStruct) callback(eventStruct). wnet.Node must pass a structure (eventStruct) containing event notification data as the first mandatory argument to the callback function.

Version History

Introduced in R2026a