+ bool StartUpBluetoothInterfaces() {
+ if (!hal::BluetoothInterface::Initialize())
+ goto failed;
+
+ if (!hal::BluetoothGattInterface::Initialize())
+ goto failed;
+
+ return true;
+
+ failed:
+ ShutDownBluetoothInterfaces();
+ return false;
+ }
+
+ void ShutDownBluetoothInterfaces() {
+ if (hal::BluetoothGattInterface::IsInitialized())
+ hal::BluetoothGattInterface::CleanUp();
+ if (hal::BluetoothInterface::IsInitialized())
+ hal::BluetoothInterface::CleanUp();
+ }
+