-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_bacapp2.py
More file actions
24 lines (22 loc) · 886 Bytes
/
Copy pathdebug_bacapp2.py
File metadata and controls
24 lines (22 loc) · 886 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import pyshark
capture = pyshark.FileCapture(
"tests/fixtures/bacnet/bacnet_discovery_session.pcap",
display_filter="bacapp",
use_json=True,
)
for packet in capture:
if hasattr(packet, "bacapp"):
bacapp = packet.bacapp
print(f"--- Frame {packet.number} ---")
if hasattr(bacapp, "objectidentifier"):
oid = bacapp.objectidentifier
print("objectidentifier repr:", repr(oid))
print("objectidentifier str:", str(oid))
if hasattr(bacapp, "property_identifier"):
pid = bacapp.property_identifier
print("property_identifier type:", type(pid))
print("property_identifier dir:", [a for a in dir(pid) if not a.startswith("_")])
if hasattr(bacapp, "confirmed_service"):
print("confirmed_service:", bacapp.confirmed_service)
print()
capture.close()