Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(327)

Issue 1094273003: Implementing a BLE connection finder. (Closed)

Created:
5 years, 8 months ago by sacomoto
Modified:
5 years, 8 months ago
Reviewers:
Tim Song, msarda
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Implementing a BLE connection finder. This CL adds a connection finder class. The connection finder scans for Bluetooth Low Energy devices advertising a given target service. The current version only works when the remote device advertising the target service is sending all its primary services UUID. BUG=479673 R=msarda TBR=tengs Committed: https://crrev.com/f56835d5211fc533a02f143e06eb310764f6b901 Cr-Commit-Position: refs/heads/master@{#326807}

Patch Set 1 #

Total comments: 21

Patch Set 2 : Nits. #

Patch Set 3 : Rebasing. #

Patch Set 4 : Reverting build file. #

Total comments: 31

Patch Set 5 : Error handling and nits. #

Total comments: 4

Patch Set 6 : ensuring a single connection #

Total comments: 12

Patch Set 7 : string to char[] #

Unified diffs Side-by-side diffs Delta from patch set Stats (+315 lines, -2 lines) Patch
M components/proximity_auth.gypi View 1 2 3 4 5 6 2 chunks +4 lines, -2 lines 0 comments Download
M components/proximity_auth/ble/BUILD.gn View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
A components/proximity_auth/ble/bluetooth_low_energy_connection_finder.h View 1 2 3 4 5 6 1 chunk +106 lines, -0 lines 0 comments Download
A components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc View 1 2 3 4 5 6 1 chunk +181 lines, -0 lines 0 comments Download
M components/proximity_auth/ble/proximity_auth_ble_system.h View 1 2 3 4 5 6 2 chunks +5 lines, -0 lines 0 comments Download
M components/proximity_auth/ble/proximity_auth_ble_system.cc View 1 2 3 4 5 6 1 chunk +17 lines, -0 lines 0 comments Download

Messages

