Commit a635abef authored by Quentin Muret's avatar Quentin Muret Committed by Andreas Traczyk

project: remove pollEvents

Change-Id: Id0faa141c00a3e91068f3e8314c8bb229a64b780
parent 59a86e87
......@@ -25,7 +25,6 @@
- (BOOL)initDaemon;
- (BOOL)startDaemon;
- (void)fini;
- (void)pollEvents;
- (void)connectivityChanged;
- (nonnull NSString*)getVersion;
@end
......@@ -73,17 +73,6 @@
}
}
- (void)pollEvents {
if (![[NSThread currentThread] isMainThread]) {
dispatch_sync(dispatch_get_main_queue(), ^{
DRing::pollEvents();
});
}
else {
DRing::pollEvents();
}
}
- (void)connectivityChanged {
if (![[NSThread currentThread] isMainThread]) {
dispatch_sync(dispatch_get_main_queue(), ^{
......
......@@ -92,7 +92,6 @@ class DaemonService {
if self.dRingAdaptor.initDaemon() {
log.debug("Daemon initialized.")
if self.dRingAdaptor.startDaemon() {
self.startRingServicePolling()
self.daemonStarted = true
log.debug("Daemon started.")
} else {
......@@ -125,23 +124,4 @@ class DaemonService {
self.dRingAdaptor.connectivityChanged()
}
// MARK: Private Core
/**
Initiates the timer scheduling the calls to the daemon poll event method. It then starts it.
*/
fileprivate func startRingServicePolling() {
self.pollingTimer = Timer.scheduledTimer(timeInterval: pollingTimeInterval,
target: self,
selector: #selector(self.pollFunction),
userInfo: nil,
repeats: true)
}
/**
Performs the call to the daemon pollEvents method each time the pollingTimer decides to.
This method must be @objc exposed to be called by the timer.
*/
@objc fileprivate func pollFunction() {
self.dRingAdaptor.pollEvents()
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment