public class EEGPacketGenerator extends java.lang.Object implements PacketGenerator, JavaMessageHandler
| Constructor and Description |
|---|
EEGPacketGenerator(java.lang.String ID,
java.lang.String files)
Creates a new EEGPacketGenerator with the given values.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
generatePacket(int packetSize)
Generates a byte array containing a segment of EEG data.
|
void |
grabFiles(java.lang.String inListFile)
Reads the specified files (presumably containing EEG data) and segments
the data.
|
void |
handleMessage(byte[] msg)
Function to handle messages recieved via a
StreamReader. |
public EEGPacketGenerator(java.lang.String ID,
java.lang.String files)
ID - a String identifying the stream to which the packets produced
by this EEG packet generator belongfiles - path to a file containing a list of files which contain the
actual data (each filename in the list must be on its own line)public void grabFiles(java.lang.String inListFile)
throws java.io.IOException
fileList - the path to the file which contains a list of filenames,
one per line; each of the listed files should contain EEG readingsjava.io.IOException - if an I/O error occurs when reading from the filepublic void handleMessage(byte[] msg)
JavaMessageHandlerStreamReader.
Allows the user to define an asynchronous method of handling messageshandleMessage in interface JavaMessageHandlermsg - byte[] to be decodedpublic byte[] generatePacket(int packetSize)
generatePacket in interface PacketGeneratorpacketSize - the size of desired packet, in bytes