bcixml — Encoding and Decoding of BCI XML messages.

Encoding and decoding of bci-xml packages.

class lib.bcixml.BciSignal(data, commands, type)

Represents a signal from the BCI network.

A BciSignal object can be translated to XML and vice-versa.

exception lib.bcixml.DecodingError(value)
Message could not be decoded.
exception lib.bcixml.EncodingError(value)
Something message cound not be encoded.
exception lib.bcixml.Error(value)
Our own exception type.
class lib.bcixml.XmlDecoder

Parses XML strings and returns BciSignal containing the data of the signal.

Usage:

decoder = XmlDecoder() try:

bcisignal = decoder.decode_packet(xml)
except DecodingError:
...
decode_packet(packet)

Parse the XML string and return a BciSignal.

A DecodingError is raised when the parsing of the packet failed.

class lib.bcixml.XmlEncoder

Generates an XML string from a BciSignal object.

Usage:

enc = XmlEncoder() try:

xml = enc.encode_packet(bcisignal)
except EncodingError:
...
encode_packet(signal)

Generates an XML packet from a BciSignal object.

An EncodingError is raised if the encoding failed.

Module author: Bastian Venthur <venthur@cs.tu-berlin.de>

Previous topic

bcinetwork — Networking between the different Pyff components.

Next topic

feedbackcontroller — Feedback Controller.

This Page