## SenseWorld Data Network

The Sense World Data Network framework is meant to make sharing of data (from sensors or internal processes) between collaborators in an interactive media art work easier, faster and more flexible. There is a central host, which receives all data, and manages the client connections. Each client can subscribe to data nodes, to use that data in its own internal processes; and each client can publish data onto the network, by creating a node. A new client can query the network which nodes are present and is informed when new nodes appear after the client has been registered.

### Data Network Elements

The data network is built up from different elements:

SWDataNetwork
  the network itself
SWDataNode
  a node is a collection of slots, usually based upon a device or another common source (e.g. result from a function).
SWDataSlot
  a slot is a single data stream

Data on the network is set by calling the function method `setData` with as arguments the node ID and an array of data values. The ID is an unique identifier. The function can be called for example by a class instance that parses serial data.

Each DataNode and each DataSlot can be given a label, so that their functionality becomes more human understandable.

### OSC interface

There is an OSC interface to the network, which allows clients to become part of the data network and access its data, and also create its own data nodes on the network.

The network will announce itself to the broadcast address of the network, to a number of ports (default: range 6000-6009, and 57120-57129), so that clients can automatically configure to connect to the network, as soon as it is in the air.

A textfile with the network's OSC port can be found in the file `http://hostip/SenseWorldDataNetwork` 1, which can be retrieved by clients, so they know where to send the registration message.

The general setup is that an OSC client first sends a register message to the data network server. Then it will start receiving ping messages, to which it has to reply with pong messages. The client has to query which nodes and slots are present on the network after registering, so it will receive info messages on each node and slot. Then it can subscribe to nodes and slots, and will receive data from the nodes and slots it is subscribed to via the data messages.

The client can supply a new node to the network, by using the /set/data message; it can also label the nodes and slots thus created. Whenever a new node or slot is added (or changed, e.g. when it gets a label), the client will receive a new info message. If there occurs an error in the communication, then an error message is sent. The unregister message only needs to be sent, if for example the client crashed and is trying to reconnect on the same port.

All messages to the server now have a reply, which is either the requested info, a confirmation message, or a warning or error.

### Clients

Clients for other software environments are available in the Help/Clients directory.
Currently there are Max patches for Max4.6 and Max5 (created by Harry Smoak, Joseph Malloch and Brett Bergmann)

### Futher documentation

Further documentation is available in the Help/doc folder, in pdf and latex source file format.
That document contains the full OSC namspace specification, how to set up the http access to the host, and the ChangeLog of the development.

- SWDataNetwork
- SWDataNode
- SWDataSlot
- SWDataNetworkSpec
- SWDataNetworkOSC
- SWDataNetworkOSCClient
- SWDataNetworkClient
- SWDataNetworkLog
- SWDataNetworkGui
- SWBusNode
- SWWatcherNode
- SWBusWatcherNode
- SWCombineNode
- SWDataAction
- GeneralHID support
- WiiMote support
- Pattern support

1
  e.g. for a host with IP 192.168.1.7 the url is: `http://192.168.1.7/SenseWorldDataNetwork`