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 | |
""" | |
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
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 |
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
# -*- coding: utf-8 -*- | |
import sys | |
from io import BytesIO | |
from rdflib import Graph | |
from pyshacl.validate import Validator | |
data = b""" | |
@prefix bakery: <http://bakery.com/ns#> . |
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
""" | |
RPC server, aioamqp implementation of RPC examples from RabbitMQ tutorial | |
""" | |
import asyncio | |
import logging | |
import signal | |
import aioamqp | |
from aioamqp.protocol import AmqpProtocol |