| 
									
										
										
										
											2018-08-27 21:19:38 -04:00
										 |  |  | #ifndef APRSISCLIENT_H
 | 
					
						
							|  |  |  | #define APRSISCLIENT_H
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <QTcpSocket>
 | 
					
						
							|  |  |  | #include <QQueue>
 | 
					
						
							|  |  |  | #include <QPair>
 | 
					
						
							|  |  |  | #include <QTimer>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | class APRSISClient : public QTcpSocket | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | public: | 
					
						
							|  |  |  |     APRSISClient(QString host, quint16 port, QObject *parent = nullptr); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     static quint32 hashCallsign(QString callsign); | 
					
						
							|  |  |  |     static QString loginFrame(QString callsign); | 
					
						
							|  |  |  |     static QPair<float, float> grid2deg(QString grid); | 
					
						
							|  |  |  |     static QPair<QString, QString> grid2aprs(QString grid); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     void setLocalStation(QString mycall, QString mygrid){ | 
					
						
							|  |  |  |         m_localCall = mycall; | 
					
						
							|  |  |  |         m_localGrid = mygrid; | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-30 15:01:43 -04:00
										 |  |  |     void enqueueSpot(QString theircall, QString grid, QString comment); | 
					
						
							| 
									
										
										
										
											2018-08-27 21:19:38 -04:00
										 |  |  |     void enqueueMessage(QString tocall, QString message); | 
					
						
							| 
									
										
										
										
											2018-08-28 15:13:38 -04:00
										 |  |  |     void enqueueThirdParty(QString theircall, QString payload); | 
					
						
							| 
									
										
										
										
											2018-08-27 21:19:38 -04:00
										 |  |  |     void enqueueRaw(QString aprsFrame); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-08-30 14:31:31 -04:00
										 |  |  |     void processQueue(bool disconnect=true); | 
					
						
							| 
									
										
										
										
											2018-08-27 21:19:38 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | public slots: | 
					
						
							|  |  |  |     void sendReports(){ processQueue(true); } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | private: | 
					
						
							|  |  |  |     QString m_localCall; | 
					
						
							|  |  |  |     QString m_localGrid; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     QQueue<QString> m_frameQueue; | 
					
						
							|  |  |  |     QString m_host; | 
					
						
							|  |  |  |     quint16 m_port; | 
					
						
							|  |  |  |     QTimer m_timer; | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif // APRSISCLIENT_H
 |