Closed
Bug 1027504
Opened 11 years ago
Closed 11 years ago
Implement BluetoothClassOfDevice
Categories
(Firefox OS Graveyard :: Bluetooth, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: ben.tian, Assigned: ben.tian)
References
Details
(Keywords: dev-doc-needed, Whiteboard: [webbt-api])
Attachments
(3 files, 7 obsolete files)
|
3.23 KB,
patch
|
Details | Diff | Splinter Review | |
|
3.49 KB,
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
|
8.74 KB,
patch
|
Details | Diff | Splinter Review |
BluetoothClassOfDevice: https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothClassOfDevice
| Assignee | ||
Updated•11 years ago
|
Summary: Imeplement BluetoothClassOfDevice → Implement BluetoothClassOfDevice
Whiteboard: [webbt-api]
| Assignee | ||
Comment 1•11 years ago
|
||
Assignee: nobody → btian
| Assignee | ||
Comment 2•11 years ago
|
||
| Assignee | ||
Comment 3•11 years ago
|
||
Attachment #8442708 -
Attachment is obsolete: true
| Assignee | ||
Comment 4•11 years ago
|
||
| Assignee | ||
Comment 5•11 years ago
|
||
Revise webidl comment.
Attachment #8442706 -
Attachment is obsolete: true
Comment 6•11 years ago
|
||
Hi Ben,
It's a minor patch to get uint32_t cod value from CoD class.
It can be removed after we replace all the code using uint32_t value.
| Assignee | ||
Comment 7•11 years ago
|
||
Attachment #8444204 -
Attachment is obsolete: true
| Assignee | ||
Comment 8•11 years ago
|
||
Integrate Jocelyn's change.
Attachment #8444195 -
Attachment is obsolete: true
Attachment #8449144 -
Attachment is obsolete: true
Attachment #8449202 -
Flags: review?(echou)
Attachment #8449202 -
Flags: review?(bzbarsky)
| Assignee | ||
Comment 9•11 years ago
|
||
Comment on attachment 8449200 [details] [diff] [review]
Patch 1/2 (v3): Add BluetoothClassOfDevice.webidl
Boris, please help review patches of BluetoothClassOfDevice [1] implementation. BluetoothClassOfDevice is used to provide information of remote device's capabilities [2].
2 patches in total:
1) IDL changes, including new BluetoothClassOfDevice.webidl.
2) BluetoothClassOfDevice implementation
[1] https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothClassOfDevice
[2] https://wiki.mozilla.org/B2G/Bluetooth/WebBluetooth-v2/BluetoothDevice#cod
Attachment #8449200 -
Flags: review?(bzbarsky)
Comment 10•11 years ago
|
||
Comment on attachment 8449200 [details] [diff] [review]
Patch 1/2 (v3): Add BluetoothClassOfDevice.webidl
Please make sure to qfold/squash this with the second patch before landing, since it doesn't compile on its own!
r=me
Attachment #8449200 -
Flags: review?(bzbarsky) → review+
Comment 11•11 years ago
|
||
Comment on attachment 8449202 [details] [diff] [review]
Patch 2/2 (v3): Implement BluetoothClassOfDevice
>+#define GET_MAJOR_SERVICE_CLASS(cod) ((cod & 0xffe000) >> 13)
Parens about "cod" please:
#define GET_MAJOR_SERVICE_CLASS(cod) (((cod) & 0xffe000) >> 13)
and similar for he other macros.
You need to hold a strong reference to mOwnerWindow and cycle collect it.
r=me with that fixed.
Attachment #8449202 -
Flags: review?(bzbarsky) → review+
| Assignee | ||
Comment 12•11 years ago
|
||
Attachment #8449202 -
Attachment is obsolete: true
Attachment #8449202 -
Flags: review?(echou)
Attachment #8451453 -
Flags: review?(echou)
| Assignee | ||
Comment 13•11 years ago
|
||
(In reply to Ben Tian [:btian] from comment #12)
> Created attachment 8451453 [details] [diff] [review]
> Patch 2/2 (v4): Implement BluetoothClassOfDevice, r=bz
Also revised macros in BluetoothProfileController based on bz's comment 11.
Comment 14•11 years ago
|
||
Comment on attachment 8451453 [details] [diff] [review]
Patch 2/2 (v4): Implement BluetoothClassOfDevice, r=bz
Review of attachment 8451453 [details] [diff] [review]:
-----------------------------------------------------------------
r=me with nits addressed. Thanks.
::: dom/bluetooth2/BluetoothClassOfDevice.cpp
@@ +31,5 @@
> + * https://www.bluetooth.org/en-us/specification/assigned-numbers/baseband
> + */
> +
> +// Bit 23 ~ Bit 13: Major service class
> +#define GET_MAJOR_SERVICE_CLASS(cod) (((cod) & 0xffe000) >> 13)
These macros are defined in both BluetoothClassOfDevice.cpp and BluetoothProfileController.h. Maybe we should put them somewhere such as BluetoothCommon.h or provide a static utility function in class BluetoothClassOfDevice for BluetoothProfileController to use.
::: dom/bluetooth2/BluetoothClassOfDevice.h
@@ +53,5 @@
> + /**
> + * Convert CoD to uint32_t CoD value.
> + *
> + * TODO: Remove this function once we replace uint32_t cod value with
> + BluetoothClassOfDevice in BluetoothProfileController.
super-nit: I would add a '*' which aligns with other '*' at the beginning of this line
Attachment #8451453 -
Flags: review?(echou) → review+
| Assignee | ||
Comment 15•11 years ago
|
||
Fix nit addressed by reviewer. For the macros, I prefer to reorganize them after we decide how to handle profile-related API.
Attachment #8451453 -
Attachment is obsolete: true
| Assignee | ||
Comment 16•11 years ago
|
||
Land qfold-ed patch onto b2g-inbound.
https://hg.mozilla.org/integration/b2g-inbound/rev/cff18929a775
Comment 17•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Updated•11 years ago
|
Keywords: dev-doc-needed
You need to log in
before you can comment on or make changes to this bug.
Description
•