public class PPGApplication extends CommonApplication
Modifier and Type | Field and Description |
---|---|
PPGLcfgID |
LCFG_ID_ADPD107 |
PPGLcfgID |
LCFG_ID_ADPD108 |
PPGLcfgID |
LCFG_ID_ADPD185 |
PPGLcfgID |
LCFG_ID_ADPD188 |
PPGLcfgID |
LCFG_ID_ADPD4000 |
Stream |
STREAM_DYNAMIC_AGC |
Stream |
STREAM_HRV |
Stream |
STREAM_PPG |
Stream |
STREAM_SYNC_PPG |
Constructor and Description |
---|
PPGApplication(PacketManager packetManager) |
Modifier and Type | Method and Description |
---|---|
PPGDCBCommandPacket |
deleteDeviceConfigurationBlock()
Deletes Device configuration block.
|
void |
disableCSVLogging(Stream stream)
Stop logging stream data into CSV.
|
void |
enableCSVLogging(java.io.File file,
Stream stream)
Start logging stream data into CSV.
|
VersionPacket |
getAlgoVersion()
Returns Algorithm version info.
|
LibraryConfigDataPacket |
getLibraryConfiguration()
Returns entire library configuration PPG.
|
int |
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.
|
PPGLcfgID[] |
getSupportedLcfgIDs()
List all supported PPG LCFG IDs.
|
Stream[] |
getSupportedStreams()
List all supported streams for PPG.
|
VersionPacket |
getVersion()
Returns version info.
|
PPGDCBPacket |
readDeviceConfigurationBlock()
Returns entire device configuration block.
|
PPGLibraryConfigPacket |
readLibraryConfiguration(long[] fields)
Reads library configuration from specified field values.
|
void |
setCallback(java.lang.Object userCallback,
Stream stream)
Sets the callback for the stream data.
|
CommandPacket |
setLibraryConfiguration(PPGLcfgID lcfgID)
Set PPG to specified library configuration.
|
StreamPacket[] |
startAndSubscribeStream(Stream stream)
Starts PPG sensor and also subscribe to the PPG stream.
|
StreamPacket |
startSensor()
Start PPG sensor.
|
StreamPacket[] |
stopAndUnsubscribeStream(Stream stream)
Stops PPG sensor and also Unsubscribe the PPG stream.
|
StreamPacket |
stopSensor()
Stops PPG sensor.
|
StreamPacket |
subscribeStream(Stream stream)
Subscribe to the specified PPG stream.
|
void |
subscribeStreamData(Stream stream)
Add custom callback for raw stream packets.
|
StreamPacket |
unsubscribeStream(Stream stream)
Unsubscribe the specified PPG 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.
|
PPGDCBCommandPacket |
writeDeviceConfigurationBlock(long[][] addressesValues)
Writes the device configuration block values of specified addresses.
|
PPGDCBCommandPacket |
writeDeviceConfigurationBlockFromFile(java.io.File file)
Writes the device configuration block values of specified addresses from file.
|
PPGLibraryConfigPacket |
writeLibraryConfiguration(long[][] fieldsValues)
Writes library configuration from List of fields and values.
|
setTimeout
public PPGLcfgID LCFG_ID_ADPD107
public PPGLcfgID LCFG_ID_ADPD185
public PPGLcfgID LCFG_ID_ADPD108
public PPGLcfgID LCFG_ID_ADPD188
public PPGLcfgID LCFG_ID_ADPD4000
public Stream STREAM_PPG
public Stream STREAM_HRV
public Stream STREAM_SYNC_PPG
public Stream STREAM_DYNAMIC_AGC
public PPGApplication(PacketManager packetManager)
public int getPacketLostCount(Stream stream)
stream
- stream.public PPGDCBCommandPacket deleteDeviceConfigurationBlock()
public LibraryConfigDataPacket getLibraryConfiguration()
public PPGLcfgID[] getSupportedLcfgIDs()
public PPGDCBPacket readDeviceConfigurationBlock()
public PPGLibraryConfigPacket readLibraryConfiguration(long[] fields)
fields
- array of field values to read.+----------------------+----------------------+ | Fields Lower Limit | Fields Upper Limit | +----------------------+----------------------+ | 0x00 | 0x34 | +----------------------+----------------------+
public CommandPacket setLibraryConfiguration(PPGLcfgID lcfgID)
lcfgID
- PPG lcfg_id to set, use getSupportedLcfgIDs() to list all supported lcfg IDspublic void setCallback(java.lang.Object userCallback, Stream stream)
userCallback
- Callback function for specified adpd stream.stream
- Callback for specified stream.public StreamPacket subscribeStream(Stream stream)
stream
- Stream to subscribe.public StreamPacket unsubscribeStream(Stream stream)
stream
- Stream to unsubscribe.public void updateSubscribeTimestamp(java.util.Calendar cal, Stream stream, boolean generateTS)
public void subscribeStreamData(Stream stream)
public void unsubscribeStreamData(Stream stream)
public PPGDCBCommandPacket writeDeviceConfigurationBlock(long[][] addressesValues)
addressesValues
- array of addresses and values to write.+----------------------+----------------------+ | Address Lower Limit | Address Upper Limit | +----------------------+----------------------+ | 0x00 | 0x34 | +----------------------+----------------------+
public PPGDCBCommandPacket writeDeviceConfigurationBlockFromFile(java.io.File file) throws java.io.IOException
file
- dcb file.+----------------------+----------------------+ | Address Lower Limit | Address Upper Limit | +----------------------+----------------------+ | 0x00 | 0x34 | +----------------------+----------------------+
java.io.IOException
public PPGLibraryConfigPacket writeLibraryConfiguration(long[][] fieldsValues)
fieldsValues
- array of fields and values to write.+----------------------+----------------------+ | Fields Lower Limit | Fields Upper Limit | +----------------------+----------------------+ | 0x00 | 0x34 | +----------------------+----------------------+
public Stream[] getSupportedStreams()
public StreamStatusPacket getSensorStatus(Stream stream)
public StreamPacket[] startAndSubscribeStream(Stream stream)
public StreamPacket startSensor()
public StreamPacket[] stopAndUnsubscribeStream(Stream stream)
public StreamPacket stopSensor()
public VersionPacket getVersion()
public VersionPacket getAlgoVersion()
public void enableCSVLogging(java.io.File file, Stream stream)
file
- csv file.stream
- stream enum.public void disableCSVLogging(Stream stream)
stream
- stream enum.