Cortex Android
|
Public Member Functions | |
FallSensor (String name, SensePlatform sensePlatform) | |
FallSensor (SensePlatform sensePlatform) | |
void | setDemo (boolean demo) |
boolean | isDemo () |
void | setUseInactivity (boolean useInactivity) |
boolean | isUseInactivity () |
void | onNewData (SensorDataPoint dataPoint) |
This class is a DataProducer implementation of the FallDetector module.
FallDetect will determine a fall based on the acceleration sensor.
For this the acceleration sensor needs to sample at least with game mode: 50Hz.
By default the demo mode is disabled.
Demo mode will only look at a free fall for 200ms and triggers a fall.
By default the useInactivity is enabled.
When useInactivity is enabled then a check for in-activity for 2 sec is done after a free fall, an impact and an orientation change and if the checked is passed then a fall is triggered.
This class returns a json object with the structure {"value":{"fall":1}, "date":1366876517.12}
This DataProcessor requires the following sensors/settings:
SensorNames.ACCELEROMETER
Motion sensing enabled
Copyright (c) 2013 Sense Observation Systems BV. All rights reserved.
nl.sense_os.cortex.FallSensor.FallSensor | ( | String | name, |
SensePlatform | sensePlatform | ||
) |
FallDetect Constructor
A FallDetect data producer will be registered at the Sense Service
under the name supplied with this constructor.
To receive data from this DataProducer, subscription should be done at the Sense Service with the given name.
The DataProcessor persists its state based on the supplied name.
By default the demo mode is off and it uses the check for inactivity after an impact.
Re-creating a FallDetect DataProducer with the same name will load its previous settings.
sensePlatform | The SensePlatform |
name | The name of the data processor. Should be unique. |
nl.sense_os.cortex.FallSensor.FallSensor | ( | SensePlatform | sensePlatform | ) |
FallDetect Constructor
sensePlatform | The SensePlatform |
boolean nl.sense_os.cortex.FallSensor.isDemo | ( | ) |
Check for demo settings.
This function checks for the demo property.
boolean nl.sense_os.cortex.FallSensor.isUseInactivity | ( | ) |
Check for the inactivity property
This function checks whether the inactivity property is set.
void nl.sense_os.cortex.FallSensor.onNewData | ( | SensorDataPoint | dataPoint | ) |
Set the interval
This method sets the interval at which to do the computation whether the device is carried. The default is 60 seconds. Setting the interval will reset the time window
interval | in seconds |
void nl.sense_os.cortex.FallSensor.setDemo | ( | boolean | demo | ) |
Set or unset the demo fall detect.
With demo enabled, a fall will be triggered when a free fall is detected for 200 ms.
demo | The boolean to set the demo property |
void nl.sense_os.cortex.FallSensor.setUseInactivity | ( | boolean | useInactivity | ) |
Set or unset the check for inactivity.
This function set/unsets the check for inactivity after a free fall and impact. If enabled a fall will be triggered only when there is no movement for 2 seconds after an impact.
useInactivity | The boolean to set or unset the inactivity check |