diff options
author | Sven Gothel <[email protected]> | 2020-10-23 09:44:33 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-10-23 09:44:33 +0200 |
commit | 65e706721ed1ffa3800d8d2eb1d34f779cf55b85 (patch) | |
tree | 346324df2158949f951ac18922a16505d3ed80cf | |
parent | 39de6a7097abb12d1f60fdc9142b79d2a3ba456e (diff) |
BluetoothUtils.java: Shorten *Milliseconds* functions; Reuse C++ environment::startupTimeMilliseconds for startupTimeMillis(), aligning timing.
-rw-r--r-- | examples/java/DBTScanner10.java | 16 | ||||
-rw-r--r-- | examples/java/ScannerTinyB01.java | 26 | ||||
-rw-r--r-- | examples/java/ScannerTinyB02.java | 24 | ||||
-rw-r--r-- | java/jni/BluetoothUtils.cxx | 11 | ||||
-rw-r--r-- | java/org/tinyb/AdapterStatusListener.java | 12 | ||||
-rw-r--r-- | java/org/tinyb/BluetoothDevice.java | 6 | ||||
-rw-r--r-- | java/org/tinyb/BluetoothFactory.java | 5 | ||||
-rw-r--r-- | java/org/tinyb/BluetoothUtils.java | 19 | ||||
-rw-r--r-- | java/org/tinyb/GATTCharacteristicListener.java | 4 | ||||
-rw-r--r-- | java/tinyb/dbus/DBusDevice.java | 2 |
10 files changed, 66 insertions, 59 deletions
diff --git a/examples/java/DBTScanner10.java b/examples/java/DBTScanner10.java index 843cf54e..59affe46 100644 --- a/examples/java/DBTScanner10.java +++ b/examples/java/DBTScanner10.java @@ -93,14 +93,14 @@ public class DBTScanner10 { static void printf(final String format, final Object... args) { final Object[] args2 = new Object[args.length+1]; - args2[0] = BluetoothUtils.getElapsedMillisecond(); + args2[0] = BluetoothUtils.elapsedTimeMillis(); System.arraycopy(args, 0, args2, 1, args.length); System.err.printf("[%,9d] "+format, args2); // System.err.printf("[%,9d] ", BluetoothUtils.getElapsedMillisecond()); // System.err.printf(format, args); } static void println(final String msg) { - System.err.printf("[%,9d] %s%s", BluetoothUtils.getElapsedMillisecond(), msg, System.lineSeparator()); + System.err.printf("[%,9d] %s%s", BluetoothUtils.elapsedTimeMillis(), msg, System.lineSeparator()); } @@ -159,7 +159,7 @@ public class DBTScanner10 { { println("****** FOUND__-0: Connecting "+device.toString()); { - final long td = BluetoothUtils.getCurrentMilliseconds() - timestamp_t0; // adapter-init -> now + final long td = BluetoothUtils.currentTimeMillis() - timestamp_t0; // adapter-init -> now println("PERF: adapter-init -> FOUND__-0 " + td + " ms"); } final Thread deviceConnectTask = new Thread( new Runnable() { @@ -195,7 +195,7 @@ public class DBTScanner10 { connectionCount.incrementAndGet(); println("****** CONNECTED-0: Processing["+connectionCount.get()+"] "+device.toString()); { - final long td = BluetoothUtils.getCurrentMilliseconds() - timestamp_t0; // adapter-init -> now + final long td = BluetoothUtils.currentTimeMillis() - timestamp_t0; // adapter-init -> now println("PERF: adapter-init -> CONNECTED-0 " + td + " ms"); } final Thread deviceProcessingTask = new Thread( new Runnable() { @@ -300,7 +300,7 @@ public class DBTScanner10 { println("****** Processing Device: stopDiscovery result "+r); } - final long t1 = BluetoothUtils.getCurrentMilliseconds(); + final long t1 = BluetoothUtils.currentTimeMillis(); boolean success = false; // Secure Pairing @@ -336,7 +336,7 @@ public class DBTScanner10 { // And it is an error case nonetheless ;-) throw new RuntimeException("Processing Device: getServices() failed " + device.toString()); } - final long t5 = BluetoothUtils.getCurrentMilliseconds(); + final long t5 = BluetoothUtils.currentTimeMillis(); if( !QUIET ) { final long td01 = t1 - timestamp_t0; // adapter-init -> processing-start final long td15 = t5 - t1; // get-gatt-services @@ -547,7 +547,7 @@ public class DBTScanner10 { } } - timestamp_t0 = BluetoothUtils.getCurrentMilliseconds(); + timestamp_t0 = BluetoothUtils.currentTimeMillis(); adapter.addStatusListener(statusListener, null); adapter.enableDiscoverableNotifications(new BooleanNotification("Discoverable", timestamp_t0)); @@ -729,7 +729,7 @@ public class DBTScanner10 { @Override public void run(final Boolean v) { synchronized(this) { - final long t1 = BluetoothUtils.getCurrentMilliseconds(); + final long t1 = BluetoothUtils.currentTimeMillis(); this.v = v.booleanValue(); System.out.println("###### "+name+": "+v+" in td "+(t1-t0)+" ms!"); this.notifyAll(); diff --git a/examples/java/ScannerTinyB01.java b/examples/java/ScannerTinyB01.java index 533b3160..e431f610 100644 --- a/examples/java/ScannerTinyB01.java +++ b/examples/java/ScannerTinyB01.java @@ -208,7 +208,7 @@ public class ScannerTinyB01 { }; adapter.addStatusListener(statusListener, null); - final long timestamp_t0 = BluetoothUtils.getCurrentMilliseconds(); + final long timestamp_t0 = BluetoothUtils.currentTimeMillis(); adapter.enableDiscoverableNotifications(new BooleanNotification("Discoverable", timestamp_t0)); @@ -224,7 +224,7 @@ public class ScannerTinyB01 { loop++; System.err.println("****** Loop "+loop); - final long t0 = BluetoothUtils.getCurrentMilliseconds(); + final long t0 = BluetoothUtils.currentTimeMillis(); final HCIStatusCode discoveryStatus = adapter.startDiscovery(true); @@ -239,7 +239,7 @@ public class ScannerTinyB01 { boolean timeout = false; while( !timeout && null == matchingDiscoveredDeviceBucket[0] ) { matchingDiscoveredDeviceBucket.wait(t0_discovery); - final long tn = BluetoothUtils.getCurrentMilliseconds(); + final long tn = BluetoothUtils.currentTimeMillis(); timeout = ( tn - t0 ) > t0_discovery; } sensor = matchingDiscoveredDeviceBucket[0]; @@ -250,7 +250,7 @@ public class ScannerTinyB01 { while( null == sensor && !timeout ) { sensor = adapter.find(null, waitForDevice, t0_discovery); if( null == sensor ) { - final long tn = BluetoothUtils.getCurrentMilliseconds(); + final long tn = BluetoothUtils.currentTimeMillis(); timeout = ( tn - t0 ) > t0_discovery; Thread.sleep(60); } @@ -267,13 +267,13 @@ public class ScannerTinyB01 { } } if( null == sensor ) { - final long tn = BluetoothUtils.getCurrentMilliseconds(); + final long tn = BluetoothUtils.currentTimeMillis(); timeout = ( tn - t0 ) > t0_discovery; Thread.sleep(60); } } } - final long t1 = BluetoothUtils.getCurrentMilliseconds(); + final long t1 = BluetoothUtils.currentTimeMillis(); if (sensor == null) { System.err.println("No sensor found within "+(t1-t0)+" ms"); continue; // forever loop @@ -288,22 +288,22 @@ public class ScannerTinyB01 { sensor.enableConnectedNotifications(connectedNotification); sensor.enableServicesResolvedNotifications(servicesResolvedNotification); - final long t2 = BluetoothUtils.getCurrentMilliseconds(); + final long t2 = BluetoothUtils.currentTimeMillis(); final long t3; HCIStatusCode res; if ( ( res = sensor.connect() ) == HCIStatusCode.SUCCESS ) { - t3 = BluetoothUtils.getCurrentMilliseconds(); + t3 = BluetoothUtils.currentTimeMillis(); System.err.println("Sensor connect issued: "+(t3-t2)+" ms, total "+(t3-t0)+" ms"); System.err.println("Sensor connectedNotification: "+connectedNotification.getValue()); } else { - t3 = BluetoothUtils.getCurrentMilliseconds(); + t3 = BluetoothUtils.currentTimeMillis(); System.out.println("connect command failed, res "+res+": "+(t3-t2)+" ms, total "+(t3-t0)+" ms"); // we tolerate the failed immediate connect, as it might happen at a later time } synchronized( servicesResolvedNotification ) { while( !servicesResolvedNotification.getValue() ) { - final long tn = BluetoothUtils.getCurrentMilliseconds(); + final long tn = BluetoothUtils.currentTimeMillis(); if( tn - t3 > TO_CONNECT_AND_RESOLVE ) { break; } @@ -312,10 +312,10 @@ public class ScannerTinyB01 { } final long t4; if ( servicesResolvedNotification.getValue() ) { - t4 = BluetoothUtils.getCurrentMilliseconds(); + t4 = BluetoothUtils.currentTimeMillis(); System.err.println("Sensor servicesResolved: "+(t4-t3)+" ms, total "+(t4-t0)+" ms"); } else { - t4 = BluetoothUtils.getCurrentMilliseconds(); + t4 = BluetoothUtils.currentTimeMillis(); System.out.println("Sensor service not resolved: "+(t4-t3)+" ms, total "+(t4-t0)+" ms"); System.exit(-1); } @@ -427,7 +427,7 @@ public class ScannerTinyB01 { @Override public void run(final Boolean v) { synchronized(this) { - final long t1 = BluetoothUtils.getCurrentMilliseconds(); + final long t1 = BluetoothUtils.currentTimeMillis(); this.v = v.booleanValue(); System.out.println("###### "+name+": "+v+" in td "+(t1-t0)+" ms!"); this.notifyAll(); diff --git a/examples/java/ScannerTinyB02.java b/examples/java/ScannerTinyB02.java index d8409397..e40052a9 100644 --- a/examples/java/ScannerTinyB02.java +++ b/examples/java/ScannerTinyB02.java @@ -188,7 +188,7 @@ public class ScannerTinyB02 { }; adapter.addStatusListener(statusListener, null); - final long timestamp_t0 = BluetoothUtils.getCurrentMilliseconds(); + final long timestamp_t0 = BluetoothUtils.currentTimeMillis(); adapter.enableDiscoverableNotifications(new BooleanNotification("Discoverable", timestamp_t0)); @@ -204,7 +204,7 @@ public class ScannerTinyB02 { loop++; System.err.println("****** Loop "+loop); - final long t0 = BluetoothUtils.getCurrentMilliseconds(); + final long t0 = BluetoothUtils.currentTimeMillis(); final boolean discoveryStarted = true; // adapter.startDiscovery(true); { @@ -229,7 +229,7 @@ public class ScannerTinyB02 { boolean timeout = false; while( !timeout && null == matchingDiscoveredDeviceBucket[0] ) { matchingDiscoveredDeviceBucket.wait(t0_discovery); - final long tn = BluetoothUtils.getCurrentMilliseconds(); + final long tn = BluetoothUtils.currentTimeMillis(); timeout = ( tn - t0 ) > t0_discovery; } sensor = matchingDiscoveredDeviceBucket[0]; @@ -253,14 +253,14 @@ public class ScannerTinyB02 { } } if( null == sensor ) { - final long tn = BluetoothUtils.getCurrentMilliseconds(); + final long tn = BluetoothUtils.currentTimeMillis(); timeout = ( tn - t0 ) > t0_discovery; System.err.print("."); Thread.sleep(60); } } } - final long t1 = BluetoothUtils.getCurrentMilliseconds(); + final long t1 = BluetoothUtils.currentTimeMillis(); if (sensor == null) { System.err.println("No sensor found within "+(t1-t0)+" ms"); continue; // forever loop @@ -285,22 +285,22 @@ public class ScannerTinyB02 { sensor.enableConnectedNotifications(connectedNotification); sensor.enableServicesResolvedNotifications(servicesResolvedNotification); - final long t2 = BluetoothUtils.getCurrentMilliseconds(); + final long t2 = BluetoothUtils.currentTimeMillis(); final long t3; HCIStatusCode res; if ( (res = sensor.connect() ) == HCIStatusCode.SUCCESS ) { - t3 = BluetoothUtils.getCurrentMilliseconds(); + t3 = BluetoothUtils.currentTimeMillis(); System.err.println("Sensor connect issued: "+(t3-t2)+" ms, total "+(t3-t0)+" ms"); System.err.println("Sensor connectedNotification: "+connectedNotification.getValue()); } else { - t3 = BluetoothUtils.getCurrentMilliseconds(); + t3 = BluetoothUtils.currentTimeMillis(); System.out.println("connect command failed, res "+res+": "+(t3-t2)+" ms, total "+(t3-t0)+" ms"); // we tolerate the failed immediate connect, as it might happen at a later time } synchronized( servicesResolvedNotification ) { while( !servicesResolvedNotification.getValue() ) { - final long tn = BluetoothUtils.getCurrentMilliseconds(); + final long tn = BluetoothUtils.currentTimeMillis(); if( tn - t3 > TO_CONNECT ) { break; } @@ -309,10 +309,10 @@ public class ScannerTinyB02 { } final long t4; if ( servicesResolvedNotification.getValue() ) { - t4 = BluetoothUtils.getCurrentMilliseconds(); + t4 = BluetoothUtils.currentTimeMillis(); System.err.println("Sensor servicesResolved: "+(t4-t3)+" ms, total "+(t4-t0)+" ms"); } else { - t4 = BluetoothUtils.getCurrentMilliseconds(); + t4 = BluetoothUtils.currentTimeMillis(); System.out.println("Could not connect device: "+(t4-t3)+" ms, total "+(t4-t0)+" ms"); // System.exit(-1); } @@ -369,7 +369,7 @@ public class ScannerTinyB02 { @Override public void run(final Boolean v) { synchronized(this) { - final long t1 = BluetoothUtils.getCurrentMilliseconds(); + final long t1 = BluetoothUtils.currentTimeMillis(); this.v = v.booleanValue(); System.out.println("###### "+name+": "+v+" in td "+(t1-t0)+" ms!"); this.notifyAll(); diff --git a/java/jni/BluetoothUtils.cxx b/java/jni/BluetoothUtils.cxx index 84c18bcb..945afff1 100644 --- a/java/jni/BluetoothUtils.cxx +++ b/java/jni/BluetoothUtils.cxx @@ -31,9 +31,11 @@ #include <time.h> #include <jau/dfa_utf8_decode.hpp> +#include <jau/environment.hpp> #include "helper_base.hpp" + static const int64_t NanoPerMilli = 1000000L; static const int64_t MilliPerOne = 1000L; @@ -45,7 +47,7 @@ static const int64_t MilliPerOne = 1000L; * clock_gettime seems to be well supported at least on kernel >= 4.4. * Only bfin and sh are missing, while ia64 seems to be complicated. */ -jlong Java_org_tinyb_BluetoothUtils_getCurrentMilliseconds(JNIEnv *env, jclass clazz) { +jlong Java_org_tinyb_BluetoothUtils_currentTimeMillis(JNIEnv *env, jclass clazz) { (void)env; (void)clazz; @@ -55,6 +57,13 @@ jlong Java_org_tinyb_BluetoothUtils_getCurrentMilliseconds(JNIEnv *env, jclass c return (jlong)res; } +jlong Java_org_tinyb_BluetoothUtils_startupTimeMillisImpl(JNIEnv *env, jclass clazz) { + (void)env; + (void)clazz; + + return jau::environment::startupTimeMilliseconds; +} + jstring Java_org_tinyb_BluetoothUtils_decodeUTF8String(JNIEnv *env, jclass clazz, jbyteArray jbuffer, jint offset, jint size) { (void)clazz; diff --git a/java/org/tinyb/AdapterStatusListener.java b/java/org/tinyb/AdapterStatusListener.java index 78c307a6..23e6f421 100644 --- a/java/org/tinyb/AdapterStatusListener.java +++ b/java/org/tinyb/AdapterStatusListener.java @@ -63,7 +63,7 @@ public abstract class AdapterStatusListener { * see {@link BluetoothAdapter#addStatusListener(AdapterStatusListener, BluetoothDevice) addStatusListener(..)}. * @param newmask the new settings mask * @param changedmask the changes settings mask - * @param timestamp the time in monotonic milliseconds when this event occurred. See {@link BluetoothUtils#getCurrentMilliseconds()}. + * @param timestamp the time in monotonic milliseconds when this event occurred. See {@link BluetoothUtils#currentTimeMillis()}. */ public void adapterSettingsChanged(final BluetoothAdapter adapter, final AdapterSettings oldmask, final AdapterSettings newmask, @@ -76,14 +76,14 @@ public abstract class AdapterStatusListener { * @param changedType denotes the changed {@link ScanType} * @param changedEnabled denotes whether the changed {@link ScanType} has been enabled or disabled * @param keepAlive if {@code true}, the denoted changed {@link ScanType} will be re-enabled if disabled by the underlying Bluetooth implementation. - * @param timestamp the time in monotonic milliseconds when this event occurred. See {@link BluetoothUtils#getCurrentMilliseconds()}. + * @param timestamp the time in monotonic milliseconds when this event occurred. See {@link BluetoothUtils#currentTimeMillis()}. */ public void discoveringChanged(final BluetoothAdapter adapter, final ScanType currentMeta, final ScanType changedType, final boolean changedEnabled, final boolean keepAlive, final long timestamp) { } /** * A {@link BluetoothDevice} has been newly discovered. * @param device the found device - * @param timestamp the time in monotonic milliseconds when this event occurred. See {@link BluetoothUtils#getCurrentMilliseconds()}. + * @param timestamp the time in monotonic milliseconds when this event occurred. See {@link BluetoothUtils#currentTimeMillis()}. */ public void deviceFound(final BluetoothDevice device, final long timestamp) { } @@ -91,7 +91,7 @@ public abstract class AdapterStatusListener { * An already discovered {@link BluetoothDevice} has been updated. * @param device the updated device * @param updateMask the update mask of changed data - * @param timestamp the time in monotonic milliseconds when this event occurred. See {@link BluetoothUtils#getCurrentMilliseconds()}. + * @param timestamp the time in monotonic milliseconds when this event occurred. See {@link BluetoothUtils#currentTimeMillis()}. */ public void deviceUpdated(final BluetoothDevice device, final EIRDataTypeSet updateMask, final long timestamp) { } @@ -99,7 +99,7 @@ public abstract class AdapterStatusListener { * {@link BluetoothDevice} got connected. * @param device the device which has been connected, holding the new connection handle. * @param handle the new connection handle, which has been assigned to the device already - * @param timestamp the time in monotonic milliseconds when this event occurred. See {@link BluetoothUtils#getCurrentMilliseconds()}. + * @param timestamp the time in monotonic milliseconds when this event occurred. See {@link BluetoothUtils#currentTimeMillis()}. */ public void deviceConnected(final BluetoothDevice device, final short handle, final long timestamp) { } @@ -108,7 +108,7 @@ public abstract class AdapterStatusListener { * @param device the device which has been disconnected with zeroed connection handle. * @param reason the {@link HCIStatusCode} reason for disconnection * @param handle the disconnected connection handle, which has been unassigned from the device already - * @param timestamp the time in monotonic milliseconds when this event occurred. See {@link BluetoothUtils#getCurrentMilliseconds()}. + * @param timestamp the time in monotonic milliseconds when this event occurred. See {@link BluetoothUtils#currentTimeMillis()}. */ public void deviceDisconnected(final BluetoothDevice device, final HCIStatusCode reason, final short handle, final long timestamp) { } }; diff --git a/java/org/tinyb/BluetoothDevice.java b/java/org/tinyb/BluetoothDevice.java index 989852c4..36535d7b 100644 --- a/java/org/tinyb/BluetoothDevice.java +++ b/java/org/tinyb/BluetoothDevice.java @@ -294,7 +294,7 @@ public interface BluetoothDevice extends BluetoothObject * Returns the timestamp in monotonic milliseconds when this device instance has been created, * either via its initial discovery or its initial direct connection. * - * @see BluetoothUtils#getCurrentMilliseconds() + * @see BluetoothUtils#currentTimeMillis() * @since 2.0.0 */ long getCreationTimestamp(); @@ -303,7 +303,7 @@ public interface BluetoothDevice extends BluetoothObject * Returns the timestamp in monotonic milliseconds when this device instance has * discovered or connected directly the last time. * - * @see BluetoothUtils#getCurrentMilliseconds() + * @see BluetoothUtils#currentTimeMillis() * @since 2.0.0 * @implNote not implemented in tinyb.dbus, returns {@link #getCreationTimestamp()} */ @@ -313,7 +313,7 @@ public interface BluetoothDevice extends BluetoothObject * Returns the timestamp in monotonic milliseconds when this device instance underlying data * has been updated the last time. * - * @see BluetoothUtils#getCurrentMilliseconds() + * @see BluetoothUtils#currentTimeMillis() * @since 2.0.0 * @implNote not implemented in tinyb.dbus, returns {@link #getCreationTimestamp()} */ diff --git a/java/org/tinyb/BluetoothFactory.java b/java/org/tinyb/BluetoothFactory.java index 9dc5e3f9..1cb03c96 100644 --- a/java/org/tinyb/BluetoothFactory.java +++ b/java/org/tinyb/BluetoothFactory.java @@ -186,7 +186,6 @@ public class BluetoothFactory { } private static ImplementationIdentifier initializedID = null; - private static long t0; public static synchronized void checkInitialized() { if( null == initializedID ) { @@ -273,8 +272,6 @@ public class BluetoothFactory { } initializedID = id; // initialized! - t0 = BluetoothUtils.getCurrentMilliseconds(); - APIVersion = JAPIVersion; ImplVersion = null != mfAttributes ? mfAttributes.getValue(Attributes.Name.IMPLEMENTATION_VERSION) : null; if( VERBOSE ) { @@ -504,8 +501,6 @@ public class BluetoothFactory { private native static String getNativeAPIVersion(); private native static void setenv(String name, String value, boolean overwrite); - - /* pp */ static long getStartupTimeMilliseconds() { return t0; } } /** \example DBTScanner10.java diff --git a/java/org/tinyb/BluetoothUtils.java b/java/org/tinyb/BluetoothUtils.java index 6be03eb0..37048306 100644 --- a/java/org/tinyb/BluetoothUtils.java +++ b/java/org/tinyb/BluetoothUtils.java @@ -25,23 +25,26 @@ package org.tinyb; public class BluetoothUtils { + private static long t0; + static { + t0 = startupTimeMillisImpl(); + } + private static native long startupTimeMillisImpl(); /** - * Returns module startup time t0 in monotonic time in milliseconds. + * Returns current monotonic time in milliseconds. */ - public static long getStartupTimeMilliseconds() { return BluetoothFactory.getStartupTimeMilliseconds(); } + public static native long currentTimeMillis(); /** - * Returns current monotonic time in milliseconds. + * Returns the startup time in monotonic time in milliseconds of the native module. */ - public static native long getCurrentMilliseconds(); + public static long startupTimeMillis() { return t0; } /** - * Returns current elapsed monotonic time in milliseconds since module startup, see {@link #getStartupTimeMilliseconds()}. + * Returns current elapsed monotonic time in milliseconds since module startup, see {@link #startupTimeMillis()}. */ - public static long getElapsedMillisecond() { - return getCurrentMilliseconds() - BluetoothFactory.getStartupTimeMilliseconds(); - } + public static long elapsedTimeMillis() { return currentTimeMillis() - t0; } /** * Returns a hex string representation diff --git a/java/org/tinyb/GATTCharacteristicListener.java b/java/org/tinyb/GATTCharacteristicListener.java index f47e17d3..96114e07 100644 --- a/java/org/tinyb/GATTCharacteristicListener.java +++ b/java/org/tinyb/GATTCharacteristicListener.java @@ -88,7 +88,7 @@ public abstract class GATTCharacteristicListener { * with the given {@link BluetoothGattCharacteristic}. * @param charDecl {@link BluetoothGattCharacteristic} related to this notification * @param value the notification value - * @param timestamp the indication monotonic timestamp, see {@link BluetoothUtils#getCurrentMilliseconds()} + * @param timestamp the indication monotonic timestamp, see {@link BluetoothUtils#currentTimeMillis()} */ public void notificationReceived(final BluetoothGattCharacteristic charDecl, final byte[] value, final long timestamp) { @@ -99,7 +99,7 @@ public abstract class GATTCharacteristicListener { * with the given {@link BluetoothGattCharacteristic}. * @param charDecl {@link BluetoothGattCharacteristic} related to this indication * @param value the indication value - * @param timestamp the indication monotonic timestamp, see {@link BluetoothUtils#getCurrentMilliseconds()} + * @param timestamp the indication monotonic timestamp, see {@link BluetoothUtils#currentTimeMillis()} * @param confirmationSent if true, the native stack has sent the confirmation, otherwise user is required to do so. */ public void indicationReceived(final BluetoothGattCharacteristic charDecl, diff --git a/java/tinyb/dbus/DBusDevice.java b/java/tinyb/dbus/DBusDevice.java index 474466c9..070e71d3 100644 --- a/java/tinyb/dbus/DBusDevice.java +++ b/java/tinyb/dbus/DBusDevice.java @@ -283,7 +283,7 @@ public class DBusDevice extends DBusObject implements BluetoothDevice private DBusDevice(final long instance) { super(instance); - ts_creation = BluetoothUtils.getCurrentMilliseconds(); + ts_creation = BluetoothUtils.currentTimeMillis(); } final long ts_creation; |