summaryrefslogtreecommitdiff
path: root/sl4n/facades/bluetooth/bt_binder_facade.h
diff options
context:
space:
mode:
Diffstat (limited to 'sl4n/facades/bluetooth/bt_binder_facade.h')
-rw-r--r--sl4n/facades/bluetooth/bt_binder_facade.h62
1 files changed, 0 insertions, 62 deletions
diff --git a/sl4n/facades/bluetooth/bt_binder_facade.h b/sl4n/facades/bluetooth/bt_binder_facade.h
deleted file mode 100644
index 65ece71..0000000
--- a/sl4n/facades/bluetooth/bt_binder_facade.h
+++ /dev/null
@@ -1,62 +0,0 @@
-//
-// Copyright (C) 2016 Google, Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at:
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
-
-#pragma once
-
-#include <rapidjson/document.h>
-#include <android/bluetooth/IBluetooth.h>
-#include <android/bluetooth/IBluetoothLowEnergy.h>
-#include <tuple>
-
-// BtBinderFacade provides simple wrappers to call Binder apis.
-// Each public function returns a tuple of the return type and an integer
-// representing the pass/fail value of the function. The functions check to see
-// if the API call is actually possible. If it is the function's tuple will
-// contain the actual result and an integer that indicates the value passed. If
-// the function is not possible then there will be a mock return value in the
-// first position of the tuple and the second value in the tuple indicates the
-// value failed. Therefore it is up to the function to decide whether the
-// expected api call is actually possible before calling it.
-//
-// TODO(tturney): Instead of using an integer in the tuple to represent
-// pass/fail, create a class that properly represents the result of the
-// function.
-class BtBinderFacade {
- public:
- BtBinderFacade();
- std::tuple<bool, int> BtBinderEnable();
- std::tuple<std::string, int> BtBinderGetAddress();
- std::tuple<std::string, int> BtBinderGetName();
- std::tuple<bool, int> BtBinderInitInterface();
- std::tuple<bool, int> BtBinderRegisterBLE();
- std::tuple<int, int> BtBinderSetAdvSettings(
- int mode, int timeout_seconds, int tx_power_level, bool is_connectable);
- std::tuple<bool, int> BtBinderSetName(std::string name);
-
- private:
- bool SharedValidator();
- // Returns a handle to the IBluetooth Binder from the Android ServiceManager.
- // Binder client code can use this to make calls to the service.
- android::sp<android::bluetooth::IBluetooth> bt_iface;
-
- // Returns a handle to the IBluetoothLowEnergy Binder from the Android
- // ServiceManager. Binder client code can use this to make calls to the
- // service.
- android::sp<android::bluetooth::IBluetoothLowEnergy> ble_iface;
- std::map<int, bluetooth::AdvertiseSettings> adv_settings_map;
- int adv_settings_count;
- int manu_data_count;
-};