Last Comment Bug 780812 - [b2g-bluetooth] Implement function to get RFCOMM channel of specific Bluetooth service
: [b2g-bluetooth] Implement function to get RFCOMM channel of specific Bluetoot...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM: Device Interfaces (show other bugs)
: Trunk
: ARM Gonk (Firefox OS)
: -- normal (vote)
: mozilla17
Assigned To: Eric Chou [:ericchou] [:echou]
:
Mentors:
Depends on:
Blocks: b2g-bluetooth
  Show dependency treegraph
 
Reported: 2012-08-06 21:06 PDT by Eric Chou [:ericchou] [:echou]
Modified: 2012-08-08 09:29 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
v1: patch 1: Added function QueryServerChannel (4.26 KB, patch)
2012-08-07 00:12 PDT, Eric Chou [:ericchou] [:echou]
kyle: review+
Details | Diff | Splinter Review
Final version: patch 1: Added function GetDeviceServiceChannel(), r=qDot (4.84 KB, patch)
2012-08-07 20:20 PDT, Eric Chou [:ericchou] [:echou]
no flags Details | Diff | Splinter Review

Description Eric Chou [:ericchou] [:echou] 2012-08-06 21:06:59 PDT
To connect with remote device on profile level, we need to get the rfcomm channel of target service beforehand.
Comment 1 Eric Chou [:ericchou] [:echou] 2012-08-07 00:12:16 PDT
Created attachment 649555 [details] [diff] [review]
v1: patch 1: Added function QueryServerChannel

Function QueryServerChannel() can be used to get the server channel of specific service on remote device. Note this function will not establish a connection with remote device, it only searches local database.
Comment 2 Eric Chou [:ericchou] [:echou] 2012-08-07 00:14:08 PDT
sorry, function name -> GetDeviceServiceChannel()
Comment 3 Kyle Machulis [:kmachulis] [:qdot] 2012-08-07 10:18:02 PDT
Comment on attachment 649555 [details] [diff] [review]
v1: patch 1: Added function QueryServerChannel

Review of attachment 649555 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/bluetooth/linux/BluetoothDBusService.cpp
@@ +1288,5 @@
> +int
> +BluetoothDBusService::GetDeviceServiceChannelInternal(const nsAString& aObjectPath,
> +                                                      const nsAString& aPattern,
> +                                                      int aAttributeId)
> +{

Nit: This blocks, so we should put a thread assertion check in to make sure it's not called from the main thread.

::: dom/bluetooth/linux/BluetoothDBusService.h
@@ +64,4 @@
>    RemoveServicesInternal(const nsAString& aAdapterPath,
>                           const nsTArray<PRUint32>& aServiceHandles);
>  
> +  virtual int 

Nit: Delete space at end of line
Comment 4 Eric Chou [:ericchou] [:echou] 2012-08-07 20:20:35 PDT
Created attachment 649944 [details] [diff] [review]
Final version: patch 1: Added function GetDeviceServiceChannel(), r=qDot

Nits picked.
Comment 5 Kyle Machulis [:kmachulis] [:qdot] 2012-08-07 21:20:24 PDT
https://hg.mozilla.org/integration/mozilla-inbound/rev/9e64393fa8c0
Comment 6 Ed Morley [:emorley] 2012-08-08 09:29:12 PDT
https://hg.mozilla.org/mozilla-central/rev/9e64393fa8c0

Note You need to log in before you can comment on or make changes to this bug.