Commit d5914054 authored by nfoy's avatar nfoy
Browse files

improve comments a bit

parent 408b909b
#!/usr/bin/python3
# Example of tcp tagging client
# The tag format is the same as with Shared Memory Tagging. It comprises three blocks of 8 bytes:
#
# ----------------------------------------------------------------------
# | padding (8 bytes) | event id (8 bytes) | timestamp (8 bytes) |
# ----------------------------------------------------------------------
#
# The padding is only for consistency with Shared Memory Tagging and has no utility.
# The event id informs about the type of event happening.
# The timestamp is the posix time (ms since Epoch) at the moment of the event.
# It the latter is set to 0, the acquisition server issues its own timestamp upon reception of the stimulation.
import sys
import socket
......@@ -10,7 +20,7 @@ from time import time, sleep
HOST = '127.0.0.1'
PORT = 15361
# Event identifier
# Event identifier (See stimulation codes in OpenVibe documentation)
EVENT_ID = 5+0x8100
# Artificial delay (ms). It may need to be increased if the time to send the tag is too long and causes tag loss.
......
......@@ -90,7 +90,7 @@ public:
void startRead()
{
// Caveat: a shared pointer is used (instead of simply using this) to ensure that this instance of TagSession is still alive when the call-back is called.
// Caveat: a shared pointer is used (instead of simply using this) to ensure that this instance of TagSession is still alive when the callback is called.
boost::asio::async_read(m_socket, boost::asio::buffer((void *) &m_tag, sizeof(Tag)), boost::bind(&TagSession::handleRead, shared_from_this(), _1));
}
......@@ -207,6 +207,8 @@ CPluginTCPTagging::CPluginTCPTagging(const OpenViBE::Kernel::IKernelContext& rKe
: IAcquisitionServerPlugin(rKernelContext, CString("AcquisitionServer_Plugin_TCPTagging"))
{
m_rKernelContext.getLogManager() << Kernel::LogLevel_Info << "Loading plugin: TCP Tagging\n";
bool truc;
m_oSettingsHelper.add("Truc", &truc)
}
CPluginTCPTagging::~CPluginTCPTagging()
......
......@@ -3,7 +3,21 @@
/**
* \brief Acquisition Server plugin adding the capability to receive stimulations from external sources
* via TCP.
* via TCP/IP.
*
* The stimulation format is the same as with Shared Memory Tagging. It comprises three blocks of 8 bytes:
*
* ----------------------------------------------------------------------
* | padding (8 bytes) | event id (8 bytes) | timestamp (8 bytes) |
* ----------------------------------------------------------------------
*
* The padding is only for consistency with Shared Memory Tagging and has no utility.
* The event id informs about the type of event happening.
* The timestamp is the posix time (ms since Epoch) at the moment of the event.
* It the latter is set to 0, the acquisition server issues its own timestamp upon reception of the stimulation.
*
* Have a look at contrib/plugins/server-extensions/tcp-tagging/client-example to learn about the protocol
* to send stimulations from the client.
*/
#include "ovasIAcquisitionServerPlugin.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment