Skip to main content

A Python32 implementation of the RP1210C standard.

Project description

pip install rp1210

A Python module for interacting with RP1210 adapter drivers, following the RP1210C standard. Contributions welcome!

This module was written and tested with Python 3.9, 32-bit. Older Python versions have not been tested and may not be supported. 32-bit Python is required because RP1210 drivers are all 32-bit, and can thus only be loaded with 32-bit Python. A 64-bit implementation via MSL-LoadLib is planned and may be released as a separate module.

This module is currently in alpha, and changes to core functionality may happen. Not all aspects of the RP1210C standard are implemented. Currently, my focus is on J1939 communication. Other protocols have significantly less support.

While I try to provide adequate documentation, the RP1210C standard is owned by TMC, not me, and is not reproduced here. For a complete understanding of the RP1210 standard, you must purchase and read the official RP1210C documentation from TMC.

Official RP1210C documentation can be purchased from TMC at this link ($37.50 at time of writing): https://www.atabusinesssolutions.com/Shopping/Product/viewproduct/2675472/TMC-Individual-RP

Examples

# importing modules
from RP1210 import RP1210, J1939, Commands
# get available API names
api_names = RP1210.getAPINames()
# load information from an RP1210 config file
nexiq_api_name = "NULN2R32" # or use values from RP1210.getAPINames()
# load from config file
nexiq = RP1210.RP1210Config(nexiq_api_name)
# read properties
nexiq_description = nexiq.getDescription()
nexiq_device_ids = nexiq.getDevices()
# access an API through RP1210Config
clientID = nexiq.api.ClientConnect(nexiq_device_ids[0], b"J1939:Baud=500")
...
# access an API directly (without RP1210Config)
api_names = RP1210.getAPINames()
api_name = api_names[0]
api = RP1210.RP1210API(api_name)
clientID = api.ClientConnect(...)
...
# using RP1210C.Commands to help w/ claiming a J1939 address
... # assume api has been initalized and ClientConnect has been called
my_address = 42
my_network_mgt_name = 0xDEADBEEF

# generate params
cmd_num = Commands.COMMAND_IDS["PROTECT_J1939_ADDRESS"] # == 19
cmd_data = Commands.protectJ1939Address(my_address, my_network_mgt_name)
# call SendCommand
err_code = nexiq.api.SendCommand(cmd_num, clientID, cmd_data)

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

RP1210-0.0.2-py3-none-any.whl (19.3 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