TCP server

The module WiFi for OpenBCI receive the instructions to connect with a TCP server, before that happens, the server must be running and waiting for clients.

class openbci_stream.acquisition.tcp_server.WiFiShieldTCPServer(host, binary_stream: Callable, kafka_context: Callable)[source]

Create a TCP server that handles the connexión of the WiFi module.

Parameters
  • host – IP address of the machine that WiFi module will connect.

  • binary_stream – Function that return a kafka producer, this producer could not exist in the very moment of creation of this class instance.

  • kafka_context – Funtion that return the information from the acquisition side useful for deserializing and will be packaged back in the stream.

_handle_read() None[source]

Write the input streaming into the binary stream.

There is a maximum of 3000 bytes that can read at once, so it is set to 2970, a 33 multiple. But this not means that read this amount of data on all events, the module WiFi will send with their own consideration.

handle_accept() None[source]

Redirect the client connection.