Fall Detection Help
I am facing difficulty to find fall detection and long press method on V.ALRT Button.I got only key press and key release event and getting some code like (0xFFFFFFF4-00F7-4000-B000-000000000000).I have used a sample android code which is available of developer sign up process.
Please help me to get fall detection event code and long press method.
And also suggest how would i go about making a safety app. (eg. send a notification to my three personal contacts)
-
Offizieller Kommentar
V.BTTN has various detection modes (I.e. Long/short button press, fall detect, etc.). Default detection mode is long button press-release.
Detection mode is configured via the Detection Mode Configuration Characteristic (0xFFFFFFF2-00F7-4000-B000-000000000000)
You need to write {0x06} to this characteristic. (0x02 & 0x04) for long button & fall detection.
public static final UUID VSN_GATT_SERVICE = UUID.fromString("fffffff0-00f7-4000-b000-000000000000");// 0xFFF0
public static final UUID CHAR_DETECTION_CONFIG = UUID.fromString("fffffff2-00f7-4000-b000-000000000000");//0xFFF2
public static final byte[] ENABLE_KEY_DETECTION_VALUE = new byte[] { (byte) 0x05 };
// Get VSN GATT Service
BluetoothGattService gattService = gatt.getService(VSN_GATT_SERVICE);
// Get detection configuration characteristic
BluetoothGattCharacteristic detectionConfigChar = gattService.getCharacteristic(CHAR_DETECTION_CONFIG);
// Enable fall detection
detectionConfigChar.setValue(ENABLE_KEY_DETECTION_VALUE);
gatt.writeCharacteristic(detectionConfigChar);
You then need to enable notifications by writing {0x01, 0x00} (2-bytes) to client characteristic configuration 0x2902.. of characteristic 0xFFFFFFF4-00F7-4000-B000-000000000000
public static final UUID CHAR_DETECTION_NOTIFY = UUID.fromString("fffffff4-00f7-4000-b000-000000000000");// 0xFFF4
public static UUID CLIENT_CHARACTERISTIC_CONFIG = UUID.fromString("00002902-0000-1000-8000-00805f9b34fb”);
public static final byte[] ENABLE_NOTIFICATION_VALUE = { (byte) 0x01,0x00};
// Get detection notification characteristic
BluetoothGattCharacteristic detectionNotifyChar = gattService.getCharacteristic(CHAR_DETECTION_NOTIFY);
final BluetoothGattDescriptor clientConfig = detectionNotifyChar.getDescriptor(Constants.CLIENT_CHARACTERISTIC_CONFIG);
clientConfig.setValue(ENABLE_NOTIFICATION_VALUE);
gatt.writeDescriptor(clientConfig);
Once all of above are setup, when user long press-release the button, your app will get a callback with value 03. Also, when V.BTTN detects a fall, it will report (04).
Please refer to section 7 of the Developer’s Guide for additional detail.
Aktionen für Kommentare
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
1 Kommentar