From 2187bac5f8dae620c2ac3c0a72468081bea07c43 Mon Sep 17 00:00:00 2001 From: Joel Bender Date: Fri, 11 Nov 2016 00:14:46 -0500 Subject: [PATCH] use the new API --- py25/bacpypes/service/cov.py | 15 ++++++++------- py27/bacpypes/service/cov.py | 15 ++++++++------- py34/bacpypes/service/cov.py | 15 ++++++++------- 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/py25/bacpypes/service/cov.py b/py25/bacpypes/service/cov.py index fc612a8..21aa3a4 100644 --- a/py25/bacpypes/service/cov.py +++ b/py25/bacpypes/service/cov.py @@ -529,15 +529,16 @@ class ChangeOfValueServices(Capability): def cov_notification(self, cov, request): if _debug: ChangeOfValueServices._debug("cov_notification %s %s", str(cov), str(request)) - # send the request - iocb = self.request(request) + # create an IOCB with the request + iocb = IOCB(request) if _debug: ChangeOfValueServices._debug(" - iocb: %r", iocb) - # if this is confirmed, add a callback for the response, otherwise it - # was unconfirmed - if iocb: - iocb.cov = cov - iocb.add_callback(self.cov_confirmation) + # add a callback for the response, even if it was unconfirmed + iocb.cov = cov + iocb.add_callback(self.cov_confirmation) + + # send the request via the ApplicationIOController + self.request_io(iocb) def cov_confirmation(self, iocb): if _debug: ChangeOfValueServices._debug("cov_confirmation %r", iocb) diff --git a/py27/bacpypes/service/cov.py b/py27/bacpypes/service/cov.py index d8124f9..08bd497 100644 --- a/py27/bacpypes/service/cov.py +++ b/py27/bacpypes/service/cov.py @@ -527,15 +527,16 @@ class ChangeOfValueServices(Capability): def cov_notification(self, cov, request): if _debug: ChangeOfValueServices._debug("cov_notification %s %s", str(cov), str(request)) - # send the request - iocb = self.request(request) + # create an IOCB with the request + iocb = IOCB(request) if _debug: ChangeOfValueServices._debug(" - iocb: %r", iocb) - # if this is confirmed, add a callback for the response, otherwise it - # was unconfirmed - if iocb: - iocb.cov = cov - iocb.add_callback(self.cov_confirmation) + # add a callback for the response, even if it was unconfirmed + iocb.cov = cov + iocb.add_callback(self.cov_confirmation) + + # send the request via the ApplicationIOController + self.request_io(iocb) def cov_confirmation(self, iocb): if _debug: ChangeOfValueServices._debug("cov_confirmation %r", iocb) diff --git a/py34/bacpypes/service/cov.py b/py34/bacpypes/service/cov.py index 26a4f38..ccb4716 100644 --- a/py34/bacpypes/service/cov.py +++ b/py34/bacpypes/service/cov.py @@ -524,15 +524,16 @@ class ChangeOfValueServices(Capability): def cov_notification(self, cov, request): if _debug: ChangeOfValueServices._debug("cov_notification %s %s", str(cov), str(request)) - # send the request - iocb = self.request(request) + # create an IOCB with the request + iocb = IOCB(request) if _debug: ChangeOfValueServices._debug(" - iocb: %r", iocb) - # if this is confirmed, add a callback for the response, otherwise it - # was unconfirmed - if iocb: - iocb.cov = cov - iocb.add_callback(self.cov_confirmation) + # add a callback for the response, even if it was unconfirmed + iocb.cov = cov + iocb.add_callback(self.cov_confirmation) + + # send the request via the ApplicationIOController + self.request_io(iocb) def cov_confirmation(self, iocb): if _debug: ChangeOfValueServices._debug("cov_confirmation %r", iocb)