Updated SpotClient to send local data at least once every 5 minutes

This commit is contained in:
Jordan Sherer 2019-03-25 09:52:35 -04:00
parent 14626978c0
commit 03bd44ae39
2 changed files with 5 additions and 2 deletions

View File

@ -52,8 +52,8 @@ void SpotClient::setLocalStation(QString callsign, QString grid, QString info, Q
changed = true; changed = true;
} }
if(changed){ // send local information to network on change, or once every 5 minutes
// send local information to network if(changed || m_seq % 5 == 0){
enqueueLocalSpot(callsign, grid, info, version); enqueueLocalSpot(callsign, grid, info, version);
} }
} }
@ -91,6 +91,8 @@ void SpotClient::processSpots(){
while(!m_queue.isEmpty()){ while(!m_queue.isEmpty()){
sendRawSpot(m_queue.dequeue()); sendRawSpot(m_queue.dequeue());
} }
m_seq++;
} }
void SpotClient::sendRawSpot(QByteArray payload){ void SpotClient::sendRawSpot(QByteArray payload){

View File

@ -25,6 +25,7 @@ public slots:
void dnsLookupResult(QHostInfo); void dnsLookupResult(QHostInfo);
private: private:
int m_seq;
QString m_call; QString m_call;
QString m_grid; QString m_grid;
QString m_info; QString m_info;