nsWifiScannerDBus.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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. #ifndef NSWIFIAPSCANNERDBUS_H_
  5. #define NSWIFIAPSCANNERDBUS_H_
  6. #include "nsCOMArray.h"
  7. #define DBUS_API_SUBJECT_TO_CHANGE
  8. #include <dbus/dbus.h>
  9. #include "mozilla/ipc/DBusConnectionRefPtr.h"
  10. class nsWifiAccessPoint;
  11. namespace mozilla {
  12. class nsWifiScannerDBus final
  13. {
  14. public:
  15. explicit nsWifiScannerDBus(nsCOMArray<nsWifiAccessPoint>* aAccessPoints);
  16. ~nsWifiScannerDBus();
  17. nsresult Scan();
  18. private:
  19. nsresult SendMessage(const char* aInterface,
  20. const char* aPath,
  21. const char* aFuncCall);
  22. nsresult IdentifyDevices(DBusMessage* aMsg);
  23. nsresult IdentifyDeviceType(DBusMessage* aMsg, const char* aDevicePath);
  24. nsresult IdentifyAccessPoints(DBusMessage* aMsg);
  25. nsresult IdentifyAPProperties(DBusMessage* aMsg);
  26. nsresult StoreSsid(DBusMessageIter* aVariant, nsWifiAccessPoint* aAp);
  27. nsresult SetMac(DBusMessageIter* aVariant, nsWifiAccessPoint* aAp);
  28. nsresult GetDBusIterator(DBusMessage* aMsg, DBusMessageIter* aIterArray);
  29. RefPtr<DBusConnection> mConnection;
  30. nsCOMArray<nsWifiAccessPoint>* mAccessPoints;
  31. };
  32. } // mozilla
  33. #endif // NSWIFIAPSCANNERDBUS_H_