Merge pull request #165 from OpenSeizureDetector/148-v42x-pinetime-timedate-not-synchronised-to-phone

Added Current Time Service to BLE Data Source
This commit is contained in:
Graham Jones
2024-04-02 19:49:28 +01:00
committed by GitHub
5 changed files with 11 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
OpenSeizureDetector Android App - Change Log
============================================
V4.2.5 - Set BLE device time if the characteristic is available.
V4.2.4 - Added checks and a FAULT condition for Bluetooth errors in Bluetooth Data Source
V4.2.3 - Uses 3d accelerometer data to calculate magnitude if vector magnitude is not sent from data source.
- fixed latched alarms (Issue #146)

View File

@@ -80,6 +80,7 @@ The following libraries are used:
* (jBeep)[http://www.ultraduz.com.br]
* (Chartjs)[http://www.chartjs.org]
* (MPAndroidChart)[https://github.com/PhilJay/MPAndroidChart]
* (CurrentTimeService)[https://github.com/RideBeeline/android-bluetooth-current-time-service]
Logo based on ["Star of life2" by Verdy p - Own work. Licensed under Public Domain via Wikimedia Commons](http://commons.wikimedia.org/wiki/File:Star_of_life2.svg#mediaviewer/File:Star_of_life2.svg).

View File

@@ -80,6 +80,8 @@ dependencies {
//androidTestImplementation 'androidx.test.espresso:espresso-intents:3.1.1'
implementation 'com.techyourchance:threadposter:1.0.1'
implementation 'com.google.android.material:material'
implementation "com.github.RideBeeline:android-bluetooth-current-time-service:0.1.2"
}
repositories {

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:versionCode="138"
android:versionName="4.2.4">
android:versionCode="139"
android:versionName="4.2.5">
<!-- android:allowBackup="false" -->
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

View File

@@ -56,6 +56,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.UUID;
import co.beeline.android.bluetooth.currenttimeservice.CurrentTimeService;
/**
* A data source that registers for BLE GATT notifications from a device and
@@ -153,6 +155,8 @@ public class SdDataSourceBLE extends SdDataSource {
mSdData.watchSdName = mBleDeviceName;
mSdData.watchPartNo = mBleDeviceAddr;
boolean success = CurrentTimeService.startServer(mContext);
bleConnect();
}
@@ -231,6 +235,7 @@ public class SdDataSourceBLE extends SdDataSource {
mUtil.writeToSysLogFile("SDDataSourceBLE.stop()");
bleDisconnect();
CurrentTimeService.stopServer();
super.stop();
}