Giter VIP home page Giter VIP logo

pyccp's Introduction

Travis build server Test coverage report Maintainability grade

Maintainability issues GNU General Public License Any color you like

The CAN Calibration Protocol is a high-level CAN-bus protocol designed for calibration of and data acquisition from an electronic control unit (ECU). Via CCP, a master node can read internal variables or set configuration parameters in one or several slave devices.

CCP communication requires detailed information about the data layout in the slave device(s). This information is typically distributed in A2L-files, which are usually automatically generated when building the ECU firmware.

Example usage

import can
import pyccp
import logging
import time

# Configure logging of received messages
log = logging.getLogger("ccp_log")
log.basicConfig(filename="ccp.csv", level=logging.INFO, format="")

# Configure CAN-bus
bus = can.Bus(bustype="socketcan", channel="can0", bitrate=500000)

# Configure master node
master = pyccp.Master(transport=bus, cro_id=0x321, dto_id=0x7E1)

# Configure DAQ session
session = pyccp.DAQSession(
       master=master,
       station_address=0x37,
       )

# Specify some variables for logging
diff_pressure = pyccp.Element(
       name="diffP",
       size=4,
       address=0x4000AA56,
       scale=0.001,
       )
coolant_temp = pyccp.Element(
       name="cTemp",
       size=2,
       address=0x4000F090,
       is_signed=True,
       )

# Start DAQ session
session.initialize(elements=[diff_pressure, cooland_temp])
session.run()

# Log for 10 seconds
time.sleep(10)
session.stop()

Currently, information such as CAN IDs and memory addresses must be entered manually.

pyccp's People

Contributors

bessman avatar christoph2 avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Forkers

aaknitt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.