Skip to content

Commit 7b22cac

Browse files
committed
Merge pull request #78 from openxc/next
Ready to release for new C5 additions
2 parents 0e0ca32 + 98352e3 commit 7b22cac

File tree

10 files changed

+672
-276
lines changed

10 files changed

+672
-276
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ env
1616
coverage.xml
1717
diffcover.html
1818
htmlcov
19+
*~

CHANGELOG.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
OpenXC Python Library Changelog
22
===============================
33

4+
v0.13.0
5+
----------
6+
7+
* Feature: Support for new C5 Cellular, SD, and RTC commands
8+
49
v0.12.0
510
-----------
611

CONTRIBUTING.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ Reporting an Issue
1212

1313
* Make sure you have a `GitHub account <https://github.com/signup/free>`_
1414
* Check if a ticket already exists for your issue on GitHub_.
15-
* If one does not already exist, `create a new ticket`__
16-
* Clearly describe the issue including steps to reproduce when it is a bug.
17-
* Make sure you include in the earliest version that you know has the issue.
15+
* If one does not already exist, `create a new ticket`__
16+
+ Clearly describe the issue including steps to reproduce when it is a bug.
17+
+ Make sure you include in the earliest version that you know has the issue.
1818

1919
__ GitHub_
2020

@@ -25,18 +25,18 @@ Making Changes
2525
fix or new feature.
2626
* Fork the repository on GitHub
2727
* Create a topic branch from where you want to base your work.
28-
* This is usually the master branch.
29-
* Only target release branches if you are certain your fix must be on that branch.
30-
* To quickly create a topic branch based on master; ``git checkout -b
31-
fix/master/my_contribution master``. Please avoid working directly on the
32-
``master`` branch.
28+
+ This is usually the master branch.
29+
+ Only target release branches if you are certain your fix must be on that branch.
30+
+ To quickly create a topic branch based on master:
31+
``git checkout -b fix/master/my_contribution master``
32+
+ Please avoid working directly on the ``master`` branch.
3333
* Make commits of logical units.
3434
* Check for unnecessary whitespace with `git diff --check` before committing.
3535
* Make sure your commit messages are in the `proper
3636
format <http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html>`_.
3737
* Make sure you have added the necessary tests for your changes
3838
* Run the `full test
39-
suite <https://github.com/openxc/openxc-python/blob/master/README_developers.mkd>`_
39+
suite <http://python.openxcplatform.com/en/master/contributing.html>`_
4040
to assure nothing else was accidentally broken.
4141

4242
Submitting Changes

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ OpenXC for Python
44

55
.. image:: /docs/_static/logo.png
66

7-
:Version: 0.12.0
7+
:Version: 0.13.0
88
:Web: http://openxcplatform.com
99
:Download: http://pypi.python.org/pypi/openxc/
1010
:Documentation: http://python.openxcplatform.com

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ OpenXC for Python
44

55
.. image:: /_static/logo.png
66

7-
:Version: 0.12.0
7+
:Version: 0.13.0
88
:Web: http://openxcplatform.com
99
:Download: http://pypi.python.org/pypi/openxc/
1010
:Documentation: http://python.openxcplatform.com

docs/tools/control.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,21 @@ Change the payload format to Protocol Buffers, then back to JSON:
6060
$ openxc-control set --new-payload-format json
6161
$ openxc-control set --new-payload-format protobuf
6262
63+
Change the time for the RTC unit on the C5 devices:
64+
65+
.. code-block:: bash
66+
67+
$ openxc-control set --time 1461545558
68+
69+
Set the host and port for the C5 Cellular device
70+
71+
.. code-block:: bash
72+
73+
$ openxc-control set --host www.server.com --port 80
74+
75+
This will return true when successful. If host is supplied, but not port,
76+
port will default to 80.
77+
6378
------
6479
write
6580
------
@@ -96,6 +111,21 @@ a message with a lower ID using the extended frame format, you can use the
96111
must allow writing the specific message that you request with
97112
``openxc-control``.
98113

114+
115+
---------------
116+
sd_mount_status
117+
---------------
118+
119+
This queries the device to see if the SD card is mounted correctly.
120+
121+
.. code-block:: bash
122+
123+
$ openxc-control sd_mount_status
124+
125+
This will return 'True' if the SD card is available for writing. Otherwise, it will return 'False'.
126+
127+
128+
99129
Command-line options
100130
====================
101131

openxc/controllers/base.py

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,32 @@ def set_payload_format(self, payload_format):
293293
self.format = payload_format
294294
return status
295295

296+
297+
def rtc_configuration(self, unix_time):
298+
"""Set the Unix time if RTC is supported on the device.
299+
300+
Returns True if the command was successful.
301+
"""
302+
request = {
303+
"command": "rtc_configuration",
304+
"unix_time": unix_time
305+
}
306+
status = self._check_command_response_status(request)
307+
return status
308+
309+
def modem_configuration(self, host, port):
310+
"""Set the host:port for the Cellular device to send data to.
311+
312+
Returns True if the command was successful.
313+
"""
314+
request = {
315+
"command": "modem_configuration",
316+
"host": host,
317+
"port": port
318+
}
319+
status = self._check_command_response_status(request)
320+
return status
321+
296322
def set_acceptance_filter_bypass(self, bus, bypass):
297323
"""Control the status of CAN acceptance filter for a bus.
298324
@@ -331,6 +357,18 @@ def version(self):
331357
}
332358
return self._check_command_response_message(request)
333359

360+
def sd_mount_status(self):
361+
"""Request for SD Mount status if available.
362+
"""
363+
request = {
364+
"command": "sd_mount_status"
365+
}
366+
responses = self.complex_request(request)
367+
result = None
368+
if len(responses) > 0:
369+
result = responses[0].get('status')
370+
return result
371+
334372
def device_id(self):
335373
"""Request the unique device ID of the attached VI.
336374
"""

0 commit comments

Comments
 (0)