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:
parent
da29158e89
commit
2187bac5f8
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue
Block a user