Total messages: 17 (3 generated)
msarda
https://codereview.chromium.org/1094273003/diff/1/components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc File components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc (right): https://codereview.chromium.org/1094273003/diff/1/components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc#newcode20 components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc:20: namespace proximity_auth { This function is internal. Use an ...
5 years, 8 months ago (2015-04-22 08:55:15 UTC) #1
sacomoto
PTAL. https://codereview.chromium.org/1094273003/diff/1/components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc File components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc (right): https://codereview.chromium.org/1094273003/diff/1/components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc#newcode20 components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc:20: namespace proximity_auth { On 2015/04/22 08:55:14, msarda wrote: ...
5 years, 8 months ago (2015-04-22 09:44:20 UTC) #2
msarda
You will probably need to add bluetooth_low_energy_connection_finder.h and bluetooth_low_energy_connection_finder.cc to components/proximity_auth/ble/BUILD.gn https://codereview.chromium.org/1094273003/diff/60001/components/proximity_auth.gypi File components/proximity_auth.gypi (right): ...
5 years, 8 months ago (2015-04-22 15:58:13 UTC) #3
msarda
I do not see your patch. You need to address my last comments (otherwise there ...
5 years, 8 months ago (2015-04-24 11:23:42 UTC) #4
sacomoto
https://codereview.chromium.org/1094273003/diff/60001/components/proximity_auth.gypi File components/proximity_auth.gypi (right): https://codereview.chromium.org/1094273003/diff/60001/components/proximity_auth.gypi#newcode26 components/proximity_auth.gypi:26: "proximity_auth/ble/proximity_auth_ble_system.cc", On 2015/04/22 15:58:12, msarda wrote: > This order ...
5 years, 8 months ago (2015-04-24 14:04:57 UTC) #5
msarda
LGTM with some nits. https://codereview.chromium.org/1094273003/diff/60001/components/proximity_auth/ble/bluetooth_low_energy_connection_finder.h File components/proximity_auth/ble/bluetooth_low_energy_connection_finder.h (right): https://codereview.chromium.org/1094273003/diff/60001/components/proximity_auth/ble/bluetooth_low_energy_connection_finder.h#newcode33 components/proximity_auth/ble/bluetooth_low_energy_connection_finder.h:33: void Find(const device::BluetoothDevice::GattConnectionCallback& On 2015/04/24 ...
5 years, 8 months ago (2015-04-24 14:12:16 UTC) #6
sacomoto
https://codereview.chromium.org/1094273003/diff/80001/components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc File components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc (right): https://codereview.chromium.org/1094273003/diff/80001/components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc#newcode84 components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc:84: CreateConnection(remote_device); On 2015/04/24 14:12:16, msarda wrote: > This seems ...
5 years, 8 months ago (2015-04-24 14:56:22 UTC) #7
sacomoto
Hi Tim, I added some files to proximity_auth.gypi. Cheers, Gustavo
5 years, 8 months ago (2015-04-24 15:00:34 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1094273003/100001
5 years, 8 months ago (2015-04-24 15:22:48 UTC) #12
commit-bot: I haz the power
Committed patchset #6 (id:100001)
5 years, 8 months ago (2015-04-24 15:54:49 UTC) #13
commit-bot: I haz the power
Patchset 6 (id:??) landed as https://crrev.com/f56835d5211fc533a02f143e06eb310764f6b901 Cr-Commit-Position: refs/heads/master@{#326807}
5 years, 8 months ago (2015-04-24 15:55:38 UTC) #14
Tim Song
Please write a unit test for this class. https://codereview.chromium.org/1094273003/diff/100001/components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc File components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc (right): https://codereview.chromium.org/1094273003/diff/100001/components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc#newcode31 components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc:31: if ...
5 years, 8 months ago (2015-04-24 15:56:56 UTC) #15
Justin Donnelly
A revert of this CL (patchset #6 id:100001) has been created in https://codereview.chromium.org/1105863003/ by jdonnelly@chromium.org. ...
5 years, 8 months ago (2015-04-24 17:23:40 UTC) #16
sacomoto
5 years, 8 months ago (2015-04-24 19:04:06 UTC) #17
Message was sent while issue was closed.
Hi, 

I addressed Tim's comments and change the string to char[] that caused the CL to
be reverted.

The new CL corresponding to the latest version of this CL is here:
https://codereview.chromium.org/1102093002.

@Tim, I still didn't add unit tests, but it's next thing I'm going to do. I want
to land it to unblock Mihai.

https://codereview.chromium.org/1094273003/diff/100001/components/proximity_a...
File components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc
(right):

https://codereview.chromium.org/1094273003/diff/100001/components/proximity_a...
components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc:31: if
(discovery_session_.get()) {
On 2015/04/24 15:56:55, Tim Song wrote:
> nit: you don't need the .get() to check if the pointer is non-null. Same with
> all the cases below.

Done.

https://codereview.chromium.org/1094273003/diff/100001/components/proximity_a...
components/proximity_auth/ble/bluetooth_low_energy_connection_finder.cc:164:
connection_callback_.Run(connection.Pass());
On 2015/04/24 15:56:55, Tim Song wrote:
> You should stop the discovery session before running the callback.

Done.

https://codereview.chromium.org/1094273003/diff/100001/components/proximity_a...
File components/proximity_auth/ble/bluetooth_low_energy_connection_finder.h
(right):

https://codereview.chromium.org/1094273003/diff/100001/components/proximity_a...
components/proximity_auth/ble/bluetooth_low_energy_connection_finder.h:5:
#ifndef COMPONENTS_PROXIMITY_AUTH_BLUETOOTH_LOW_ENERGY_CONNECTION_FINDER_H
On 2015/04/24 15:56:55, Tim Song wrote:
> nit: keep headers consistent with path (missing BLE directory).

Done.

https://codereview.chromium.org/1094273003/diff/100001/components/proximity_a...
components/proximity_auth/ble/bluetooth_low_energy_connection_finder.h:37:
protected:
On 2015/04/24 15:56:55, Tim Song wrote:
> Why declare a protected method?

I'm being consistent with BluetoothConnection.

https://codereview.chromium.org/1094273003/diff/100001/components/proximity_a...
components/proximity_auth/ble/bluetooth_low_energy_connection_finder.h:38: //
Observer for device::BluetoothAdapter::Observer
On 2015/04/24 15:56:55, Tim Song wrote:
> nit: for consistency use
> 
> // device::BluetoothAdapter::Observer:

Done.

https://codereview.chromium.org/1094273003/diff/100001/components/proximity_a...
File components/proximity_auth/ble/proximity_auth_ble_system.cc (right):

https://codereview.chromium.org/1094273003/diff/100001/components/proximity_a...
components/proximity_auth/ble/proximity_auth_ble_system.cc:27:
BluetoothLowEnergyConnectionFinder* connection_finder =
On 2015/04/24 15:56:56, Tim Song wrote:
> Use a scoped_ptr member variable to hold this pointer.

Done.

Powered by Google App Engine
This is Rietveld 408576698