#include <EchoLinkDirectory.h>
#include <iostream> #include <iomanip> #include <AsyncCppApplication.h> #include <EchoLinkDirectory.h> using namespace std; using namespace Async; using namespace EchoLink; class MyClass : public SigC::Object { public: MyClass(const string& mycall, const string& mypass) : mycall(mycall) { dir = new Directory("server1.echolink.org", mycall, mypass, "Testing..."); dir->statusChanged.connect(slot(this, &MyClass::onStatusChanged)); dir->stationListUpdated.connect( slot(this, &MyClass::onStationListUpdated)); dir->error.connect(slot(this, &MyClass::onError)); dir->makeBusy(); // Set status busy so noone think we are really online } ~MyClass(void) { delete dir; } private: string mycall; Directory * dir; void onStatusChanged(StationData::Status status) { cerr << "Status changed to " << StationData::statusStr(status) << endl; if (status == StationData::STAT_BUSY) { dir->getCalls(); } else { Application::app().quit(); } } void onStationListUpdated(void) { const list<StationData>& stations = dir->stations(); list<StationData>::const_iterator it; for (it = stations.begin(); it != stations.end(); ++it) { cerr << *it << endl; } cerr << endl << "Message:" << endl; cerr << dir->message() << endl; const StationData *mydata = dir->findCall(mycall); cerr << endl << "My station data:" << endl << *mydata << endl; dir->makeOffline(); } void onError(const string& msg) { cerr << "ERROR: " << msg << endl; Application::app().quit(); } }; int main(int argc, char **argv) { CppApplication app; // or QtApplication if (argc < 3) { cerr << "Usage: EchoLinkDispatcher_demo <callsign> <password>\n"; exit(1); } MyClass my_class(argv[1], argv[2]); app.exec(); }
Definition at line 124 of file EchoLinkDirectory.h.
|
||||||||||||||||||||
|
Constructor.
|
|
|
Destructor.
|
|
|
Get the callsign that is used when logging in to the server.
Definition at line 224 of file EchoLinkDirectory.h. |
|
|
Get a list of all active conferences.
Definition at line 286 of file EchoLinkDirectory.h. |
|
|
Get the description that is used when registering in the server.
Definition at line 252 of file EchoLinkDirectory.h. |
|
|
Find a callsign in the station list.
|
|
|
Find a station in the station list given a station ID.
|
|
||||||||||||||||
|
Find stations from their mapping code.
|
|
|
Get the station list from the directory server. Use this function to initiate a transfer of the station list from the directory server. When the list has been completely transfered the Directory::stationListUpdated signal will be emitted. If this function is called while a previous getCalls is in progress, the request will be ignored. After the transfer is done. There may be a server message to read. Get this message by using the Directory::message function. |
|
|
Get a list of all active links.
Definition at line 262 of file EchoLinkDirectory.h. |
|
|
Login to the directory server and set status to busy. Use this function to login to the directory server and set the status to busy. The registration will automatically be refreshed to keep the registration from timing out. |
|
|
Logout from the directory server.
|
|
|
Login to the directory server and set status to online. Use this function to login to the directory server and set the status to online. The registration will automatically be refreshed to keep the registration from timing out. |
|
|
Get the message returned by the directory server.
Definition at line 305 of file EchoLinkDirectory.h. |
|
|
Get the password that is used when logging in to the server.
Definition at line 236 of file EchoLinkDirectory.h. |
|
|
Refresh the current registration in the directory server.
Definition at line 170 of file EchoLinkDirectory.h. |
|
|
Get a list of all active repeasters.
Definition at line 272 of file EchoLinkDirectory.h. |
|
|
Get the name of the remote host.
Definition at line 212 of file EchoLinkDirectory.h. |
|
|
Set the callsign to use when logging in to the server.
|
|
|
Set the description to register in the server.
|
|
|
Set the password to use when logging in to the server.
|
|
|
Set the hostname or IP-address of the EchoLink server to use.
|
|
|
Get a list of all active "normal" stations.
Definition at line 295 of file EchoLinkDirectory.h. |
|
|
Return the current status of the registration.
Definition at line 176 of file EchoLinkDirectory.h. |
|
|
Return the current status of the registration in string representation.
Definition at line 183 of file EchoLinkDirectory.h. References EchoLink::StationData::statusStr(). |
|
|
A signal that is emitted when an error occurs.
Definition at line 351 of file EchoLinkDirectory.h. |
|
|
Definition at line 127 of file EchoLinkDirectory.h. |
|
|
A signal that is emitted when the station list has been updated.
Definition at line 345 of file EchoLinkDirectory.h. |
|
|
A signal that is emitted when the registration status changes.
Definition at line 340 of file EchoLinkDirectory.h. |
1.4.4