Comments (3)
It seems like there should be a way to go through the classes in the bacpypes.apdu.confirmed_request_types
dictionary items and see if the application has a matching method, then build the protocol services supported bit string from those. The same mechanism should also work for unconfirmed request types.
The twist on this is that there is no mapping between the class and the enumeration values of ServicesSupported
. For example, if WhoHasRequest
is the class and do_WhoHasRequest
is an implemented method, there needs to be something like this:
class WhoHasRequest(UnconfirmedRequestSequence):
serviceChoice = 7
serviceSupported = 'whoHas'
sequenceElements = \
[ Element('limits', WhoHasLimits, None, True)
, Element('object', WhoHasObject)
]
Nemine contradicente.
from bacpypes.
Rather then adding those statements to the confirmed and unconfirmed request classes, I decided to use the serviceChoice
to look up the correct bit name.
When building an application stack, the Application
class needs an instance of a DeviceObject
(usually a LocalDeviceObject
in the sample applications), and the device object doesn't know what services the application supports. So there is a new function get_services_supported()
of the application and the output of that is given to the device object.
I briefly experimented with the idea of modifying the device object inside the Application.__init__()
method but that seemed too intrusive. What if the application developer doesn't want that bit list created, but wanted the application to operate on just the information that it put in the device object?
The first iteration of the sample code is b54610f, and the next step is to update and test the rest of the samples.
from bacpypes.
I'm happy with the results, so I'm closing the issue and merging it into stage
.
from bacpypes.
Related Issues (20)
- Trouble routing from a modem to a server HOT 1
- Strange error in apdu.encode(xpdu) HOT 2
- Using MultipleReadProperty and YABE Room Simulator HOT 4
- Question on How to Make a Virtual BACnet Device that Doesn't Understand "Real" Values HOT 6
- Question regarding Max APDU HOT 2
- Help regarding writing to schedule object HOT 1
- AnalogOutput returns unrecognized-service when calling writeMultiple HOT 1
- [Question] Best practice to read/write points of multiple devices at the same IP address HOT 1
- Max APDU not segmenting correct HOT 1
- Potential Error in _parse_wp_args HOT 1
- inconsistent COV subscription response: noReponse vs timeout
- [Question] Proper BBMD.py usage HOT 3
- BACnet Services request notification
- asyncore removed from python 3.12 HOT 4
- Issue in dockerising an MSTP application using Misty and BACpypes HOT 1
- Problem with ConfirmedEventNotification in BACpypes Sample HOT 2
- BACnet device is not discoverable in Yabe HOT 4
- MAC Address from I-Am HOT 2
- Do we need to modify our code if we are prefering BACnet port as TCP over UDP? HOT 1
- Clearing / Releasing a priority HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bacpypes.