Main Page | Data Structures | File List | Data Fields | Globals | Related Pages

writeedf.c File Reference

#include <assert.h>
#include <openedf.h>
#include <string.h>
#include <stdlib.h>
#include <sys/time.h>
#include <pctimer.h>
#include <ctype.h>
#include <nsutil.h>
#include <nsnet.h>

Go to the source code of this file.

Data Structures

struct  Options
 Command line options will be decoded into this structure. More...


Defines

#define MINLINELENGTH   4
#define DELIMS   " \r\n"

Functions

void resetSampleBuffers ()
void initSampleBuffers ()
void writeBuffers ()
void handleSamples (int packetCounter, int channels, int *samples)
int isANumber (const char *str)
void serverDied (void)
int main (int argc, char **argv)

Variables

const char * helpText
EDFDecodedConfig cfg
InputBuffer ib
char lineBuf [MAXLEN]
int linePos = 0
int blockCounter = 0
unsigned short ** sampleBuffers
unsigned int sampleCount
Options opts


Define Documentation

#define DELIMS   " \r\n"
 

Definition at line 52 of file writeedf.c.

#define MINLINELENGTH   4
 

Definition at line 51 of file writeedf.c.


Function Documentation

void handleSamples int  packetCounter,
int  channels,
int *  samples
 

Definition at line 105 of file writeedf.c.

References cfg, EDFDecodedConfig::chan, rprintf(), sampleBuffers, EDFDecodedChannelHeader::sampleCount, sampleCount, samples, and writeBuffers().

Referenced by doesMatchOpenCNV(), doesMatchP2(), doesMatchP3(), and main().

void initSampleBuffers  ) 
 

Definition at line 81 of file writeedf.c.

References cfg, EDFDecodedConfig::chan, EDFDecodedHeader::dataRecordChannels, EDFDecodedConfig::hdr, resetSampleBuffers(), sampleBuffers, and EDFDecodedChannelHeader::sampleCount.

Referenced by main().

int isANumber const char *  str  ) 
 

Definition at line 121 of file writeedf.c.

Referenced by idleHandler(), and main().

int main int  argc,
char **  argv
 

Definition at line 135 of file writeedf.c.

References cfg, cur, DEFAULTHOST, DEFAULTPORT, DELIMS, EDFPacket, Options::eegNum, Options::filename, getOK(), handleSamples(), helpText, Options::hostname, ib, initSampleBuffers(), isANumber(), isEOF(), Options::isFilenameSet, Options::isLimittedTime, lineBuf, linePos, MAXCHANNELS, MAXHEADERLEN, MINLINELENGTH, ob, opts, pctimer(), Options::port, rconnectName(), readEDFString(), readline(), rexit(), rinitNetworking(), rprintf(), rselect(), rsleep(), rsocket(), samples, Options::seconds, serverDied(), sock_fd, sock_t, and writeString().

void resetSampleBuffers  ) 
 

Definition at line 76 of file writeedf.c.

References sampleCount.

Referenced by initSampleBuffers(), and writeBuffers().

void serverDied void   ) 
 

Definition at line 129 of file writeedf.c.

References rprintf().

void writeBuffers  ) 
 

Definition at line 90 of file writeedf.c.

References blockCounter, cfg, EDFDecodedHeader::dataRecordChannels, Options::filename, EDFDecodedConfig::hdr, opts, resetSampleBuffers(), rprintf(), sampleBuffers, and sampleCount.

Referenced by handleSamples().


Variable Documentation

int blockCounter = 0
 

Definition at line 69 of file writeedf.c.

struct EDFDecodedConfig cfg
 

Definition at line 64 of file writeedf.c.

const char* helpText
 

Initial value:

"writeedf   v 0.34 by Rudi Cilibrasi\n"
"\n"
"Usage:  writeedf [options] <filename>\n"
"\n"
"        -p port          Port number to use (default 8336)\n"
"        -n hostname      Host name of the NeuroCaster server to connect to\n"
"                         (this defaults to 'localhost')\n"
"        -s <num>         Only record this many seconds.\n"
"                         (default is to record until interrupted)\n"
"        -e <intnum>      Integer ID specifying which EEG to log (default: 0)\n"
"The filename specifies the new EDF file to create.\n"

Definition at line 37 of file writeedf.c.

struct InputBuffer ib
 

Definition at line 66 of file writeedf.c.

char lineBuf[MAXLEN]
 

Definition at line 67 of file writeedf.c.

int linePos = 0
 

Definition at line 68 of file writeedf.c.

struct Options opts
 

Definition at line 74 of file writeedf.c.

unsigned short** sampleBuffers
 

Definition at line 71 of file writeedf.c.

Referenced by handleSamples(), initSampleBuffers(), and writeBuffers().

unsigned int sampleCount
 

Definition at line 72 of file writeedf.c.

Referenced by EDFDecodeChannelHeader(), EDFEncodePacket(), fetchSamples(), handleSamples(), resetSampleBuffers(), and writeBuffers().


Generated on Tue Feb 8 00:05:23 2005 for Neuroserver by doxygen 1.3.3