public class ADPDApplication extends CommonApplication
Constructor and Description |
---|
ADPDApplication(PacketManager packetManager) |
Modifier and Type | Method and Description |
---|---|
ClockCalibrationPacket |
calibrateClock(Clock clock)
Calibrate clock to specified clock ID.
|
ADPDCreateDeviceConfiguration |
createDeviceConfiguration(SlotApp[][] slotsAndAppIDs)
Create ADPD device configuration.
|
ADPDDCBCommandPacket |
deleteDeviceConfigurationBlock()
Deletes ADPD Device configuration block.
|
AgcControlPacket |
disableAgc(ADPDLed[] ledIDs)
Disables AGC for LED in array.
|
void |
disableCSVLogging(Stream stream)
Stop logging stream data into CSV.
|
SaturationCheckPacket |
disableSaturationCheck(ADPDSlot[] slotList)
Disables Saturation for slots in list.
|
ActiveSlotPacket |
disableSlot(ADPDSlot slot)
Disable Specified ADPD Slot.
|
ADPDUCHRPacket |
disableUCHR(ADPDSlot slot)
Disable ADPD and ADXL streams for synchronization.
|
AgcControlPacket |
enableAgc(ADPDLed[] ledIDs)
Enables AGC for LEDs in array.
|
void |
enableCSVLogging(java.io.File file,
Stream stream)
Start logging stream data into CSV.
|
SaturationCheckPacket |
enableSaturationCheck(ADPDSlot[] slotList)
Enables Saturation for slots in list.
|
ActiveSlotPacket |
enableSlot(ADPDSlot slot)
Enable Specified ADPD Slot.
|
ADPDUCHRPacket |
enableUCHR(ADPDSlot slot)
Enable ADPD and ADXL streams for synchronization.
|
ComModePacket |
getCommunicationMode()
Get ADPD communication mode.
|
DecimationFactorPacket |
getDecimationFactor(Stream stream)
Gets decimation factor for specified ADPD stream.
|
ADPDDCFGPacket[] |
getDeviceConfiguration()
Returns device configuration data.
|
java.util.ArrayList<java.lang.Integer> |
getPacketLostCount(Stream stream)
Returns number of packets lost during stream.
|
StreamStatusPacket |
getSensorStatus(Stream stream)
Returns packet with number of subscribers and number of sensor start request registered.
|
SlotPacket |
getSlot(ADPDSlot slot)
Get Specified ADPD Slot Detail.
|
ActiveSlotPacket |
getSlotStatus(ADPDSlot slot)
Returns whether slot is enabled or not.
|
ADPDAppID[] |
getSupportedAppIDs()
List all supported Apps for ADPD.
|
Clock[] |
getSupportedClocks()
List all supported clocks for ADPD.
|
ADPDDevice[] |
getSupportedDevices()
List all supported devices for ADPD.
|
ADPDLed[] |
getSupportedLedIDs()
List all supported led IDs for ADPD.
|
ADPDSlot[] |
getSupportedSlots()
List all supported slots for ADPD.
|
Stream[] |
getSupportedStreams()
List all supported streams for ADPD.
|
VersionPacket |
getVersion()
Returns ADPD version info.
|
ADPDConfigPacket |
loadConfiguration(ADPDDevice deviceID)
Loads specified device id configuration.
|
ADPDPauseResumePacket |
pause()
Pause ADPDDevice.DEVICE_G_R_IR_B.
|
ADPDDCBPacket[] |
readDeviceConfigurationBlock()
Returns entire device configuration block.
|
ADPDLibraryConfigPacket |
readLibraryConfiguration(int[] fields)
Reads library configuration from specified field values.
|
ADPDRegisterReadPacket |
readRegister(int[] addresses)
Reads the register values of specified addresses.
|
ADPDPauseResumePacket |
resume()
Resumes ADPDDevice.DEVICE_G_R_IR_B.
|
void |
setCallback(java.lang.Object userCallback,
Stream stream)
Sets the callback for the stream data.
|
DecimationFactorPacket |
setDecimationFactor(short decimationFactor,
Stream stream)
Sets decimation factor for specified ADPD stream.
|
SamplingFrequencyPacket |
setSamplingFrequency(int odr)
Set ADPD sampling frequency, ODR value in Hz.
|
SlotPacket |
setSlot(ADPDSlot slot,
boolean isSlotEnabled,
int slotFormat,
short channelNumber)
Set Slot with slot format.
|
StreamPacket[] |
startAndSubscribeStream(Stream stream)
Starts ADPD sensor and also subscribe to the specified ADPD stream.
|
StreamPacket |
startSensor()
Starts ADPD sensor.
|
StreamPacket[] |
stopAndUnsubscribeStream(Stream stream)
Stops ADPD sensor and also Unsubscribe the specified ADPD stream.
|
StreamPacket |
stopSensor()
Stops ADPD sensor.
|
StreamPacket |
subscribeStream(Stream stream)
Subscribe to the specified ADPD stream.
|
void |
subscribeStreamData(Stream stream)
Add custom callback for raw stream packets.
|
StreamPacket |
unsubscribeStream(Stream stream)
Unsubscribe the specified ADPD stream.
|
void |
unsubscribeStreamData(Stream stream)
Remove custom callback for raw stream packets.
|
void |
updateSubscribeTimestamp(java.util.Calendar cal,
Stream stream,
boolean generateTS)
Update timestamp for subscribing, only to be used when changing the base
reference time for the stream.
|
ADPDDCBCommandPacket[] |
writeDeviceConfigurationBlock(int[][] addressesValues)
Writes the device configuration block values of specified addresses.
|
ADPDDCBCommandPacket[] |
writeDeviceConfigurationBlockFromFile(java.io.File file)
Writes the device configuration block values of specified addresses from file.
|
ADPDLibraryConfigPacket |
writeLibraryConfiguration(int[][] fieldsValues)
Writes library configuration from List of fields and values.
|
ADPDRegisterWritePacket |
writeRegister(int[][] addressesValues)
Writes the register values of specified addresses.
|
setTimeout
public Stream STREAM_ADPD1
public Stream STREAM_ADPD2
public Stream STREAM_ADPD3
public Stream STREAM_ADPD4
public Stream STREAM_ADPD5
public Stream STREAM_ADPD6
public Stream STREAM_ADPD7
public Stream STREAM_ADPD8
public Stream STREAM_ADPD9
public Stream STREAM_ADPD10
public Stream STREAM_ADPD11
public Stream STREAM_ADPD12
public Stream STREAM_STATIC_AGC
public ADPDDevice DEVICE_RED
public ADPDDevice DEVICE_BLUE
public ADPDDevice DEVICE_GREEN
public ADPDDevice DEVICE_INFRARED
public ADPDDevice DEVICE_G_R_IR_B
public ADPDSlot SLOT_A
public ADPDSlot SLOT_B
public ADPDSlot SLOT_C
public ADPDSlot SLOT_D
public ADPDSlot SLOT_E
public ADPDSlot SLOT_F
public ADPDSlot SLOT_G
public ADPDSlot SLOT_H
public ADPDSlot SLOT_I
public ADPDSlot SLOT_J
public ADPDSlot SLOT_K
public ADPDSlot SLOT_L
public Clock NO_CLOCK
public Clock CLOCK_1M
public Clock CLOCK_32K
public Clock CLOCK_32M
public Clock CLOCK_32K_AND_1M
public Clock CLOCK_1M_AND_32M
public ADPDLed LED_IR
public ADPDLed LED_MWL
public ADPDLed LED_RED
public ADPDLed LED_BLUE
public ADPDLed LED_GREEN
public ADPDAppID APP_ECG
public ADPDAppID APP_PPG
public ADPDAppID APP_ADPD_RED
public ADPDAppID APP_ADPD_BLUE
public ADPDAppID APP_ADPD_GREEN
public ADPDAppID APP_ADPD_INFRARED
public ADPDAppID APP_TEMPERATURE_RESISTOR
public ADPDAppID APP_TEMPERATURE_THERMISTOR
public ADPDApplication(PacketManager packetManager)
public java.util.ArrayList<java.lang.Integer> getPacketLostCount(Stream stream)
stream
- stream.public Stream[] getSupportedStreams()
public void setCallback(java.lang.Object userCallback, Stream stream)
userCallback
- Callback function for specified adpd stream.stream
- Callback for specified stream.public ADPDAppID[] getSupportedAppIDs()
public Clock[] getSupportedClocks()
public ADPDDevice[] getSupportedDevices()
public ADPDLed[] getSupportedLedIDs()
public ADPDSlot[] getSupportedSlots()
public ClockCalibrationPacket calibrateClock(Clock clock)
clock
- Clock ID to calibrate, use getSupportedClocks() to list all supported clock ID.public ADPDCreateDeviceConfiguration createDeviceConfiguration(SlotApp[][] slotsAndAppIDs)
slotsAndAppIDs
- List of slot ID and APP ID to write, use getSupportedSlots() to list all
supported slot ID, and getSupportedAppID() to list all supported app ID.public ADPDDCBCommandPacket deleteDeviceConfigurationBlock()
public AgcControlPacket disableAgc(ADPDLed[] ledIDs)
ledIDs
- array of led to disable agc, use getSupportedLedIDs() to list all supported led ID.public ActiveSlotPacket disableSlot(ADPDSlot slot)
slot
- slot to disable, use getSupportedSlots() to list all supported slot ID.public AgcControlPacket enableAgc(ADPDLed[] ledIDs)
ledIDs
- array of led to enable agc, use getSupportedLedIDs() to list all supported led ID.public ActiveSlotPacket enableSlot(ADPDSlot slot)
slot
- slot to enable, use getSupportedSlots() to list all supported slot ID.public ComModePacket getCommunicationMode()
public DecimationFactorPacket getDecimationFactor(Stream stream)
stream
- Stream to get decimation factor.public ADPDDCFGPacket[] getDeviceConfiguration()
public StreamStatusPacket getSensorStatus(Stream stream)
stream
- adpd stream.public SlotPacket getSlot(ADPDSlot slot)
slot
- slot to get slot detail, use getSupportedSlots() to list all supported slot ID.public ActiveSlotPacket getSlotStatus(ADPDSlot slot)
slot
- slot to get status, use getSupportedSlots() to list all supported slot ID.public VersionPacket getVersion()
public ADPDConfigPacket loadConfiguration(ADPDDevice deviceID)
deviceID
- Device ID to load, use getSupportedDevices() to list all supported devices.public ADPDPauseResumePacket pause()
public ADPDDCBPacket[] readDeviceConfigurationBlock()
public ADPDLibraryConfigPacket readLibraryConfiguration(int[] fields)
fields
- array of field values to read.+----------------------+----------------------+ | Fields Lower Limit | Fields Upper Limit | +----------------------+----------------------+ | 0x00 | 0x00 | +----------------------+----------------------+
public ADPDRegisterReadPacket readRegister(int[] addresses)
addresses
- array of register addresses to read.+----------------------+----------------------+ | Address Lower Limit | Address Upper Limit | +----------------------+----------------------+ | 0x00 | 0x277 | +----------------------+----------------------+
public ADPDPauseResumePacket resume()
public DecimationFactorPacket setDecimationFactor(short decimationFactor, Stream stream)
decimationFactor
- decimation factor for stream.stream
- Stream to set decimation factor.+-------------------------+-------------------------+ | Decimation Lower Limit | Decimation Upper Limit | +-------------------------+-------------------------+ | 0x01 | 0x05 | +-------------------------+-------------------------+
public SamplingFrequencyPacket setSamplingFrequency(int odr)
odr
- ODR frequency in Hz.public SlotPacket setSlot(ADPDSlot slot, boolean isSlotEnabled, int slotFormat, short channelNumber)
slot
- slot to set, use getSupportedSlots() to list all supported slot ID.isSlotEnabled
- enable or disable slot.slotFormat
- format of the slot, possible values are 0,1,2,3,4.channelNumber
- channel for the slot, possible values are 1,3.public ADPDDCBCommandPacket[] writeDeviceConfigurationBlock(int[][] addressesValues)
addressesValues
- array of addresses and values to write.+----------------------+----------------------+ | Address Lower Limit | Address Upper Limit | +----------------------+----------------------+ | 0x0000 | 0x0277 | +----------------------+----------------------+
public ADPDDCBCommandPacket[] writeDeviceConfigurationBlockFromFile(java.io.File file) throws java.io.IOException
file
- dcb file.+----------------------+----------------------+ | Address Lower Limit | Address Upper Limit | +----------------------+----------------------+ | 0x0000 | 0x0277 | +----------------------+----------------------+
java.io.IOException
public StreamPacket startSensor()
public StreamPacket stopSensor()
public StreamPacket subscribeStream(Stream stream)
stream
- Stream to subscribe.public void updateSubscribeTimestamp(java.util.Calendar cal, Stream stream, boolean generateTS)
public StreamPacket unsubscribeStream(Stream stream)
stream
- Stream to unsubscribe.public void subscribeStreamData(Stream stream)
public void unsubscribeStreamData(Stream stream)
public StreamPacket[] startAndSubscribeStream(Stream stream)
stream
- Stream to subscribe.public StreamPacket[] stopAndUnsubscribeStream(Stream stream)
stream
- Stream to unsubscribe.public ADPDLibraryConfigPacket writeLibraryConfiguration(int[][] fieldsValues)
fieldsValues
- array of fields and values to write.+----------------------+----------------------+ | Fields Lower Limit | Fields Upper Limit | +----------------------+----------------------+ | 0x00 | 0x00 | +----------------------+----------------------+
public ADPDRegisterWritePacket writeRegister(int[][] addressesValues)
addressesValues
- array of register addresses and values to write.+----------------------+----------------------+ | Address Lower Limit | Address Upper Limit | +----------------------+----------------------+ | 0x00 | 0x277 | +----------------------+----------------------+
public void enableCSVLogging(java.io.File file, Stream stream)
file
- csv file.stream
- stream enum.public void disableCSVLogging(Stream stream)
stream
- stream enum.public ADPDUCHRPacket enableUCHR(ADPDSlot slot)
slot
- slot.public ADPDUCHRPacket disableUCHR(ADPDSlot slot)
slot
- slot.public SaturationCheckPacket enableSaturationCheck(ADPDSlot[] slotList)
slotList
- list of slots to enable saturation check
use getSupportedSlots() to list all supported slots.public SaturationCheckPacket disableSaturationCheck(ADPDSlot[] slotList)
slotList
- list of slots to enable saturation check
use getSupportedSlots() to list all supported slots.