| 25 | const char* AGG_MODES_STR = "Off\0Low\0High\0"; |
| 26 | |
| 27 | class AirspyHFSourceModule : public ModuleManager::Instance { |
| 28 | public: |
| 29 | AirspyHFSourceModule(std::string name) { |
| 30 | this->name = name; |
| 31 | |
| 32 | sampleRate = 768000.0; |
| 33 | |
| 34 | handler.ctx = this; |
| 35 | handler.selectHandler = menuSelected; |
| 36 | handler.deselectHandler = menuDeselected; |
| 37 | handler.menuHandler = menuHandler; |
| 38 | handler.startHandler = start; |
| 39 | handler.stopHandler = stop; |
| 40 | handler.tuneHandler = tune; |
| 41 | handler.stream = &stream; |
| 42 | |
| 43 | refresh(); |
| 44 | |
| 45 | selectFirst(); |
| 46 | |
| 47 | sigpath::sourceManager.registerSource("SDDC", &handler); |
| 48 | } |
| 49 | |
| 50 | ~AirspyHFSourceModule() { |
| 51 | stop(this); |
| 52 | sigpath::sourceManager.unregisterSource("SDDC"); |
| 53 | } |
| 54 | |
| 55 | void postInit() {} |
| 56 | |
| 57 | void enable() { |
| 58 | enabled = true; |
| 59 | } |
| 60 | |
| 61 | void disable() { |
| 62 | enabled = false; |
| 63 | } |
| 64 | |
| 65 | bool isEnabled() { |
| 66 | return enabled; |
| 67 | } |
| 68 | |
| 69 | void refresh() { |
| 70 | devListTxt = ""; |
| 71 | |
| 72 | devCount = sddc_get_device_count(); |
| 73 | for (int i = 0; i < devCount; i++) { |
| 74 | // Open device |
| 75 | sddc_t* dev = sddc_open(i, "../sddc_source/res/firmwares/SDDC_FX3.img"); |
| 76 | if (dev == NULL) { continue; } |
| 77 | |
| 78 | // Get device name (check if implemented) |
| 79 | const char* name = sddc_get_hw_model_name(dev); |
| 80 | if (name == NULL) { |
| 81 | sddc_close(dev); |
| 82 | continue; |
| 83 | } |
| 84 |
nothing calls this directly
no outgoing calls
no test coverage detected