This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
This application generates a Who-Is request based on a timer, then lines up | |
the corresponding I-Am for incoming traffic and prints out the contents. | |
""" | |
import sys | |
from bacpypes.debugging import bacpypes_debugging, ModuleLogger |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
This sample application is a server that has a local, writable, Analog Value | |
and Binary Value object. | |
On a network with two IPv4 workstations make a copy of the BACpypes~.ini file | |
called in BACpypes.ini and set the 'address:' to the CIDR address of the | |
workstation. For example, the first one is 192.168.10.11/24 and the second | |
is 192.168.10.21/24. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Configured with a subscription context object which is passed to the | |
application, it sends a SubscribeCOVRequest and listens for confirmed or | |
unconfirmed COV notifications, lines them up with the context, and passes the | |
APDU to the context to print out. | |
Making multiple subscription contexts and keeping them active based on their | |
lifetime is left as an exercise for the reader. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
This sample application shows how to create analog value objects with | |
different values. | |
""" | |
import os | |
import random |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bacpypes.primitivedata import TagList | |
from bacpypes.basetypes import ( | |
DeviceObjectPropertyReference, | |
EventParameterAccessEventAccessEvent, | |
) | |
x = EventParameterAccessEventAccessEvent( | |
listOfAccessEvents=["deniedMaxAttempts"], | |
accessEventTimeReference=DeviceObjectPropertyReference( | |
objectIdentifier=("analogValue", 1), propertyIdentifier="presentValue" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Chips | |
""" | |
from typing import Any, List | |
_all_chips: List["Chip"] = [] | |
_all_wires: List["Wire"] = [] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
This application demonstrates doing something at a regular interval. | |
""" | |
import sys | |
from bacpypes.debugging import bacpypes_debugging, ModuleLogger | |
from bacpypes.consolelogging import ArgumentParser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
A web server based on flask that reads properties from objects and returns an | |
HTML page of the results. | |
""" | |
from flask import Flask | |
from jinja2 import Template | |
from threading import Thread |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
import asyncio | |
import signal | |
def ctrl_c(): | |
print("hit!") | |
sys.exit(1) | |
loop = asyncio.get_event_loop() | |
loop.add_signal_handler(signal.SIGINT, ctrl_c) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
This application generates a Who-Is request at startup and collects the I-Am | |
responses into a list, then reads various properties of the device objects, | |
then outputs the content as a JSON document. | |
""" | |
import sys | |
import json |