Source code

Revision control

Other Tools

1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
* License, v. 2.0. If a copy of the MPL was not distributed with this
3
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5
#ifndef NSWIFIAPSCANNERDBUS_H_
6
#define NSWIFIAPSCANNERDBUS_H_
7
8
#include "nsCOMArray.h"
9
10
#define DBUS_API_SUBJECT_TO_CHANGE
11
#include <dbus/dbus.h>
12
#include <dbus/dbus-glib-lowlevel.h>
13
14
class nsWifiAccessPoint;
15
16
namespace mozilla {
17
18
class nsWifiScannerDBus final {
19
public:
20
explicit nsWifiScannerDBus(nsCOMArray<nsWifiAccessPoint>* aAccessPoints);
21
~nsWifiScannerDBus();
22
23
nsresult Scan();
24
25
private:
26
nsresult SendGetDevices();
27
nsresult SendGetDeviceType(const char* aPath);
28
nsresult SendGetAccessPoints(const char* aPath);
29
nsresult SendGetAPProperties(const char* aPath);
30
nsresult IdentifyDevices(DBusMessage* aMsg);
31
nsresult IdentifyDeviceType(DBusMessage* aMsg, const char* aDevicePath);
32
nsresult IdentifyAccessPoints(DBusMessage* aMsg);
33
nsresult IdentifyAPProperties(DBusMessage* aMsg);
34
nsresult StoreSsid(DBusMessageIter* aVariant, nsWifiAccessPoint* aAp);
35
nsresult SetMac(DBusMessageIter* aVariant, nsWifiAccessPoint* aAp);
36
nsresult GetDBusIterator(DBusMessage* aMsg, DBusMessageIter* aIterArray);
37
38
RefPtr<DBusConnection> mConnection;
39
nsCOMArray<nsWifiAccessPoint>* mAccessPoints;
40
};
41
42
} // namespace mozilla
43
44
#endif // NSWIFIAPSCANNERDBUS_H_