Skip to content

Commit

Permalink
Merge pull request #118 from messon007/master
Browse files Browse the repository at this point in the history
fix bug for nican driver and support nixnet candriver
  • Loading branch information
christoph2 committed Sep 19, 2022
2 parents 5571610 + 9926f55 commit 29f3ef4
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
20 changes: 20 additions & 0 deletions pyxcp/examples/conf_nixnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"TRANSPORT": "CAN",
"CAN_DRIVER": "NiXnet",
"CAN_USE_DEFAULT_LISTENER": true,
"CHANNEL": "CAN4",
"ACCEPT_VIRTUAL": true,
"BAUDRATE_PRESET": true,
"CAN_ID_MASTER": 1911,
"CAN_ID_SLAVE": 819,
"CAN_ID_BROADCAST": 256,
"MAX_DLC_REQUIRED": false,
"BITRATE": 500000,
"BTL_CYCLES": 16,
"SAMPLE_RATE": 1,
"SAMPLE_POINT": 87.5,
"SJW": 2,
"TSEG1": 5,
"TSEG2": 2,
"CREATE_DAQ_TIMESTAMPS": false
}
2 changes: 1 addition & 1 deletion pyxcp/transport/candriver/pc_nican.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class NiCan(python_can.PythonCAN, can.CanInterfaceBase):
}

PARAMETER_TO_KW_ARG_MAP = {
"LOG_ERRORS" "log_errors",
"LOG_ERRORS": "log_errors",
}

def __init__(self):
Expand Down
23 changes: 23 additions & 0 deletions pyxcp/transport/candriver/pc_nixnet.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
python-can driver for National Instruments xnet interfaces.
"""
import pyxcp.transport.can as can
import pyxcp.transport.candriver.python_can as python_can


class NiXnet(python_can.PythonCAN, can.CanInterfaceBase):
""""""

PARAMETER_MAP = {
# Type Req'd Default
"LOG_ERRORS": (bool, False, False),
}

PARAMETER_TO_KW_ARG_MAP = {
"LOG_ERRORS": "log_errors",
}

def __init__(self):
super(NiXnet, self).__init__(bustype="nixnet")

0 comments on commit 29f3ef4

Please sign in to comment.