diff options
Diffstat (limited to 'examples/direct_bt_scanner01/dbt_scanner01.cpp')
-rw-r--r-- | examples/direct_bt_scanner01/dbt_scanner01.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/direct_bt_scanner01/dbt_scanner01.cpp b/examples/direct_bt_scanner01/dbt_scanner01.cpp index 5f57f3ee..ee1f0c39 100644 --- a/examples/direct_bt_scanner01/dbt_scanner01.cpp +++ b/examples/direct_bt_scanner01/dbt_scanner01.cpp @@ -181,6 +181,11 @@ int main(int argc, char *argv[]) fprintf(stderr, "Adapter invalid.\n"); exit(1); } + if( !adapter.isEnabled() ) { + fprintf(stderr, "Adapter not enabled: device %s, address %s: %s\n", + adapter.getName().c_str(), adapter.getAddressString().c_str(), adapter.toString().c_str()); + exit(1); + } fprintf(stderr, "Using adapter: device %s, address %s: %s\n", adapter.getName().c_str(), adapter.getAddressString().c_str(), adapter.toString().c_str()); |