diff options
author | Javier <dev.git@javispedro.com> | 2016-01-01 22:05:42 +0100 |
---|---|---|
committer | Javier <dev.git@javispedro.com> | 2016-01-01 22:05:42 +0100 |
commit | a45977185a485624095bff1a15024e9199eee676 (patch) | |
tree | 6cc57d085bdd01e493477c870dbe0548137998e1 /notificationagent.cc | |
parent | a24034bdfea259cdc09c74217be75d4f9de0dce5 (diff) | |
download | sapd-a45977185a485624095bff1a15024e9199eee676.tar.gz sapd-a45977185a485624095bff1a15024e9199eee676.zip |
reorganize source files into SAP and agents
Diffstat (limited to 'notificationagent.cc')
-rw-r--r-- | notificationagent.cc | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/notificationagent.cc b/notificationagent.cc deleted file mode 100644 index 58d27d4..0000000 --- a/notificationagent.cc +++ /dev/null @@ -1,57 +0,0 @@ -#include "sapsocket.h" -#include "sapconnectionrequest.h" -#include "sapserviceinfo.h" -#include "sapchannelinfo.h" -#include "notificationconn.h" -#include "notificationagent.h" - -static NotificationAgent *agent = 0; -static const QLatin1String notification_profile("/system/NotificationService"); - -NotificationAgent::NotificationAgent(QObject *parent) - : QObject(parent), _peer(0), _socket(0) -{ -} - -NotificationAgent* NotificationAgent::instance() -{ - if (!agent) { - agent = new NotificationAgent; - } - return agent; -} - -void NotificationAgent::peerFound(SAPPeer *peer) -{ - Q_UNUSED(peer); -} - -void NotificationAgent::requestConnection(SAPConnectionRequest *request) -{ - qDebug() << "Notification request connection from" << request->peer()->peerName(); - SAPConnection *conn = request->connection(); - new NotificationConn(conn, this); - - request->accept(); -} - -void NotificationAgent::registerServices(SAPManager *manager) -{ - SAPServiceInfo service; - SAPChannelInfo channel; - - service.setProfile(notification_profile); - service.setFriendlyName("Notification"); - service.setRole(SAPServiceInfo::RoleProvider); - service.setVersion(1, 0); - service.setConnectionTimeout(0); - - channel.setChannelId(104); - channel.setPayloadType(SAPChannelInfo::PayloadBinary); - channel.setQoSType(SAPChannelInfo::QoSReliabilityDisable); - channel.setQoSDataRate(SAPChannelInfo::QoSDataRateLow); - channel.setQoSPriority(SAPChannelInfo::QoSPriorityLow); - service.addChannel(channel); - - manager->registerServiceAgent(service, instance()); -} |