This repository has been archived by the owner on Apr 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 305
/
BluetoothDevice.cpp
154 lines (127 loc) · 3.15 KB
/
BluetoothDevice.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "BluetoothDevice.h"
#include "nsDOMClassInfo.h"
USING_BLUETOOTH_NAMESPACE
DOMCI_DATA(BluetoothDevice, BluetoothDevice)
NS_IMPL_CYCLE_COLLECTION_CLASS(BluetoothDevice)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(BluetoothDevice,
nsDOMEventTargetHelper)
NS_CYCLE_COLLECTION_TRAVERSE_EVENT_HANDLER(propertychanged)
NS_CYCLE_COLLECTION_TRAVERSE_EVENT_HANDLER(disconnectrequested)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(BluetoothDevice,
nsDOMEventTargetHelper)
NS_CYCLE_COLLECTION_UNLINK_EVENT_HANDLER(propertychanged)
NS_CYCLE_COLLECTION_UNLINK_EVENT_HANDLER(disconnectrequested)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(BluetoothDevice)
NS_INTERFACE_MAP_ENTRY(nsIDOMBluetoothDevice)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIDOMBluetoothDevice)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(BluetoothDevice)
NS_INTERFACE_MAP_END_INHERITING(nsDOMEventTargetHelper)
NS_IMPL_ADDREF_INHERITED(BluetoothDevice, nsDOMEventTargetHelper)
NS_IMPL_RELEASE_INHERITED(BluetoothDevice, nsDOMEventTargetHelper)
BluetoothDevice::BluetoothDevice()
{
}
nsresult
BluetoothDevice::GetAdapter(nsAString& aAdapter)
{
aAdapter = mAdapter;
return NS_OK;
}
nsresult
BluetoothDevice::GetAddress(nsAString& aAddress)
{
aAddress = mAddress;
return NS_OK;
}
nsresult
BluetoothDevice::GetName(nsAString& aName)
{
aName = mName;
return NS_OK;
}
nsresult
BluetoothDevice::GetClass(PRUint32* aClass)
{
*aClass = mClass;
return NS_OK;
}
nsresult
BluetoothDevice::GetConnected(bool* aConnected)
{
*aConnected = mConnected;
return NS_OK;
}
nsresult
BluetoothDevice::GetPaired(bool* aPaired)
{
*aPaired = mPaired;
return NS_OK;
}
nsresult
BluetoothDevice::GetLegacyPairing(bool* aLegacyPairing)
{
*aLegacyPairing = mLegacyPairing;
return NS_OK;
}
nsresult
BluetoothDevice::GetTrusted(bool* aTrusted)
{
*aTrusted = mTrusted;
return NS_OK;
}
nsresult
BluetoothDevice::SetTrusted(bool aTrusted)
{
mTrusted = aTrusted;
return NS_OK;
}
nsresult
BluetoothDevice::GetAlias(nsAString& aAlias)
{
aAlias = mAlias;
return NS_OK;
}
nsresult
BluetoothDevice::SetAlias(const nsAString& aAlias)
{
mAlias = aAlias;
return NS_OK;
}
nsresult
BluetoothDevice::GetUuids(jsval* aUuids)
{
//TODO: convert mUuids to jsval and assign to aUuids;
return NS_OK;
}
nsresult
BluetoothDevice::Disconnect()
{
return NS_OK;
}
nsresult
BluetoothDevice::GetProperties(jsval* aProperties)
{
return NS_OK;
}
nsresult
BluetoothDevice::SetProperty(const nsAString& aName, const nsAString& aValue)
{
return NS_OK;
}
nsresult
BluetoothDevice::DiscoverServices(const nsAString& aPattern, jsval* aServices)
{
return NS_OK;
}
nsresult
BluetoothDevice::CancelDiscovery()
{
return NS_OK;
}
NS_IMPL_EVENT_HANDLER(BluetoothDevice, propertychanged)
NS_IMPL_EVENT_HANDLER(BluetoothDevice, disconnectrequested)