Closed Bug 1027504 Opened 11 years ago Closed 11 years ago

Implement BluetoothClassOfDevice

Categories

(Firefox OS Graveyard :: Bluetooth, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

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)

Summary: Imeplement BluetoothClassOfDevice → Implement BluetoothClassOfDevice
Whiteboard: [webbt-api]
Assignee: nobody → btian
Attachment #8442708 - Attachment is obsolete: true
Revise webidl comment.
Attachment #8442706 - Attachment is obsolete: true
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.
Attachment #8444204 - Attachment is obsolete: true
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)
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 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 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+
Attachment #8449202 - Attachment is obsolete: true
Attachment #8449202 - Flags: review?(echou)
Attachment #8451453 - Flags: review?(echou)
(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 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+
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
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Keywords: dev-doc-needed
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: