@@ -58,25 +58,25 @@ std::optional<std::pair<FrequencyRange, std::vector<Recording>>> Scheduler::getR
5858}
5959
6060void Scheduler::worker () {
61- m_remoteController.satellitesCallback (m_device.getName (), std::bind (&Scheduler::satellitesCallback , this , _1));
61+ m_remoteController.schedulerCallback (m_device.getName (), std::bind (&Scheduler::callback , this , _1));
6262 while (m_isRunning) {
6363 const auto now = getTime ();
6464 if (m_isRefreshEnabled && m_lastUpdateTime + UPDATE_INTERVAL <= now) {
65- satellitesQuery ();
65+ query ();
6666 m_lastUpdateTime = now;
6767 }
6868 std::this_thread::sleep_for (LOOP_TIMEOUT);
6969 }
7070}
7171
72- void Scheduler::satellitesQuery () {
73- Logger::info (LABEL, " send satellites query" );
74- const SatellitesQuery query (m_config.latitude (), m_config.longitude (), m_config.altitude (), m_config.apiKey (), m_device.satellites );
75- m_remoteController.satellitesQuery (m_device.getName (), static_cast <nlohmann::json>(query).dump ());
72+ void Scheduler::query () {
73+ Logger::info (LABEL, " send query" );
74+ const SchedulerQuery query (m_config.latitude (), m_config.longitude (), m_config.altitude (), m_config.apiKey (), m_device.satellites , m_device. crontabs );
75+ m_remoteController.schedulerQuery (m_device.getName (), static_cast <nlohmann::json>(query).dump ());
7676}
7777
78- void Scheduler::satellitesCallback (const nlohmann::json& json) {
79- Logger::info (LABEL, " received satellites : {}" , colored (GREEN, " {}" , json.dump ()));
78+ void Scheduler::callback (const nlohmann::json& json) {
79+ Logger::info (LABEL, " received response, size : {}" , colored (GREEN, " {}" , json.size ()));
8080 std::unique_lock lock (m_mutex);
8181 m_scheduledTransmissions = json;
8282}
0 commit comments