Bug 786596 - v1: get device type information. r=qdot, sr=mrbkap

This commit is contained in:
Gina Yeh 2012-08-30 11:15:35 +08:00
parent ebd9d07ef7
commit e1df45386c
3 changed files with 12 additions and 1 deletions

View File

@ -115,6 +115,8 @@ BluetoothDevice::SetPropertyByValue(const BluetoothNamedValue& aValue)
bs->GetDevicePath(mAdapterPath, mAddress, mPath);
} else if (name.EqualsLiteral("Class")) {
mClass = value.get_uint32_t();
} else if (name.EqualsLiteral("Icon")) {
mIcon = value.get_nsString();
} else if (name.EqualsLiteral("Connected")) {
mConnected = value.get_bool();
} else if (name.EqualsLiteral("Paired")) {
@ -221,6 +223,13 @@ BluetoothDevice::GetName(nsAString& aName)
return NS_OK;
}
NS_IMETHODIMP
BluetoothDevice::GetIcon(nsAString& aIcon)
{
aIcon = mIcon;
return NS_OK;
}
NS_IMETHODIMP
BluetoothDevice::GetDeviceClass(uint32_t* aClass)
{

View File

@ -68,6 +68,7 @@ private:
nsString mAdapterPath;
nsString mAddress;
nsString mName;
nsString mIcon;
uint32_t mClass;
bool mConnected;
bool mPaired;

View File

@ -6,11 +6,12 @@
#include "nsIDOMEventTarget.idl"
[scriptable, builtinclass, uuid(647bb64c-8d45-4642-b86b-b3b80d4c8c25)]
[scriptable, builtinclass, uuid(4a271533-6a09-4a65-ae2b-086794c7852c)]
interface nsIDOMBluetoothDevice : nsIDOMEventTarget
{
readonly attribute DOMString address;
readonly attribute DOMString name;
readonly attribute DOMString icon;
[binaryname(DeviceClass)] readonly attribute unsigned long class;
[implicit_jscontext] readonly attribute jsval uuids;
readonly attribute bool connected;