#include <stdio.h>
#include <ctype.h>
#include <fcntl.h>
#include <assert.h>
#include <string.h>
#include <openedf.h>
#include <nsnet.h>
#include <nsutil.h>
#include <config.h>
#include <neuro/cmdhandler.h>
#include "nsd.h"
Go to the source code of this file.
Data Structures | |
struct | Client |
Defines | |
#define | MAXEDFCHANNELS 64 |
#define | TIMEOUT 30 |
Enumerations | |
enum | RoleCode { Unknown, EEG, Display, Controller } |
Functions | |
const char * | stringifyRole (enum RoleCode role) |
int | countInRole (enum RoleCode role) |
void | sendClientMsg (int cliInd, const char *msg) |
void | sendClientMsgNL (int cliInd, const char *msg) |
const char * | getLineBuf (void) |
void | sendResponseOK (int cliInd) |
void | sendResponseBadRequest (int cliInd) |
void | cmdgo (struct CommandHandler *ch, int cliInd) |
void | cmdnogo (struct CommandHandler *ch, int cliInd) |
void | cmdRole (struct CommandHandler *ch, int cliInd) |
void | cmdUnwatch (struct CommandHandler *ch, int cliInd) |
void | cmdWatch (struct CommandHandler *ch, int cliInd) |
void | cmdDataFrame (struct CommandHandler *ch, int cliInd) |
void | cmdGetHeader (struct CommandHandler *ch, int cliInd) |
void | cmdSetHeader (struct CommandHandler *ch, int cliInd) |
void | cmdStatus (struct CommandHandler *ch, int cliInd) |
void | cmdClose (struct CommandHandler *ch, int cliInd) |
void | cmdDisplay (struct CommandHandler *ch, int cliInd) |
void | cmdEEG (struct CommandHandler *ch, int cliInd) |
void | cmdControl (struct CommandHandler *ch, int cliInd) |
void | cmdHello (struct CommandHandler *ch, int cliInd) |
int | makeNewClient (struct CommandHandler *ch, sock_t fd) |
int | main () |
Variables | |
EDFDecodedConfig | current |
Client | clients [MAXCLIENTS] |
int | clientCount = 0 |
|
Definition at line 40 of file nsd.c. Referenced by cmdDataFrame(). |
|
Definition at line 42 of file nsd.c. Referenced by main(). |
|
|
|
Definition at line 272 of file nsd.c. References clients, Client::markedForDeletion, and sendResponseOK(). Referenced by main(). |
|
Definition at line 298 of file nsd.c. References clients, Controller, countInRole(), Client::role, sendResponseBadRequest(), sendResponseOK(), and Unknown. Referenced by main(). |
|
Definition at line 191 of file nsd.c. References buf, clientCount, clients, fetchIntParameters(), Client::isDisplaying, MAXEDFCHANNELS, MAXLEN, samples, sendClientMsg(), sendResponseBadRequest(), and sendResponseOK(). Referenced by main(). |
|
Definition at line 278 of file nsd.c. References clients, Display, Client::role, sendResponseBadRequest(), sendResponseOK(), and Unknown. Referenced by main(). |
|
Definition at line 288 of file nsd.c. References clients, EEG, Client::role, sendResponseBadRequest(), sendResponseOK(), and Unknown. Referenced by main(). |
|
Definition at line 224 of file nsd.c. References clientCount, clients, Display, EEG, fetchIntParameters(), Client::headerLen, Client::role, sendClientMsgNL(), sendResponseBadRequest(), and sendResponseOK(). Referenced by main(). |
|
command for Controllers: start go trial go 0 activates a go trial (for event related potentials) in EEG device 0 Definition at line 122 of file nsd.c. References clientCount, clients, Controller, EEG, fetchIntParameters(), Client::role, rprintf(), sendClientMsgNL(), sendResponseBadRequest(), and sendResponseOK(). Referenced by main(). |
|
Definition at line 308 of file nsd.c. References sendResponseOK(). Referenced by main(). |
|
Definition at line 137 of file nsd.c. References clientCount, clients, Controller, EEG, fetchIntParameters(), Client::role, rprintf(), sendClientMsgNL(), sendResponseBadRequest(), and sendResponseOK(). Referenced by main(). |
|
Definition at line 155 of file nsd.c. References clients, rprintf(), sendClientMsgNL(), sendResponseOK(), and stringifyRole(). Referenced by main(). |
|
Definition at line 238 of file nsd.c. References buf, clients, current, EEG, getLineBuf(), Client::headerBuf, Client::headerLen, makeREDFConfig(), readEDFString(), Client::role, rprintf(), sendResponseBadRequest(), sendResponseOK(), and writeEDFString(). Referenced by main(). |
|
Definition at line 261 of file nsd.c. References buf, clientCount, clients, sendClientMsg(), sendResponseOK(), and stringifyRole(). Referenced by main(). |
|
Definition at line 162 of file nsd.c. References clientCount, clients, Display, EEG, fetchIntParameters(), Client::isDisplaying, Client::role, sendResponseBadRequest(), and sendResponseOK(). Referenced by main(). |
|
Definition at line 177 of file nsd.c. References clientCount, clients, Display, EEG, fetchIntParameters(), Client::isDisplaying, Client::role, sendResponseBadRequest(), and sendResponseOK(). Referenced by main(). |
|
Definition at line 313 of file nsd.c. References clientCount, clients, and Client::role. Referenced by cmdControl(). |
|
Definition at line 78 of file nsd.c. References lineBuf. Referenced by cmdSetHeader(). |
|
Definition at line 359 of file nsd.c. References clientCount, clients, cmdClose(), cmdControl(), cmdDataFrame(), cmdDisplay(), cmdEEG(), cmdGetHeader(), cmdgo(), cmdHello(), cmdnogo(), cmdRole(), cmdSetHeader(), cmdStatus(), cmdUnwatch(), cmdWatch(), DEFAULTPORT, Display, EEG, enregisterCommand(), handleLine(), ib, inputBufferEmpty(), Client::isDisplaying, isEOF(), Client::lastAlive, Client::lineBuf, lineBuf, Client::linePos, linePos, makeNewClient(), Client::markedForDeletion, max_fd, MAXLEN, my_read(), newCommandHandler(), OSTYPESTR, raccept(), rbindAll(), rexit(), rinitNetworking(), Client::role, rprintf(), rselect(), rshutdown(), rsocket(), rtime(), sock_fd, sock_t, TIMEOUT, and updateMaxFd(). |
|
Definition at line 343 of file nsd.c. References clientCount, clients, Client::fd, Client::headerLen, ib, initInputBuffer(), initOutputBuffer(), Client::linePos, Client::markedForDeletion, newClientStarted(), ob, Client::role, rtime(), and Unknown. Referenced by main(). |
|
Definition at line 83 of file nsd.c. References clients, Client::markedForDeletion, ob, rprintf(), rtime(), and writen(). Referenced by cmdDataFrame(), cmdStatus(), sendClientMsgNL(), sendResponseBadRequest(), and sendResponseOK(). |
|
Definition at line 72 of file nsd.c. References sendClientMsg(). Referenced by cmdGetHeader(), cmdgo(), cmdnogo(), and cmdRole(). |
|
Definition at line 111 of file nsd.c. References sendClientMsg(). Referenced by cmdControl(), cmdDataFrame(), cmdDisplay(), cmdEEG(), cmdGetHeader(), cmdgo(), cmdnogo(), cmdSetHeader(), cmdUnwatch(), and cmdWatch(). |
|
Definition at line 105 of file nsd.c. References sendClientMsg(). Referenced by cmdClose(), cmdControl(), cmdDataFrame(), cmdDisplay(), cmdEEG(), cmdGetHeader(), cmdgo(), cmdHello(), cmdnogo(), cmdRole(), cmdSetHeader(), cmdStatus(), cmdUnwatch(), and cmdWatch(). |
|
Definition at line 322 of file nsd.c. References Controller, Display, EEG, and Unknown. Referenced by cmdRole(), and cmdStatus(). |
|
Definition at line 65 of file nsd.c. Referenced by cmdDataFrame(), cmdGetHeader(), cmdgo(), cmdnogo(), cmdStatus(), cmdUnwatch(), cmdWatch(), countInRole(), main(), and makeNewClient(). |
|
Definition at line 64 of file nsd.c. Referenced by cmdClose(), cmdControl(), cmdDataFrame(), cmdDisplay(), cmdEEG(), cmdGetHeader(), cmdgo(), cmdnogo(), cmdRole(), cmdSetHeader(), cmdStatus(), cmdUnwatch(), cmdWatch(), countInRole(), main(), makeNewClient(), and sendClientMsg(). |
|
Definition at line 46 of file nsd.c. Referenced by cmdSetHeader(), and main(). |