|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.myzeo.decoder.ZeoData
public class ZeoData
Core functionality for decoding a Zeo data record. This class decodes the saved data records from firmware 2.6.3O only. It cannot decode earlier versions.
Field Summary | |
---|---|
static int |
DAYS_PER_MONTH
Generic Zeo defines that correspond to Zeo's time definition, hypnogram lengths and the like. |
static int |
DAYS_PER_MONTH_MAX
|
static int |
DAYS_PER_WEEK
|
static int |
EPOCHS_PER_HOUR
|
static int |
EPOCHS_PER_MINUTE
|
static int |
HEADER_SIZE
|
static int |
HOURS_PER_DAY
|
static int |
HYP_BASE_LENGTH
|
static int |
HYP_BASE_PER_DISPLAY
|
static int |
HYP_BASE_STEP
|
static int |
HYP_DISPLAY_LENGTH
|
static int |
HYP_DISPLAY_STEP
|
static int |
HYP_SECONDS_MAX
|
static byte[] |
IDENTIFIER
All sleep data records must start with the following identifier string. |
static int |
IDENTIFIER_SIZE
A two byte format version value follows the identifier. |
boolean |
is_nap
variables |
static int |
MAX_RECORD_BYTES
Maximum number of bytes there can be in a record. |
static int |
MINUTES_PER_HOUR
|
static int |
MONTHS_PER_YEAR
|
static int |
MSEC_PER_SECOND
|
static int |
SECONDS_PER_DAY
|
static int |
SECONDS_PER_EPOCH
|
static int |
SECONDS_PER_HOUR
|
static int |
SECONDS_PER_MINUTE
|
static int |
SECONDS_PER_MONTH
|
static int |
SECONDS_PER_WEEK
|
static byte[] |
V22
The version value is enumerated here. |
static int |
V22_SIZE
The record version size. |
static int |
VERSION_SIZE
|
Constructor Summary | |
---|---|
ZeoData(java.nio.ByteBuffer in,
int version)
Construct a Zeo data record given the input stream and data format version identification. |
Method Summary | |
---|---|
int |
compareLength(ZeoData other)
Compares two records and indicates whether or not the given record is "larger" or "smaller" than some other record. |
int |
compareTo(ZeoData other)
Implementation of comparable for sorting records based on sleep start times. |
java.util.Calendar |
compute_alarm_set_time()
Compute the set alarm time that was in use for the night of sleep represented by this record. |
java.util.Calendar |
compute_rise_time()
Return the rise time as a Calendar object. |
boolean |
get_airplane_mode()
Returns airplane mode flag. |
java.util.Calendar |
get_airplane_off()
Returns the last time airplane mode was disengaged, or null if it has not been disengaged. |
java.util.Calendar |
get_airplane_on()
Returns the last time airplane mode was engaged, or null if it has not been engaged. |
TimeChange[] |
get_alarm_change()
Returns the list of alarm changes, as an array of TimeChange objects. |
java.util.Calendar |
get_alarm_off()
Returns the time the alarm was turned off, or null if it was not turned off. |
AlarmReason |
get_alarm_reason()
Returns reason alarm was triggered. |
java.util.Calendar[] |
get_alarm_ring()
Returns a list of the first and last (if more than one) times the alarm rang. |
java.util.Calendar |
get_alarm_set_time()
Returns the time the alarm was set for. |
java.util.Calendar[] |
get_alarm_snooze()
Returns a list of the times the snooze button was pressed |
char[] |
get_assert_function_name()
Returns the name of the function where assert occurred, if an assert occurred and triggered a watchdog reset. |
int |
get_assert_line_number()
Returns the line number on which an assert occurred, if an assert occurred and triggered a watchdog reset. |
int |
get_awakenings_average()
Returns the average number of awakenings from sleep history. |
int |
get_awakenings()
Returns the number of awakenings for the current record. |
byte |
get_backlight()
Returns the backlight brightness setting. |
int |
get_base_hypnogram_count()
Returns the base_hypnogram_count value for the record. |
byte[] |
get_base_hypnogram()
Returns the base hypnogram as an array of integers. |
ClockMode |
get_clock_mode()
Returns the 12/24 hour clock selection. |
long |
get_crc()
Returns the CRC16 value that was in the record. |
java.util.Calendar |
get_current_time()
Returns the time that the record was output. |
int |
get_display_hypnogram_count()
Returns the display_hypnogram_count value for the record. |
int |
get_display_hypnogram_forced_index()
Returns the index of the display hypnogram bin that was forced to a specific stage, or 0 if there is no such bin. |
int |
get_display_hypnogram_forced_stage()
Returns the index of the display hypnogram bin that was forced to a specific stage. |
byte[] |
get_display_hypnogram()
Returns the display hypnogram as an array of integers. |
java.util.Calendar |
get_end_of_night()
Returns the Zeo record's end of night which can be used for comparison purposes. |
java.util.Calendar |
get_factory_reset()
Returns the last time a factory reset was performed, or null if it has not been performed. |
int |
get_format_version()
Returns the version of the sleep record data format. |
long |
get_headband_id()
Returns the serial number of the most recently docked headband. |
short[] |
get_headband_impedance()
Returns an array of headband impedance values collected over the past 24 hours. |
short[] |
get_headband_packets()
Returns an array of headband packet loss values collected over the past 24 hours. |
byte[] |
get_headband_rssi()
Returns an array of headband received signal strength values collected over the past 24 hours. |
short[] |
get_headband_status()
Returns an array of headband docking status values collected over the past 24 hours. |
java.util.Calendar |
get_hypnogram_start_time()
Returns the hypnogram start time. |
int |
get_id_hw()
Returns the Zeo hardware version. |
int |
get_id_sw()
Returns the Zeo software version. |
java.util.Calendar |
get_rise_time()
Returns the time the user got up. |
TimeChange[] |
get_rtc_change()
Returns the list of real-time clock changes, as an array of TimeChange objects. |
java.util.Calendar |
get_sensor_life_reset()
Returns the last time the sensor life counter was reset, or null if it has not been reset. |
java.util.Calendar |
get_sleep_date()
Returns the sleep_date for the current record. |
int |
get_sleep_rating()
Returns the sleep rating for the current record. |
java.util.Calendar |
get_sleep_stat_reset()
Returns the last time the sleep history was reset, or null if it has not been reset. |
boolean |
get_sleep_valid()
Returns the sleep valid flag. |
int |
get_snooze_time()
Returns the snooze time setting in minutes. |
java.util.Calendar |
get_start_of_night()
Returns the Zeo record's start of night which can be used for comparison purposes. |
int |
get_time_in_deep_average()
Returns the average time in deep from sleep history. |
int |
get_time_in_deep_best()
Returns the best time in deep from sleep history. |
int |
get_time_in_deep()
Returns the time in deep for the current record. |
int |
get_time_in_light_average()
Returns the average time in light from sleep history. |
int |
get_time_in_light()
Returns the time in light for the current record. |
int |
get_time_in_rem_average()
Returns the average time in rem from sleep history. |
int |
get_time_in_rem_best()
Returns the best time in rem from sleep history. |
int |
get_time_in_rem()
Returns the time in rem for the current record. |
int |
get_time_in_wake_average()
Returns the average time in wake from sleep history. |
int |
get_time_in_wake()
Returns the time in wake for the current record. |
int |
get_time_to_z_average()
Returns the average time to sleep from sleep history. |
int |
get_time_to_z()
Returns the time to sleep for the current record. |
int |
get_total_z_average()
Returns the average total sleep time from sleep history. |
int |
get_total_z_best()
Returns the best total sleep time from sleep history. |
int |
get_total_z()
Returns the total sleep time for the current record. |
WakeTone |
get_wake_tone()
Returns the selected wake tone. |
int |
get_wake_window()
Returns the selected wake window in minutes. |
boolean |
get_wdt_reset()
Returns whether a watchdog reset occurred. |
WriteReason |
get_write_reason()
Returns the reason this record was written to the card. |
boolean |
get_zeo_wake_on()
Returns whether SmartWake was enabled. |
int |
get_zq_score_average()
Returns the average ZQ score from sleep history. |
int |
get_zq_score_best()
Returns the best ZQ score from sleep history. |
int |
get_zq_score()
Returns the ZQ score for the current record. |
boolean |
is_reset_record()
|
boolean |
is_sleep_rating_record()
Tests if this record's write reason is FS_REASON_SLEEP_RATED. |
boolean |
same_night(ZeoData other_record)
Indicates whether or not the other_record is from the same "night" as this record. |
boolean |
same_start_time(ZeoData other_record)
Indicates whether other_record has the same start time as this record. |
void |
set_sleep_date()
Set the sleep_date for the current record. |
java.lang.String |
toHuman()
Generate a human readable representation of the Zeo record. |
java.lang.String |
toXML()
Generate a XML representation of the Zeo record. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte[] IDENTIFIER
public static final int IDENTIFIER_SIZE
public static final int VERSION_SIZE
public static final int HEADER_SIZE
public static final byte[] V22
public static final int V22_SIZE
public static final int MAX_RECORD_BYTES
public static final int DAYS_PER_MONTH
public static final int DAYS_PER_MONTH_MAX
public static final int DAYS_PER_WEEK
public static final int HOURS_PER_DAY
public static final int MINUTES_PER_HOUR
public static final int MONTHS_PER_YEAR
public static final int MSEC_PER_SECOND
public static final int SECONDS_PER_EPOCH
public static final int SECONDS_PER_MINUTE
public static final int SECONDS_PER_HOUR
public static final int SECONDS_PER_DAY
public static final int SECONDS_PER_MONTH
public static final int SECONDS_PER_WEEK
public static final int EPOCHS_PER_MINUTE
public static final int EPOCHS_PER_HOUR
public static final int HYP_BASE_STEP
public static final int HYP_DISPLAY_STEP
public static final int HYP_SECONDS_MAX
public static final int HYP_BASE_LENGTH
public static final int HYP_BASE_PER_DISPLAY
public static final int HYP_DISPLAY_LENGTH
public boolean is_nap
Constructor Detail |
---|
public ZeoData(java.nio.ByteBuffer in, int version)
in
- The data input stream that will be read to construct
the record.version
- The version number of the record to decode.Method Detail |
---|
public int compareTo(ZeoData other)
compareTo
in interface java.lang.Comparable<ZeoData>
other
- The ZeoData record to compare to this record
public int compareLength(ZeoData other)
other
- The ZeoData record to compare to this record.
public java.util.Calendar compute_alarm_set_time()
public java.util.Calendar compute_rise_time()
public boolean get_airplane_mode()
public java.util.Calendar get_airplane_off()
public java.util.Calendar get_airplane_on()
public TimeChange[] get_alarm_change()
public java.util.Calendar get_alarm_off()
public AlarmReason get_alarm_reason()
public java.util.Calendar[] get_alarm_ring()
public java.util.Calendar get_alarm_set_time()
public java.util.Calendar[] get_alarm_snooze()
public char[] get_assert_function_name()
public int get_assert_line_number()
public int get_awakenings()
public int get_awakenings_average()
public byte get_backlight()
public byte[] get_base_hypnogram()
public int get_base_hypnogram_count()
public ClockMode get_clock_mode()
public long get_crc()
public java.util.Calendar get_current_time()
public byte[] get_display_hypnogram()
public int get_display_hypnogram_count()
public int get_display_hypnogram_forced_index()
public int get_display_hypnogram_forced_stage()
public java.util.Calendar get_end_of_night()
public java.util.Calendar get_factory_reset()
public int get_format_version()
public long get_headband_id()
public short[] get_headband_impedance()
public short[] get_headband_packets()
public byte[] get_headband_rssi()
public short[] get_headband_status()
public java.util.Calendar get_hypnogram_start_time()
public int get_id_hw()
public int get_id_sw()
public java.util.Calendar get_rise_time()
public TimeChange[] get_rtc_change()
public java.util.Calendar get_sensor_life_reset()
public java.util.Calendar get_sleep_date()
public int get_sleep_rating()
public java.util.Calendar get_sleep_stat_reset()
public boolean get_sleep_valid()
public int get_snooze_time()
public java.util.Calendar get_start_of_night()
public int get_time_in_deep()
public int get_time_in_deep_average()
public int get_time_in_deep_best()
public int get_time_in_light()
public int get_time_in_light_average()
public int get_time_in_rem()
public int get_time_in_rem_average()
public int get_time_in_rem_best()
public int get_time_in_wake()
public int get_time_in_wake_average()
public int get_time_to_z()
public int get_time_to_z_average()
public int get_total_z()
public int get_total_z_average()
public int get_total_z_best()
public WakeTone get_wake_tone()
public int get_wake_window()
public boolean get_wdt_reset()
public WriteReason get_write_reason()
public boolean get_zeo_wake_on()
public int get_zq_score()
public int get_zq_score_average()
public int get_zq_score_best()
public boolean is_reset_record()
public boolean is_sleep_rating_record()
public boolean same_night(ZeoData other_record)
public boolean same_start_time(ZeoData other_record)
public void set_sleep_date()
public java.lang.String toHuman()
public java.lang.String toXML()
|
Copyright © 2010, Zeo, Inc. All rights reserved. | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |