Added Current Time Service to BLE Data Source so we set the time on InfiniTime when it connects (using the library by BeeLine https://github.com/RideBeeline/android-bluetooth-current-time-service)).
This commit is contained in:
@@ -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" />
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user