LibMuse 6.0.2
com.choosemuse.libmuse.MuseDataPacket Class Referenceabstract

Public Member Functions

abstract MuseDataPacketType packetType ()
 
abstract long timestamp ()
 
abstract ArrayList< Double > values ()
 
abstract long valuesSize ()
 
abstract double getEegChannelValue (Eeg channelNum)
 
abstract double getBatteryValue (Battery b)
 
abstract double getAccelerometerValue (Accelerometer a)
 
abstract double getGyroValue (Gyro g)
 
abstract double getDrlRefValue (DrlRef drl)
 

Static Public Member Functions

static native MuseDataPacket makeUninitializedPacket (long capacity)
 
static native MuseDataPacket makePacket (MuseDataPacketType type, long timestamp, ArrayList< Double > values)
 

Detailed Description

Contains information received from the headband. Each packet can represent different data: eeg, accelerometer, quantization, etc. Take a look at MuseDataPacketType enum for all possible types

Member Function Documentation

§ getAccelerometerValue()

abstract double com.choosemuse.libmuse.MuseDataPacket.getAccelerometerValue ( Accelerometer  a)
abstract

Get the Accelerometer value from the packet.

Calling this function does not perform additional allocations and is preferable to using values().

Parameters
athe Accelerometer value to retrieve (ie. Accelerometer.X )
Returns
the value requested.
Exceptions
SIGABRTIf this function is called on a packet type that is not type MuseDataPacketType.ACCELEROMETER , LibMuse will throw an exception. Use packetType() to check the type before calling this function.

§ getBatteryValue()

abstract double com.choosemuse.libmuse.MuseDataPacket.getBatteryValue ( Battery  b)
abstract

Get the Battery value from the packet.

Calling this function does not perform additional allocations and is preferable to using values().

Parameters
bthe Battery value to retrieve (ie. Battery.MILLIVOLTS )
Returns
the value requested.
Exceptions
SIGABRTIf this function is called on a packet type that is not type MuseDataPacketType.BATTERY , LibMuse will throw an exception. Use packetType() to check the type before calling this function.

§ getDrlRefValue()

abstract double com.choosemuse.libmuse.MuseDataPacket.getDrlRefValue ( DrlRef  drl)
abstract

Get the DrlRef value from the packet.

Calling this function does not perform additional allocations and is preferable to using values().

Parameters
drlthe DrlRef value to retrieve (ie. DrlRef.DRL )
Returns
the value requested.
Exceptions
SIGABRTIf this function is called on a packet type that is not type MuseDataPacketType.DRL_REF , LibMuse will throw an exception. Use packetType() to check the type before calling this function.

§ getEegChannelValue()

abstract double com.choosemuse.libmuse.MuseDataPacket.getEegChannelValue ( Eeg  channelNum)
abstract

Get the raw EEG or EEG derived value from the packet. EEG derived value are data that is calculated based on the raw EEG values. Take a look at enum in MuseDataPacketType for values derived from EEG channel. Please refer to http://developer.choosemuse.com/hardware-firmware/hardware-specifications to see what EEGx represents for head location. Calling this function does not perform additional allocations and is preferable to using values().

Parameters
channelNumthe EEG channel to retrieve. (ie. Eeg.EEG1)
Returns
the value requested.
Exceptions
SIGABRTIf this function is called on a packet type that is not type MuseDataPacketType.EEG , LibMuse will throw an exception. Use packetType() to check the type before calling this function.

§ getGyroValue()

abstract double com.choosemuse.libmuse.MuseDataPacket.getGyroValue ( Gyro  g)
abstract

Get the Gyro value from the packet.

Calling this function does not perform additional allocations and is preferable to using values().

Parameters
gthe Gyro value to retrieve (ie. Gyro.X )
Returns
the value requested.
Exceptions
SIGABRTIf this function is called on a packet type that is not type MuseDataPacketType.GYRO , LibMuse will throw an exception. Use packetType() to check the type before calling this function.

§ makePacket()

static native MuseDataPacket com.choosemuse.libmuse.MuseDataPacket.makePacket ( MuseDataPacketType  type,
long  timestamp,
ArrayList< Double >  values 
)
static

Create a new packet with the given contents.

Parameters
typethe type of packet to create
timestampthe timestamp of the packet
valuesthe data the packet contains.

§ makeUninitializedPacket()

static native MuseDataPacket com.choosemuse.libmuse.MuseDataPacket.makeUninitializedPacket ( long  capacity)
static

Create a new packet with reserved capacity but unspecified contents.

Parameters
capacitythe number of data entries to reserve.

§ packetType()

abstract MuseDataPacketType com.choosemuse.libmuse.MuseDataPacket.packetType ( )
abstract

Specifies what kind of values are stored in the packet.

Returns
the type of packet.

§ timestamp()

abstract long com.choosemuse.libmuse.MuseDataPacket.timestamp ( )
abstract

Microseconds since epoch (usually Jan 1, 1970).

Returns
the timestamp of the packet expressed in microseconds since epoch.

§ values()

abstract ArrayList<Double> com.choosemuse.libmuse.MuseDataPacket.values ( )
abstract

Raw packet data as an array. The size of this array and the meaning of its elements depend on the packet type. See the documentation for MuseDataPacketType for details.

Note that this method causes new memory to be allocated for an array of boxed double values. If this impacts your application's performance, you should use get_xxx_value() methods instead.

Deprecated:
Use MuseDataPacket.getAccelerometerValue() , MuseDataPacket.getBatteryValue() , MuseDataPacket.getDrlRefValue() , MuseDataPacket.getEegChannelValue() , MuseDataPacket.getGyroValue() instead.

§ valuesSize()

abstract long com.choosemuse.libmuse.MuseDataPacket.valuesSize ( )
abstract

Get the number of values in this packet.

Returns
the number of data values in this packet.

The documentation for this class was generated from the following file: