// Copyright (c) Charles J. Cliffe // SPDX-License-Identifier: GPL-2.0+ #pragma once #include #include #include #include "IOThread.h" #include "SDRDeviceInfo.h" #include "AppConfig.h" #include #include #include #include class SDREnumerator: public IOThread { private: public: SDREnumerator(); ~SDREnumerator(); enum SDREnumState { SDR_ENUM_DEVICES_READY, SDR_ENUM_MESSAGE, SDR_ENUM_TERMINATED, SDR_ENUM_FAILED }; static std::vector *enumerate_devices(std::string remoteAddr = "", bool noInit=false); virtual void run(); static SoapySDR::Kwargs argsStrToKwargs(const std::string &args); static void addRemote(std::string remoteAddr); static void removeRemote(std::string remoteAddr); static std::vector &getRemotes(); static bool hasRemoteModule(); static void addManual(std::string factory, std::string params); static void removeManual(std::string factory, std::string params); static std::vector &getManuals(); static void setManuals(std::vector manuals); static void reset(); static std::vector &getFactories(); protected: static bool soapy_initialized, has_remote; static std::vector factories; static std::vector modules; static std::vector remotes; static std::map< std::string, std::vector > devs; static std::vector manuals; static std::mutex devs_busy; };