#include <EchoLinkQso.h>
For an example usage, have a look at the code below. A connection is created to ourself. When the connection has been established the information message is automatically transmitted. Upon reception of the information message a disconnect is initiated. When the link has been disconnected the application exits.
#include <iostream> #include <AsyncCppApplication.h> #include <EchoLinkQso.h> using namespace std; using namespace Async; using namespace EchoLink; class MyClass : public SigC::Object { public: MyClass(void) { qso = new Qso(IpAddress("127.0.0.1"), "MYCALL", "MyName", "A test Qso"); if (!qso->initOk()) { delete qso; cerr << "Creation of Qso failed\n"; Application::app().quit(); return; } qso->infoMsgReceived.connect(slot(this, &MyClass::onInfoMsgReceived)); qso->stateChange.connect(slot(this, &MyClass::onStateChange)); qso->connect(); } ~MyClass(void) { delete qso; } private: Qso *qso; void onInfoMsgReceived(const string& msg) { cerr << "Info message received: " << msg << endl; qso->disconnect(); } void onStateChange(Qso::State state) { cerr << "State changed to "; switch (state) { case Qso::STATE_DISCONNECTED: cerr << "DISCONNECTED"; Application::app().quit(); break; case Qso::STATE_CONNECTING: cerr << "CONNECTING"; break; case Qso::STATE_CONNECTED: cerr << "CONNECTED"; break; default: break; } cout << endl; } }; int main(int argc, char **argv) { CppApplication app; // or QtApplication MyClass my_class; app.exec(); }
Definition at line 142 of file EchoLinkQso.h.
|
|
The type of the connection state.
Definition at line 159 of file EchoLinkQso.h. |
|
||||||||||||||||||||
|
Constructor.
|
|
|
Destructor.
|
|
|
Accept an incoming connection.
The difference between the connect and accept functions are that the accept function goes right into the connected state. The remote station is assumed to be present. This might not be true in some strange cases. In such a strange case, the connection will timeout after a while. |
|
|
Initiate a connection to the remote station.
|
|
|
Initiate a disconnection from the remote station.
|
|
|
Flush the audio send buffer so that all audio get transmitted.
|
|
|
Check that the initialization went ok.
Definition at line 190 of file EchoLinkQso.h. |
|
|
Find out if the connection is remotely initiated or locally initiated.
Definition at line 355 of file EchoLinkQso.h. |
|
|
Retrieve the local callsign.
Definition at line 203 of file EchoLinkQso.h. |
|
|
Retrieve the local station info.
Definition at line 229 of file EchoLinkQso.h. |
|
|
Retrieve the local name.
Definition at line 216 of file EchoLinkQso.h. |
|
|
Find out if there is audio coming in on this connection.
Definition at line 362 of file EchoLinkQso.h. |
|
|
Get the remote callsign.
Definition at line 346 of file EchoLinkQso.h. |
|
|
Get the IP address of the remote station.
Definition at line 289 of file EchoLinkQso.h. |
|
|
Get the remote name.
Definition at line 333 of file EchoLinkQso.h. |
|
||||||||||||
|
Send audio to the remote station.
|
|
|
Send a raw GSM audio packet to the remote station.
|
|
|
Send chat data to the remote station.
|
|
|
Send info data to the remote station.
|
|
|
Set the local callsign.
|
|
|
Set the local info.
|
|
|
Set the local name (name of station operator).
|
|
|
Set the callsign of the remote station.
Definition at line 339 of file EchoLinkQso.h. |
|
|
Set the name of the remote station.
Definition at line 326 of file EchoLinkQso.h. |
|
|
A signal that is emitted when an audio datagram has been received.
Definition at line 395 of file EchoLinkQso.h. |
|
|
A signal that is emitted when an audio datagram has been received.
Definition at line 406 of file EchoLinkQso.h. |
|
|
A signal that is emitted when a chat message is received.
Definition at line 374 of file EchoLinkQso.h. |
|
|
A signal that is emitted when a station info message is received.
Definition at line 368 of file EchoLinkQso.h. |
|
|
A signal that is emitted when the audio receive state changes.
Definition at line 388 of file EchoLinkQso.h. |
|
|
A signal that is emitted when the connection state changes.
Definition at line 380 of file EchoLinkQso.h. |
1.4.4