public class JavelinSensorManager extends ISensorManager implements com.javelindevices.javelinsdk.model.BleServiceListener
ISensorManager.JavelinEventListener| Constructor and Description |
|---|
JavelinSensorManager(Context context,
java.lang.String deviceAddress)
Create a JavelinSensorManager object
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
createBond()
Bonds the application to the javelin device.
|
void |
disable()
Disconnects the javelin device.
|
void |
enable()
Connects to the javelin device.
|
static JavelinSensorManager |
getJavelinSensorManager(Context context,
java.lang.String deviceAddress) |
void |
ledEnable(boolean enable)
LED on/off switch.
|
void |
onConnected()
This method is called on separate from Main thread.
|
void |
onDataAvailable(java.lang.String serviceUuid,
java.lang.String characteristicUUid,
java.lang.String text,
byte[] data)
This method is called on separate from Main thread.
|
void |
onDisconnected()
This method is called on separate from Main thread.
|
void |
onReadRemoteRssi(int rssi) |
void |
onSensorChanged(int sensor,
float[] data) |
void |
onServiceDiscovered()
This method is called on separate from Main thread.
|
void |
readRssi()
Reads the signal strength from the javelin device to the central device.
|
void |
registerListener(ISensorManager.JavelinEventListener listener,
int sensorType)
Enable notifications from a sensor.
|
boolean |
removeBond()
Removes the bond from the application to the javelin device.
|
void |
setAccelerometerFullScaleRange(int range) |
void |
setAcceleromGyroRate(int rate)
It's not going to be exact, but it will attempt to approximate given sample rate
|
void |
setAcceleromGyroSampleRateDivisor(int divisor)
Set the divisor used to divide the default sample rate up.
|
void |
setAudioQuality(int quality) |
void |
setGyroscopeFullScaleRange(int range) |
void |
setLedBlinkNumber(int times)
Sets how many times the LED goes on and off for the specified number of times at the current
rate, pulsation type, and intensity.
|
void |
setLedBlinkRate(int rate)
Sets the LED's blinking rate for the PULSE, TRIANGLE, and SAWTOOTH LED types.
|
void |
setLedBlinkType(int blinkType)
Sets the kind of blinking type to enable when
ledEnable(true) is called |
void |
setLedIntensity(int intensity)
Sets the LED intensity on a scale of 1 - 100, 100 being the strongest intensity.
|
void |
setListener(ISensorManager.JavelinEventListener listener)
Allows the android activity to receive sensor events.
|
void |
setVibrationIntensity(int intensity) |
void |
setVibrationRate(int rate)
Sets the vibration rate for the PULSE, TRIANGLE, and SAWTOOTH vibration types.
|
void |
setVibrationRepeatNumber(int times)
Sets the number of times to vibrate if the SOLID, PULSE, TRIANGLE or SAWTOOTH vibration type is set.
|
void |
setVibrationType(int type)
Sets the vibration type to use
|
void |
unregisterAll()
Removes all listeners, stopping sensor updates.
|
void |
unregisterListener(ISensorManager.JavelinEventListener listener,
int sensorType)
Disables notifications and data from a sensor for the given listener, if it is already subscribed.
|
void |
vibrationEnable(boolean enable)
Vibrator on / off switch.
|
public JavelinSensorManager(Context context,
java.lang.String deviceAddress)
context - an android ActivitydeviceAddress - the address of the javelin device to connect to.public static JavelinSensorManager getJavelinSensorManager(Context context, java.lang.String deviceAddress)
public void setListener(ISensorManager.JavelinEventListener listener)
ISensorManagersetListener in class ISensorManagerlistener - the ISensorManager.JavelinEventListenerpublic void enable()
ISensorManagerenable in class ISensorManagerpublic void disable()
ISensorManagerdisable in class ISensorManagerpublic void registerListener(ISensorManager.JavelinEventListener listener, int sensorType)
ISensorManagerJavelinSensorManager will remember all registered listenersregisterListener in class ISensorManagersensorType - The sensor to enable.public void unregisterListener(ISensorManager.JavelinEventListener listener, int sensorType)
ISensorManagerunregisterListener in class ISensorManagersensorType - a type defined in ISensorpublic void unregisterAll()
ISensorManagerunregisterAll in class ISensorManagerpublic void onSensorChanged(int sensor,
float[] data)
public void onConnected()
com.javelindevices.javelinsdk.model.BleServiceListeneronConnected in interface com.javelindevices.javelinsdk.model.BleServiceListenerpublic void onDisconnected()
com.javelindevices.javelinsdk.model.BleServiceListeneronDisconnected in interface com.javelindevices.javelinsdk.model.BleServiceListenerpublic void readRssi()
ISensorManagerISensorManager.JavelinEventListener.readRssi in class ISensorManagerpublic void onReadRemoteRssi(int rssi)
onReadRemoteRssi in interface com.javelindevices.javelinsdk.model.BleServiceListenerpublic void onServiceDiscovered()
com.javelindevices.javelinsdk.model.BleServiceListeneronServiceDiscovered in interface com.javelindevices.javelinsdk.model.BleServiceListenerpublic void onDataAvailable(java.lang.String serviceUuid,
java.lang.String characteristicUUid,
java.lang.String text,
byte[] data)
com.javelindevices.javelinsdk.model.BleServiceListeneronDataAvailable in interface com.javelindevices.javelinsdk.model.BleServiceListenerpublic boolean createBond()
ISensorManagercreateBond in class ISensorManagerpublic boolean removeBond()
ISensorManagerremoveBond in class ISensorManagerpublic void ledEnable(boolean enable)
ISensorManager
Must set setLedBlinkType(int blinkType) before calling ledEnable(boolean)
ledEnable in class ISensorManagerenable - booleanpublic void setLedIntensity(int intensity)
ISensorManagersetLedIntensity in class ISensorManagerintensity - the intensity of the LED from 1 to 100 inclusive.public void setLedBlinkType(int blinkType)
ISensorManagerledEnable(true) is calledsetLedBlinkType in class ISensorManagerblinkType - Integer constant describing the kind of blinking type to enable.
This can be any of the LED_TYPE contants from JavelinSettingspublic void setLedBlinkRate(int rate)
ISensorManagersetLedBlinkRate in class ISensorManagerrate - the blinking rate, in .1Hz values. A value of 10 will make the LED blink once per second.public void setLedBlinkNumber(int times)
ISensorManagersetLedBlinkNumber in class ISensorManagertimes - how many times to blink the LED when calling the ledEnable
method. Allowed values are [1,255].public void vibrationEnable(boolean enable)
ISensorManager
Must set setVibrationType(int type) before calling vibrationEnable(boolean)
vibrationEnable in class ISensorManagerenable - booleanpublic void setVibrationIntensity(int intensity)
setVibrationIntensity in class ISensorManagerintensity - the intensity of vibration from 1 to 100 inclusive.public void setVibrationType(int type)
ISensorManagersetVibrationType in class ISensorManagertype - one of the VIB_TYPE constants in ISensorpublic void setVibrationRate(int rate)
ISensorManagersetVibrationRate in class ISensorManagerrate - an integer indicating the number of vibrations per 1/10th of a second (.1Hz).
A value of 10 will make it vibrate once per second.public void setVibrationRepeatNumber(int times)
ISensorManagersetVibrationRepeatNumber in class ISensorManagertimes - the number of times to vibratepublic void setAudioQuality(int quality)
setAudioQuality in class ISensorManagerpublic void setAcceleromGyroRate(int rate)
setAcceleromGyroRate in class ISensorManagerrate - the sampling rate to use.public void setAcceleromGyroSampleRateDivisor(int divisor)
ISensorManagersetAcceleromGyroSampleRateDivisor in class ISensorManagerpublic void setAccelerometerFullScaleRange(int range)
setAccelerometerFullScaleRange in class ISensorManagerpublic void setGyroscopeFullScaleRange(int range)
setGyroscopeFullScaleRange in class ISensorManager