This module defines the MultimodalMiddlewareProtocol.Device.MultimodalDevice class.

class MultimodalMiddlewareProtocol.Device.MultimodalDevice(name, server, deviceID)

The MultimodalDevice class is the main class for the implementation of new components. It is responsible for the implementation of network and protocol details, as well as to create the network message loop and register the receiving class with the network server. New components should inherit from MultimodalDevice.

The MultimodalDevice constructor is responsible for assigning an deviceID number to the new device, as well as its name and network server. The network server should be created before calling the MultimodalDevice constructor. The server should be started externally.

  • name (string) – component name
  • server (IServer) – network server to use
  • deviceID (long) – device ID number for the new device
confirmSubscription is automatically called by the standard processing loop when the subscription confirmation message is received from the MultimodalHub. This message contains the actual list of producers and consumers, registered with the MultimodalHub.

Very simple logging facility, displaying information on console.

  • text – message to be displayed.
raiseException(exception, message, fatal)
receive(sender, data)

Implements the receive method of IClient. It is called by the network server whenever a message is received. It is responsible for dispatching the message to the registered message processors.

  • sender – the server that received this message
  • data – the message in binary format
Process a Disconnection Notification, stopping the network server.
This method is responsible for sending the registration message to the Multimodal Hub. Newly created components should call this method when they are ready to operate and receive messages from the Hub.

Send Disconnection Notification Message to the Multimodal Hub, with the specified reason.

  • reason – disconnection reason to be sent
sendFields(destination, data)

Previous topic

Field Factory

Next topic

Server Classes

This Page

Quick search