The fsCommBusCall function is used to call an event registered in a WASM or JS module.

 

Syntax
bool fsCommBusCall(
    const char* eventName,
    const char* buf,
    unsigned int bufSize,
    FsCommBusBroadcastFlags broadcastTo = FsCommBusBroadcast_Default
    );

 

Members
ParametersDescription
eventNameThe name of the event to call.
bufA buffer that will be sent with the callback.
bufSizeSize of the buffer that is being sent with the callback.
broadcastTo

The flags that determined which module (JS/WASM) the event is to be broadcast to. You can find more details here: FsCommBusBroadcastFlags

The default value is FsCommBusBroadcast_Default.

 

Return Values

The function returns False if something has gone wrong, otherwise it returns True.

 

Remarks

This function will post a message on a bus which will call registered functions. This part will be delayed and is not synchronous with the WASM module. This is why you cannot have a return value to know if a message has been delivered to someone, only a return to know if there has been some internal error (eg: buf = nullptr and size != 0 for instance).