/usr/share/doc/python-can-doc/html/configuration.html is in python-can-doc 2.0.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Configuration — can 1.5.2 documentation</title>
<link rel="stylesheet" href="_static/alabaster.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.5.2',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Library API" href="api.html" />
<link rel="prev" title="Installation" href="installation.html" />
<link rel="stylesheet" href="_static/custom.css" type="text/css" />
<meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
</head>
<body>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body" role="main">
<div class="section" id="configuration">
<h1>Configuration<a class="headerlink" href="#configuration" title="Permalink to this headline">¶</a></h1>
<p>Usually this library is used with a particular CAN interface, this can be
specified in code, read from configuration files or environment variables.</p>
<p>See <a class="reference internal" href="api.html#can.util.load_config" title="can.util.load_config"><code class="xref py py-func docutils literal"><span class="pre">can.util.load_config()</span></code></a> for implementation.</p>
<div class="section" id="in-code">
<h2>In Code<a class="headerlink" href="#in-code" title="Permalink to this headline">¶</a></h2>
<p>The <code class="docutils literal"><span class="pre">can</span></code> object exposes an <code class="docutils literal"><span class="pre">rc</span></code> dictionary which can be used to set
the <strong>interface</strong> and <strong>channel</strong> before importing from <code class="docutils literal"><span class="pre">can.interfaces</span></code>.</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">can</span>
<span class="n">can</span><span class="o">.</span><span class="n">rc</span><span class="p">[</span><span class="s1">'interface'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'socketcan'</span>
<span class="n">can</span><span class="o">.</span><span class="n">rc</span><span class="p">[</span><span class="s1">'channel'</span><span class="p">]</span> <span class="o">=</span> <span class="s1">'vcan0'</span>
<span class="n">can</span><span class="o">.</span><span class="n">rc</span><span class="p">[</span><span class="s1">'bitrate'</span><span class="p">]</span> <span class="o">=</span> <span class="mi">500000</span>
<span class="kn">from</span> <span class="nn">can.interfaces.interface</span> <span class="k">import</span> <span class="n">Bus</span>
<span class="n">bus</span> <span class="o">=</span> <span class="n">Bus</span><span class="p">()</span>
</pre></div>
</div>
<p>You can also specify the interface and channel for each Bus instance:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">can</span>
<span class="n">bus</span> <span class="o">=</span> <span class="n">can</span><span class="o">.</span><span class="n">interface</span><span class="o">.</span><span class="n">Bus</span><span class="p">(</span><span class="n">bustype</span><span class="o">=</span><span class="s1">'socketcan'</span><span class="p">,</span> <span class="n">channel</span><span class="o">=</span><span class="s1">'vcan0'</span><span class="p">,</span> <span class="n">bitrate</span><span class="o">=</span><span class="mi">500000</span><span class="p">)</span>
</pre></div>
</div>
</div>
<div class="section" id="configuration-file">
<h2>Configuration File<a class="headerlink" href="#configuration-file" title="Permalink to this headline">¶</a></h2>
<p>On Linux systems the config file is searched in the following paths:</p>
<ol class="arabic simple">
<li><code class="docutils literal"><span class="pre">~/can.conf</span></code></li>
<li><code class="docutils literal"><span class="pre">/etc/can.conf</span></code></li>
<li><code class="docutils literal"><span class="pre">$HOME/.can</span></code></li>
<li><code class="docutils literal"><span class="pre">$HOME/.canrc</span></code></li>
</ol>
<p>On Windows systems the config file is searched in the following paths:</p>
<p>1. <code class="docutils literal"><span class="pre">~/can.conf</span></code>
1. <code class="docutils literal"><span class="pre">can.ini</span></code> (current working directory)
2. <code class="docutils literal"><span class="pre">$APPDATA/can.ini</span></code></p>
<p>The configuration file sets the default interface and channel:</p>
<div class="highlight-default"><div class="highlight"><pre><span></span><span class="p">[</span><span class="n">default</span><span class="p">]</span>
<span class="n">interface</span> <span class="o">=</span> <span class="o"><</span><span class="n">the</span> <span class="n">name</span> <span class="n">of</span> <span class="n">the</span> <span class="n">interface</span> <span class="n">to</span> <span class="n">use</span><span class="o">></span>
<span class="n">channel</span> <span class="o">=</span> <span class="o"><</span><span class="n">the</span> <span class="n">channel</span> <span class="n">to</span> <span class="n">use</span> <span class="n">by</span> <span class="n">default</span><span class="o">></span>
<span class="n">bitrate</span> <span class="o">=</span> <span class="o"><</span><span class="n">the</span> <span class="n">bitrate</span> <span class="ow">in</span> <span class="n">bits</span><span class="o">/</span><span class="n">s</span> <span class="n">to</span> <span class="n">use</span> <span class="n">by</span> <span class="n">default</span><span class="o">></span>
</pre></div>
</div>
</div>
<div class="section" id="environment-variables">
<h2>Environment Variables<a class="headerlink" href="#environment-variables" title="Permalink to this headline">¶</a></h2>
<p>Configuration can be pulled from these environmental variables:</p>
<blockquote>
<div><ul class="simple">
<li>CAN_INTERFACE</li>
<li>CAN_CHANNEL</li>
<li>CAN_BITRATE</li>
</ul>
</div></blockquote>
</div>
<div class="section" id="interface-names">
<h2>Interface Names<a class="headerlink" href="#interface-names" title="Permalink to this headline">¶</a></h2>
<p>Lookup table of interface names:</p>
<table border="1" class="docutils">
<colgroup>
<col width="36%" />
<col width="64%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">Name</th>
<th class="head">Documentation</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><code class="docutils literal"><span class="pre">"socketcan"</span></code></td>
<td><a class="reference internal" href="interfaces/socketcan.html"><span class="doc">Socketcan</span></a></td>
</tr>
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">"kvaser"</span></code></td>
<td><a class="reference internal" href="interfaces/kvaser.html"><span class="doc">Kvaser’s CANLIB</span></a></td>
</tr>
<tr class="row-even"><td><code class="docutils literal"><span class="pre">"serial"</span></code></td>
<td><a class="reference internal" href="interfaces/serial.html"><span class="doc">CAN over Serial</span></a></td>
</tr>
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">"slcan"</span></code></td>
<td><a class="reference internal" href="interfaces/slcan.html"><span class="doc">CAN over Serial / SLCAN</span></a></td>
</tr>
<tr class="row-even"><td><code class="docutils literal"><span class="pre">"ixxat"</span></code></td>
<td><a class="reference internal" href="interfaces/ixxat.html"><span class="doc">IXXAT Virtual CAN Interface</span></a></td>
</tr>
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">"pcan"</span></code></td>
<td><a class="reference internal" href="interfaces/pcan.html"><span class="doc">PCAN Basic API</span></a></td>
</tr>
<tr class="row-even"><td><code class="docutils literal"><span class="pre">"usb2can"</span></code></td>
<td><a class="reference internal" href="interfaces/usb2can.html"><span class="doc">USB2CAN Interface</span></a></td>
</tr>
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">"nican"</span></code></td>
<td><a class="reference internal" href="interfaces/nican.html"><span class="doc">NI-CAN</span></a></td>
</tr>
<tr class="row-even"><td><code class="docutils literal"><span class="pre">"iscan"</span></code></td>
<td><a class="reference internal" href="interfaces/iscan.html"><span class="doc">isCAN</span></a></td>
</tr>
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">"neovi"</span></code></td>
<td><a class="reference internal" href="interfaces/neovi.html"><span class="doc">neoVI Interface</span></a></td>
</tr>
<tr class="row-even"><td><code class="docutils literal"><span class="pre">"vector"</span></code></td>
<td><a class="reference internal" href="interfaces/vector.html"><span class="doc">Vector</span></a></td>
</tr>
<tr class="row-odd"><td><code class="docutils literal"><span class="pre">"virtual"</span></code></td>
<td><a class="reference internal" href="interfaces/virtual.html"><span class="doc">Virtual</span></a></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Configuration</a><ul>
<li><a class="reference internal" href="#in-code">In Code</a></li>
<li><a class="reference internal" href="#configuration-file">Configuration File</a></li>
<li><a class="reference internal" href="#environment-variables">Environment Variables</a></li>
<li><a class="reference internal" href="#interface-names">Interface Names</a></li>
</ul>
</li>
</ul>
<div class="relations">
<h3>Related Topics</h3>
<ul>
<li><a href="index.html">Documentation overview</a><ul>
<li>Previous: <a href="installation.html" title="previous chapter">Installation</a></li>
<li>Next: <a href="api.html" title="next chapter">Library API</a></li>
</ul></li>
</ul>
</div>
<div id="searchbox" style="display: none" role="search">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<div><input type="text" name="q" /></div>
<div><input type="submit" value="Go" /></div>
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="footer">
©2018, Brian Thorne et al..
|
Powered by <a href="http://sphinx-doc.org/">Sphinx 1.6.5</a>
& <a href="https://github.com/bitprophet/alabaster">Alabaster 0.7.8</a>
</div>
</body>
</html>
|