public class TemperatureApplication extends CommonApplication
Constructor and Description |
---|
TemperatureApplication(PacketManager packetManager) |
Modifier and Type | Method and Description |
---|---|
TemperatureDCBCommandPacket |
deleteDeviceConfigurationBlock()
Deletes ECG 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.
|
TemperatureDCFGPacket[] |
getDeviceConfiguration()
Returns device configuration data.
|
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.
|
Stream[] |
getSupportedStreams()
List all supported streams for Temperature.
|
TemperatureDCBPacket[] |
readDeviceConfigurationBlock()
Returns entire device configuration block.
|
TemperatureLibraryConfigPacket |
readLibraryConfiguration(short field)
Reads library configuration from specified field values.
|
void |
setCallback(TemperatureCallback userCallback,
Stream stream)
Sets the callback for the stream data.
|
void |
setCorrectionFactor(float correctionFactor)
Set correction factor for temperature stream, to be used when reference temperature
is slightly different from watch temperature.
|
void |
setSlope(float slope)
Set slope for temperature stream, to be used when reference temperature
is slightly different from watch temperature.
|
StreamPacket[] |
startAndSubscribeStream(Stream stream)
Starts Temperature sensor and also subscribe to the specified ADPD stream.
|
StreamPacket |
startSensor()
Starts Temperature sensor.
|
StreamPacket[] |
stopAndUnsubscribeStream(Stream stream)
Stops Temperature sensor and also Unsubscribe the specified ADPD stream.
|
StreamPacket |
stopSensor()
Stops Temperature sensor.
|
StreamPacket |
subscribeStream(Stream stream)
Subscribe to the specified Temperature stream.
|
void |
subscribeStreamData(Stream stream)
Add custom callback for raw stream packets.
|
StreamPacket |
unsubscribeStream(Stream stream)
Unsubscribe the specified Temperature 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.
|
CommandPacket |
writeDCBToLCFG()
Writes Device configuration block data to library configuration.
|
TemperatureDCBCommandPacket[] |
writeDeviceConfigurationBlock(long[][] addressesValues)
Writes the device configuration block values of specified addresses.
|
TemperatureDCBCommandPacket[] |
writeDeviceConfigurationBlockFromFile(java.io.File file)
Writes the device configuration block values of specified addresses from file.
|
TemperatureLibraryConfigPacket |
writeLibraryConfiguration(short field,
java.io.File file)
Writes library configuration from List of fields and values.
|
TemperatureLibraryConfigPacket |
writeLibraryConfiguration(short field,
long value)
Writes library configuration from List of fields and values.
|
setTimeout
public Stream STREAM_TEMPERATURE1
public Stream STREAM_TEMPERATURE2
public Stream STREAM_TEMPERATURE3
public Stream STREAM_TEMPERATURE4
public Stream STREAM_TEMPERATURE5
public Stream STREAM_TEMPERATURE6
public Stream STREAM_TEMPERATURE7
public Stream STREAM_TEMPERATURE8
public Stream STREAM_TEMPERATURE9
public Stream STREAM_TEMPERATURE10
public Stream STREAM_TEMPERATURE11
public Stream STREAM_TEMPERATURE12
public TemperatureApplication(PacketManager packetManager)
public int getPacketLostCount(Stream stream)
stream
- stream.public void setCallback(TemperatureCallback userCallback, Stream stream)
userCallback
- Callback function for specified adpd stream.stream
- Callback for specified stream.public TemperatureDCFGPacket[] getDeviceConfiguration()
public Stream[] getSupportedStreams()
public StreamStatusPacket getSensorStatus(Stream stream)
stream
- Temperature stream.public CommandPacket writeDCBToLCFG()
public TemperatureDCBCommandPacket deleteDeviceConfigurationBlock()
public TemperatureDCBPacket[] readDeviceConfigurationBlock()
public TemperatureLibraryConfigPacket readLibraryConfiguration(short field)
field
- field for the LCFG.public TemperatureLibraryConfigPacket writeLibraryConfiguration(short field, long value)
field
- field for the LCFG.value
- values for the field.public TemperatureLibraryConfigPacket writeLibraryConfiguration(short field, java.io.File file) throws java.io.IOException
field
- field for the LCFG.file
- LCFG data file for the given field.java.io.IOException
public TemperatureDCBCommandPacket[] writeDeviceConfigurationBlock(long[][] addressesValues)
addressesValues
- array of addresses and values to write.public TemperatureDCBCommandPacket[] writeDeviceConfigurationBlockFromFile(java.io.File file) throws java.lang.Exception
file
- dcb file.java.lang.Exception
public void setCorrectionFactor(float correctionFactor)
float updatedTemperature = ((skinTemperature * slope) + correctionFactor);
public void setSlope(float slope)
float updatedTemperature = ((skinTemperature * slope) + correctionFactor);
public void enableCSVLogging(java.io.File file, Stream stream)
file
- csv file.stream
- stream enum.public void disableCSVLogging(Stream stream)
stream
- stream enum.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.