diff options
author | Sven Gothel <[email protected]> | 2020-10-20 05:44:37 +0200 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2020-10-20 05:44:37 +0200 |
commit | 1f6e924fe05ed45bfa4d0d901af2c4df6c1abab5 (patch) | |
tree | 3e7bb612dcf35b5ef3cff10b46f4fbc95236ad6f /examples | |
parent | 2e40a6fbb84ef21bb9551c653199964e55d7954b (diff) |
Normalize: Use size_t where appropriate; timestamp is uint64_t
timestamp is uint64_t
- AttPDUMsg
Use size_t where appropriate
- OctetTypes.hpp: TROOctets*
- ATTPDUTypes.hpp: AttPDUMsg*
- HCITypes.hpp: HCIPacket*
- HCIComm.hpp: HCIComm
- L2CAPComm.hpp: L2CAPComm
- MgmtTypes.hpp: MgmtCommand*, MgmtEvent*
- UUID.hpp: uuid_t
- DBTManager, GATTHandler, HCIHandler
- HCIComm.hpp: HCIComm
- BTTypes.hpp
- DBTTypes.hpp
Diffstat (limited to 'examples')
-rw-r--r-- | examples/direct_bt_scanner00/dbt_scanner00.cpp | 6 | ||||
-rw-r--r-- | examples/direct_bt_scanner01/dbt_scanner01.cpp | 6 | ||||
-rw-r--r-- | examples/direct_bt_scanner10/dbt_scanner10.cpp | 6 |
3 files changed, 9 insertions, 9 deletions
diff --git a/examples/direct_bt_scanner00/dbt_scanner00.cpp b/examples/direct_bt_scanner00/dbt_scanner00.cpp index 0468ba6d..17328897 100644 --- a/examples/direct_bt_scanner00/dbt_scanner00.cpp +++ b/examples/direct_bt_scanner00/dbt_scanner00.cpp @@ -112,7 +112,7 @@ class MyGATTEventListener : public AssociatedGATTCharacteristicListener { void notificationReceived(GATTCharacteristicRef charDecl, std::shared_ptr<TROOctets> charValue, const uint64_t timestamp) override { const std::shared_ptr<DBTDevice> dev = charDecl->getDeviceChecked(); - const int64_t tR = getCurrentMilliseconds(); + const uint64_t tR = getCurrentMilliseconds(); fprintf(stderr, "****** GATT Notify (td %" PRIu64 " ms, dev-discovered %" PRIu64 " ms): From %s\n", (tR-timestamp), (tR-dev->ts_creation), dev->toString().c_str()); if( nullptr != charDecl ) { @@ -126,7 +126,7 @@ class MyGATTEventListener : public AssociatedGATTCharacteristicListener { const bool confirmationSent) override { const std::shared_ptr<DBTDevice> dev = charDecl->getDeviceChecked(); - const int64_t tR = getCurrentMilliseconds(); + const uint64_t tR = getCurrentMilliseconds(); fprintf(stderr, "****** GATT Indication (confirmed %d, td(msg %" PRIu64 " ms, dev-discovered %" PRIu64 " ms): From %s\n", confirmationSent, (tR-timestamp), (tR-dev->ts_creation), dev->toString().c_str()); if( nullptr != charDecl ) { @@ -203,7 +203,7 @@ int main(int argc, char *argv[]) adapter.addStatusListener(std::shared_ptr<AdapterStatusListener>(new MyAdapterStatusListener())); - const int64_t t0 = getCurrentMilliseconds(); + const uint64_t t0 = getCurrentMilliseconds(); while( ok && ( forever || !foundDevice ) ) { ok = HCIStatusCode::SUCCESS == adapter.startDiscovery(true /* keepAlive */); diff --git a/examples/direct_bt_scanner01/dbt_scanner01.cpp b/examples/direct_bt_scanner01/dbt_scanner01.cpp index 1aed365a..9f71bf27 100644 --- a/examples/direct_bt_scanner01/dbt_scanner01.cpp +++ b/examples/direct_bt_scanner01/dbt_scanner01.cpp @@ -108,7 +108,7 @@ class MyGATTEventListener : public GATTCharacteristicListener { void notificationReceived(GATTCharacteristicRef charDecl, std::shared_ptr<TROOctets> charValue, const uint64_t timestamp) override { const std::shared_ptr<DBTDevice> dev = charDecl->getDeviceChecked(); - const int64_t tR = getCurrentMilliseconds(); + const uint64_t tR = getCurrentMilliseconds(); fprintf(stderr, "****** GATT Notify (td %" PRIu64 " ms, dev-discovered %" PRIu64 " ms): From %s\n", (tR-timestamp), (tR-dev->ts_creation), dev->toString().c_str()); if( nullptr != charDecl ) { @@ -122,7 +122,7 @@ class MyGATTEventListener : public GATTCharacteristicListener { const bool confirmationSent) override { const std::shared_ptr<DBTDevice> dev = charDecl->getDeviceChecked(); - const int64_t tR = getCurrentMilliseconds(); + const uint64_t tR = getCurrentMilliseconds(); fprintf(stderr, "****** GATT Indication (confirmed %d, td(msg %" PRIu64 " ms, dev-discovered %" PRIu64 " ms): From %s\n", confirmationSent, (tR-timestamp), (tR-dev->ts_creation), dev->toString().c_str()); if( nullptr != charDecl ) { @@ -201,7 +201,7 @@ int main(int argc, char *argv[]) adapter.addStatusListener(std::shared_ptr<AdapterStatusListener>(new MyAdapterStatusListener())); - const int64_t t0 = getCurrentMilliseconds(); + const uint64_t t0 = getCurrentMilliseconds(); while( ok && ( forever || !foundDevice ) ) { ok = HCIStatusCode::SUCCESS == adapter.startDiscovery(true /* keepAlive */); diff --git a/examples/direct_bt_scanner10/dbt_scanner10.cpp b/examples/direct_bt_scanner10/dbt_scanner10.cpp index aceebf37..c20b02cc 100644 --- a/examples/direct_bt_scanner10/dbt_scanner10.cpp +++ b/examples/direct_bt_scanner10/dbt_scanner10.cpp @@ -53,7 +53,7 @@ using namespace jau; * </p> */ -static int64_t timestamp_t0; +static uint64_t timestamp_t0; static int RESET_ADAPTER_EACH_CONN = 0; @@ -272,7 +272,7 @@ class MyGATTEventListener : public AssociatedGATTCharacteristicListener { void notificationReceived(GATTCharacteristicRef charDecl, std::shared_ptr<TROOctets> charValue, const uint64_t timestamp) override { const std::shared_ptr<DBTDevice> dev = charDecl->getDeviceChecked(); - const int64_t tR = getCurrentMilliseconds(); + const uint64_t tR = getCurrentMilliseconds(); fprintf(stderr, "****** GATT Notify (td %" PRIu64 " ms, dev-discovered %" PRIu64 " ms): From %s\n", (tR-timestamp), (tR-dev->getLastDiscoveryTimestamp()), dev->toString().c_str()); if( nullptr != charDecl ) { @@ -286,7 +286,7 @@ class MyGATTEventListener : public AssociatedGATTCharacteristicListener { const bool confirmationSent) override { const std::shared_ptr<DBTDevice> dev = charDecl->getDeviceChecked(); - const int64_t tR = getCurrentMilliseconds(); + const uint64_t tR = getCurrentMilliseconds(); fprintf(stderr, "****** GATT Indication (confirmed %d, td(msg %" PRIu64 " ms, dev-discovered %" PRIu64 " ms): From %s\n", confirmationSent, (tR-timestamp), (tR-dev->getLastDiscoveryTimestamp()), dev->toString().c_str()); if( nullptr != charDecl ) { |