1
0
mirror of https://github.com/JoelBender/bacpypes synced 2025-09-28 22:15:23 +08:00

use the new API

This commit is contained in:
Joel Bender 2016-11-11 00:14:46 -05:00
parent da29158e89
commit 2187bac5f8
3 changed files with 24 additions and 21 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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)