forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bluetooth: android: Create BluetoothRemoteGattServiceAndroid objects.
Initiate GATT service discovery when a connection is established. Upon discovery completion create C++ objects associated with the Java objects. For now these are simple stubs, and don't even retain the Java object. BUG=541355 Review URL: https://codereview.chromium.org/1394973003 Cr-Commit-Position: refs/heads/master@{#353465}
- Loading branch information
Showing
15 changed files
with
427 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
// Copyright 2014 The Chromium Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style license that can be | ||
// found in the LICENSE file. | ||
|
||
#include "device/bluetooth/bluetooth_remote_gatt_service_android.h" | ||
|
||
#include "device/bluetooth/bluetooth_adapter_android.h" | ||
#include "device/bluetooth/bluetooth_device_android.h" | ||
|
||
namespace device { | ||
|
||
// static | ||
BluetoothRemoteGattServiceAndroid* BluetoothRemoteGattServiceAndroid::Create( | ||
BluetoothAdapterAndroid* adapter, | ||
BluetoothDeviceAndroid* device, | ||
jobject bluetooth_remote_gatt_service_wrapper, | ||
std::string instanceId) { | ||
BluetoothRemoteGattServiceAndroid* service = | ||
new BluetoothRemoteGattServiceAndroid(adapter, device, instanceId); | ||
|
||
return service; | ||
} | ||
|
||
std::string BluetoothRemoteGattServiceAndroid::GetIdentifier() const { | ||
return instanceId_; | ||
} | ||
|
||
device::BluetoothUUID BluetoothRemoteGattServiceAndroid::GetUUID() const { | ||
NOTIMPLEMENTED(); | ||
return device::BluetoothUUID(); | ||
} | ||
|
||
bool BluetoothRemoteGattServiceAndroid::IsLocal() const { | ||
return false; | ||
} | ||
|
||
bool BluetoothRemoteGattServiceAndroid::IsPrimary() const { | ||
NOTIMPLEMENTED(); | ||
return true; | ||
} | ||
|
||
device::BluetoothDevice* BluetoothRemoteGattServiceAndroid::GetDevice() const { | ||
return device_; | ||
} | ||
|
||
std::vector<device::BluetoothGattCharacteristic*> | ||
BluetoothRemoteGattServiceAndroid::GetCharacteristics() const { | ||
NOTIMPLEMENTED(); | ||
std::vector<device::BluetoothGattCharacteristic*> characteristics; | ||
return characteristics; | ||
} | ||
|
||
std::vector<device::BluetoothGattService*> | ||
BluetoothRemoteGattServiceAndroid::GetIncludedServices() const { | ||
NOTIMPLEMENTED(); | ||
return std::vector<device::BluetoothGattService*>(); | ||
} | ||
|
||
device::BluetoothGattCharacteristic* | ||
BluetoothRemoteGattServiceAndroid::GetCharacteristic( | ||
const std::string& identifier) const { | ||
NOTIMPLEMENTED(); | ||
return nullptr; | ||
} | ||
|
||
bool BluetoothRemoteGattServiceAndroid::AddCharacteristic( | ||
device::BluetoothGattCharacteristic* characteristic) { | ||
return false; | ||
} | ||
|
||
bool BluetoothRemoteGattServiceAndroid::AddIncludedService( | ||
device::BluetoothGattService* service) { | ||
return false; | ||
} | ||
|
||
void BluetoothRemoteGattServiceAndroid::Register( | ||
const base::Closure& callback, | ||
const ErrorCallback& error_callback) { | ||
error_callback.Run(); | ||
} | ||
|
||
void BluetoothRemoteGattServiceAndroid::Unregister( | ||
const base::Closure& callback, | ||
const ErrorCallback& error_callback) { | ||
error_callback.Run(); | ||
} | ||
|
||
BluetoothRemoteGattServiceAndroid::BluetoothRemoteGattServiceAndroid( | ||
BluetoothAdapterAndroid* adapter, | ||
BluetoothDeviceAndroid* device, | ||
std::string instanceId) | ||
: adapter_(adapter), device_(device), instanceId_(instanceId) {} | ||
|
||
BluetoothRemoteGattServiceAndroid::~BluetoothRemoteGattServiceAndroid() {} | ||
|
||
} // namespace device |
Oops, something went wrong.