Skip to main content

Python module for working with SAE J1939 PGNs

Project description

Python SAE J1939 PGN

Python module for working with SAE J1939 PGNs.

Installation

pip install j1939_pgn

Dependencies

None

Usage examples

from J1939_PGN import J1939_PGN, J1939_PDU

# Init from PGN
j1939 = J1939_PGN(msg_pgn=60928)
print(j1939)

# Init from ID
j1939 = J1939_PGN(msg_id=16704256)
print(j1939)

# Compact use
print(f"ID: {J1939_PGN(msg_pgn=60928).id}")
print(f"PGN: {J1939_PGN(msg_id=16704256).pgn}")

# Access elements
j1939 = J1939_PGN(msg_id=16704256)
print(f"P:  {j1939.p}")
print(f"DP: {j1939.dp}")
print(f"PF: {j1939.pf}")
print(f"PS: {j1939.ps}")
print(f"SA: {j1939.sa}")

# Access specific elements
j1939 = J1939_PGN(msg_pgn=60928)
if j1939.pdu is J1939_PDU.PDU1:
    print(f"Target address: {j1939.ps:02X}")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

J1939_PGN-0.4.tar.gz (19.4 kB view hashes)

Uploaded Source

Built Distribution

J1939_PGN-0.4-py3-none-any.whl (8.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page