diff options
author | Sven Gothel <[email protected]> | 2022-04-11 14:33:40 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2022-04-11 14:33:40 +0200 |
commit | 254df10ae22d8b26d86f43f8737a2d082b21c7f1 (patch) | |
tree | f2c194dcc5c0d4ecad43a60e33806b25bbdf19c9 /examples | |
parent | 3a8f93bdbaef686f8178c2f7f06779e6a757ce15 (diff) |
Examples: Only attempt using LE_PHYs::LE_2M if BT.major > 4, to keep the logs clean and for documentation (not required though)
Diffstat (limited to 'examples')
-rw-r--r-- | examples/dbt_peripheral00.cpp | 2 | ||||
-rw-r--r-- | examples/dbt_repeater00.cpp | 6 | ||||
-rw-r--r-- | examples/dbt_scanner10.cpp | 4 | ||||
-rw-r--r-- | examples/java/DBTPeripheral00.java | 2 | ||||
-rw-r--r-- | examples/java/DBTScanner10.java | 4 |
5 files changed, 9 insertions, 9 deletions
diff --git a/examples/dbt_peripheral00.cpp b/examples/dbt_peripheral00.cpp index 623de689..4a2d2004 100644 --- a/examples/dbt_peripheral00.cpp +++ b/examples/dbt_peripheral00.cpp @@ -656,7 +656,7 @@ static bool initAdapter(std::shared_ptr<BTAdapter>& adapter) { const LE_Features le_feats = adapter->getLEFeatures(); fprintf_td(stderr, "initAdapter: LE_Features %s\n", to_string(le_feats).c_str()); } - { + if( adapter->getBTMajorVersion() > 4 ) { LE_PHYs Tx { LE_PHYs::LE_2M }, Rx { LE_PHYs::LE_2M }; HCIStatusCode res = adapter->setDefaultLE_PHY(Tx, Rx); fprintf_td(stderr, "initAdapter: Set Default LE PHY: status %s: Tx %s, Rx %s\n", diff --git a/examples/dbt_repeater00.cpp b/examples/dbt_repeater00.cpp index 60d56e82..64f5fe03 100644 --- a/examples/dbt_repeater00.cpp +++ b/examples/dbt_repeater00.cpp @@ -453,7 +453,7 @@ static void processReadyToServer(BTDeviceRef device) { bool success = false; - { + if( device->getAdapter().getBTMajorVersion() > 4 ) { LE_PHYs Tx { LE_PHYs::LE_2M }, Rx { LE_PHYs::LE_2M }; HCIStatusCode res = device->setConnectedLE_PHY(Tx, Rx); fprintf_td(stderr, "****** To Server: Set Connected LE PHY: status %s: Tx %s, Rx %s\n", @@ -560,7 +560,7 @@ static bool initAdapterToServer(std::shared_ptr<BTAdapter>& adapter) { const LE_Features le_feats = adapter->getLEFeatures(); fprintf_td(stderr, "initAdapterToServer: LE_Features %s\n", to_string(le_feats).c_str()); } - { + if( adapter->getBTMajorVersion() > 4 ) { LE_PHYs Tx { LE_PHYs::LE_2M }, Rx { LE_PHYs::LE_2M }; HCIStatusCode res = adapter->setDefaultLE_PHY(Tx, Rx); fprintf_td(stderr, "initAdapterToServer: Set Default LE PHY: status %s: Tx %s, Rx %s\n", @@ -834,7 +834,7 @@ static bool initAdapterToClient(std::shared_ptr<BTAdapter>& adapter) { const LE_Features le_feats = adapter->getLEFeatures(); fprintf_td(stderr, "initAdapterToClient: LE_Features %s\n", to_string(le_feats).c_str()); } - { + if( adapter->getBTMajorVersion() > 4 ) { LE_PHYs Tx { LE_PHYs::LE_2M }, Rx { LE_PHYs::LE_2M }; HCIStatusCode res = adapter->setDefaultLE_PHY(Tx, Rx); fprintf_td(stderr, "initAdapterToClient: Set Default LE PHY: status %s: Tx %s, Rx %s\n", diff --git a/examples/dbt_scanner10.cpp b/examples/dbt_scanner10.cpp index 105fab17..a0ed7510 100644 --- a/examples/dbt_scanner10.cpp +++ b/examples/dbt_scanner10.cpp @@ -422,7 +422,7 @@ static void processReadyDevice(BTDeviceRef device) { bool success = false; - { + if( device->getAdapter().getBTMajorVersion() > 4 ) { LE_PHYs Tx { LE_PHYs::LE_2M }, Rx { LE_PHYs::LE_2M }; HCIStatusCode res = device->setConnectedLE_PHY(Tx, Rx); fprintf_td(stderr, "****** Set Connected LE PHY: status %s: Tx %s, Rx %s\n", @@ -666,7 +666,7 @@ static bool initAdapter(std::shared_ptr<BTAdapter>& adapter) { const LE_Features le_feats = adapter->getLEFeatures(); fprintf_td(stderr, "initAdapter: LE_Features %s\n", to_string(le_feats).c_str()); } - { + if( adapter->getBTMajorVersion() > 4 ) { LE_PHYs Tx { LE_PHYs::LE_2M }, Rx { LE_PHYs::LE_2M }; HCIStatusCode res = adapter->setDefaultLE_PHY(Tx, Rx); fprintf_td(stderr, "initAdapter: Set Default LE PHY: status %s: Tx %s, Rx %s\n", diff --git a/examples/java/DBTPeripheral00.java b/examples/java/DBTPeripheral00.java index 3dc9412a..83ebf879 100644 --- a/examples/java/DBTPeripheral00.java +++ b/examples/java/DBTPeripheral00.java @@ -697,7 +697,7 @@ public class DBTPeripheral00 { final LE_Features le_feats = adapter.getLEFeatures(); BTUtils.fprintf_td(System.err, "initAdapter: LE_Features %s\n", le_feats.toString()); } - { + if( adapter.getBTMajorVersion() > 4 ) { final LE_PHYs Tx = new LE_PHYs( LE_PHYs.PHY.LE_2M ); final LE_PHYs Rx = new LE_PHYs( LE_PHYs.PHY.LE_2M ); final HCIStatusCode res = adapter.setDefaultLE_PHY(Tx, Rx); diff --git a/examples/java/DBTScanner10.java b/examples/java/DBTScanner10.java index d0e3bb8c..d3cc8183 100644 --- a/examples/java/DBTScanner10.java +++ b/examples/java/DBTScanner10.java @@ -416,7 +416,7 @@ public class DBTScanner10 { boolean success = false; - { + if( device.getAdapter().getBTMajorVersion() > 4 ) { final LE_PHYs Tx = new LE_PHYs(LE_PHYs.PHY.LE_2M); final LE_PHYs Rx = new LE_PHYs(LE_PHYs.PHY.LE_2M); @@ -650,7 +650,7 @@ public class DBTScanner10 { final LE_Features le_feats = adapter.getLEFeatures(); BTUtils.fprintf_td(System.err, "initAdapter: LE_Features %s\n", le_feats.toString()); } - { + if( adapter.getBTMajorVersion() > 4 ) { final LE_PHYs Tx = new LE_PHYs(LE_PHYs.PHY.LE_2M); final LE_PHYs Rx = new LE_PHYs(LE_PHYs.PHY.LE_2M); |