diff options
author | Sven Gothel <[email protected]> | 2022-04-14 05:29:31 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2022-04-14 05:29:31 +0200 |
commit | b0cf6cee7adb38d0e8a64d9c22f44083d2a79e4d (patch) | |
tree | 63f88c27721fcd78ae35911ac563efce3a5445b8 /examples | |
parent | 48221cbcae5ab772f418e77b7fe3320f7f3d0f2e (diff) |
Fix and document default connection paramter, leaning to higher performance side - add documentation file
Diffstat (limited to 'examples')
-rw-r--r-- | examples/dbt_peripheral00.cpp | 6 | ||||
-rw-r--r-- | examples/dbt_scanner10.cpp | 4 | ||||
-rw-r--r-- | examples/java/DBTPeripheral00.java | 6 | ||||
-rw-r--r-- | examples/java/DBTScanner10.java | 4 |
4 files changed, 10 insertions, 10 deletions
diff --git a/examples/dbt_peripheral00.cpp b/examples/dbt_peripheral00.cpp index 9c55cbf9..9d12f5a6 100644 --- a/examples/dbt_peripheral00.cpp +++ b/examples/dbt_peripheral00.cpp @@ -519,8 +519,8 @@ class MyGATTServerListener : public DBGattServer::Listener { } }; -static const uint16_t adv_interval_min=640; -static const uint16_t adv_interval_max=640; +static const uint16_t adv_interval_min=160; // x0.625 = 100ms +static const uint16_t adv_interval_max=480; // x0.625 = 300ms static const AD_PDU_Type adv_type=AD_PDU_Type::ADV_IND; static const uint8_t adv_chan_map=0x07; static const uint8_t filter_policy=0x00; @@ -541,7 +541,7 @@ static bool startAdvertising(BTAdapter *a, std::string msg) { eir.setServicesComplete(false); eir.setName(a->getName()); - eir.setConnInterval(8, 24); // 10ms - 30ms + eir.setConnInterval(8, 12); // 10ms - 15ms DBGattCharRef gattDevNameChar = dbGattServer->findGattChar( jau::uuid16_t(GattServiceType::GENERIC_ACCESS), jau::uuid16_t(GattCharacteristicType::DEVICE_NAME) ); diff --git a/examples/dbt_scanner10.cpp b/examples/dbt_scanner10.cpp index 6e76a5e2..a4d61020 100644 --- a/examples/dbt_scanner10.cpp +++ b/examples/dbt_scanner10.cpp @@ -400,8 +400,8 @@ static void connectDiscoveredDevice(BTDeviceRef device) { std::shared_ptr<const EInfoReport> eir = device->getEIR(); fprintf_td(stderr, "Using EIR %s\n", eir->toString().c_str()); - uint16_t conn_interval_min = (uint16_t)12; - uint16_t conn_interval_max = (uint16_t)12; + uint16_t conn_interval_min = (uint16_t)8; // 10ms + uint16_t conn_interval_max = (uint16_t)12; // 15ms const uint16_t conn_latency = (uint16_t)0; if( eir->isSet(EIRDataType::CONN_IVAL) ) { eir->getConnInterval(conn_interval_min, conn_interval_max); diff --git a/examples/java/DBTPeripheral00.java b/examples/java/DBTPeripheral00.java index ae64c58d..a09e6fc6 100644 --- a/examples/java/DBTPeripheral00.java +++ b/examples/java/DBTPeripheral00.java @@ -559,8 +559,8 @@ public class DBTPeripheral00 { } } } - static final short adv_interval_min=(short)640; - static final short adv_interval_max=(short)640; + static final short adv_interval_min=(short)160; // x0.625 = 100ms + static final short adv_interval_max=(short)480; // x0.625 = 300ms static final byte adv_type=(byte)0; // AD_PDU_Type::ADV_IND; static final byte adv_chan_map=(byte)0x07; static final byte filter_policy=(byte)0x00; @@ -597,7 +597,7 @@ public class DBTPeripheral00 { eir.setServicesComplete(false); eir.setName(adapter.getName()); - eir.setConnInterval((short)8, (short)24); // 10ms - 30ms + eir.setConnInterval((short)8, (short)12); // 10ms - 15ms final DBGattChar gattDevNameChar = dbGattServer.findGattChar(DBGattService.UUID16.GENERIC_ACCESS, DBGattChar.UUID16.DEVICE_NAME); if( null != gattDevNameChar ) { diff --git a/examples/java/DBTScanner10.java b/examples/java/DBTScanner10.java index 8711fd78..3d81900e 100644 --- a/examples/java/DBTScanner10.java +++ b/examples/java/DBTScanner10.java @@ -369,8 +369,8 @@ public class DBTScanner10 { final EInfoReport eir = device.getEIR(); BTUtils.println(System.err, "Using EIR "+eir.toString()); - short conn_interval_min = (short)12; - short conn_interval_max = (short)12; + short conn_interval_min = (short)8; // 10ms + short conn_interval_max = (short)12; // 15ms final short conn_latency = (short)0; if( eir.isSet(EIRDataTypeSet.DataType.CONN_IVAL) ) { final short[] minmax = new short[2]; |