Skip to content

Commit

Permalink
docs: fix description of start/stop charge packets
Browse files Browse the repository at this point in the history
  • Loading branch information
kroimon committed Nov 8, 2023
1 parent 8291d3a commit 41d98dd
Showing 1 changed file with 68 additions and 71 deletions.
139 changes: 68 additions & 71 deletions docs/protocol.rst
Original file line number Diff line number Diff line change
Expand Up @@ -386,53 +386,50 @@ Example packets
^^^^^^^^^^^^^^^
::

> 0F-05-01-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-15 startCharge(1)
> 0F-05-01-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-15 startCharge(0)
< 0F-05-01-F0-FF-FF-00-00-00-00-00-00-00-00-00-00-00-00-00-03
> 0F-05-02-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-16 startCharge(2)
> 0F-05-02-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-16 startCharge(1)
< 0F-05-02-F0-FF-FF-00-00-00-00-00-00-00-00-00-00-00-00-00-04
> 0F-05-03-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-17 startCharge(3)
< 0F-05-03-F0-FF-FF-00-00-00-00-00-00-00-00-00-00-00-00-00-05
> 0F-05-04-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-18 startCharge(4)
> 0F-05-04-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-18 startCharge(2)
< 0F-05-04-F0-FF-FF-00-00-00-00-00-00-00-00-00-00-00-00-00-06
> 0F-05-08-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-1C startCharge(3)
< 0F-05-08-F0-FF-FF-00-00-00-00-00-00-00-00-00-00-00-00-00-0A

Request
^^^^^^^

.. warning::
Channels are indexed from 1 to 4 (instead of 0 to 3) in this command!

+------------+-----------------------------------------------------+----------------------------------+
| Byte Index | Example packet (hex) | Description |
+============+=====================================================+==================================+
| 0 | ``0F`` | Packet start byte, always 0x0F |
+------------+-----------------------------------------------------+----------------------------------+
| 1 | ``05`` | Command (0x05 = 5) |
+------------+-----------------------------------------------------+----------------------------------+
| 2 | ``01`` | Channel (between 1 and 4) |
+------------+-----------------------------------------------------+----------------------------------+
| 3-19 | ``00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00`` | Empty |
+------------+-----------------------------------------------------+----------------------------------+
| 20 | ``15`` | Checksum (sum of previous bytes) |
+------------+-----------------------------------------------------+----------------------------------+
+------------+-----------------------------------------------------+------------------------------------+
| Byte Index | Example packet (hex) | Description |
+============+=====================================================+====================================+
| 0 | ``0F`` | Packet start byte, always 0x0F |
+------------+-----------------------------------------------------+------------------------------------+
| 1 | ``05`` | Command (0x05 = 5) |
+------------+-----------------------------------------------------+------------------------------------+
| 2 | ``01`` | Channels (4 bits, one per channel) |
+------------+-----------------------------------------------------+------------------------------------+
| 3-19 | ``00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00`` | Empty |
+------------+-----------------------------------------------------+------------------------------------+
| 20 | ``15`` | Checksum (sum of previous bytes) |
+------------+-----------------------------------------------------+------------------------------------+

Response
^^^^^^^^

+------------+--------------------------------------------+----------------------------------+
| Byte Index | Example packet (hex) | Description |
+============+============================================+==================================+
| 0 | ``0F`` | Packet start byte, always 0x0F |
+------------+--------------------------------------------+----------------------------------+
| 1 | ``05`` | Command (0x05 = 5) |
+------------+--------------------------------------------+----------------------------------+
| 2 | ``01`` | Channel (between 1 and 4) |
+------------+--------------------------------------------+----------------------------------+
| 3-5 | ``F0-FF-FF`` | Unknown |
+------------+--------------------------------------------+----------------------------------+
| 6-19 | ``00-00-00-00-00-00-00-00-00-00-00-00-00`` | Empty |
+------------+--------------------------------------------+----------------------------------+
| 20 | ``03`` | Checksum (sum of previous bytes) |
+------------+--------------------------------------------+----------------------------------+
+------------+--------------------------------------------+------------------------------------+
| Byte Index | Example packet (hex) | Description |
+============+============================================+====================================+
| 0 | ``0F`` | Packet start byte, always 0x0F |
+------------+--------------------------------------------+------------------------------------+
| 1 | ``05`` | Command (0x05 = 5) |
+------------+--------------------------------------------+------------------------------------+
| 2 | ``01`` | Channels (4 bits, one per channel) |
+------------+--------------------------------------------+------------------------------------+
| 3-5 | ``F0-FF-FF`` | Unknown |
+------------+--------------------------------------------+------------------------------------+
| 6-19 | ``00-00-00-00-00-00-00-00-00-00-00-00-00`` | Empty |
+------------+--------------------------------------------+------------------------------------+
| 20 | ``03`` | Checksum (sum of previous bytes) |
+------------+--------------------------------------------+------------------------------------+


Stop Charging
Expand All @@ -442,47 +439,47 @@ Example packets
^^^^^^^^^^^^^^^
::

> 0F-FE-01-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-0E stopCharge(1)
> 0F-FE-01-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-0E stopCharge(0)
< 0F-FE-01-F0-FF-FF-00-00-00-00-00-00-00-00-00-00-00-00-00-FC
> 0F-FE-02-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-0F stopCharge(2)
> 0F-FE-03-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-10 stopCharge(3)
> 0F-FE-04-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-11 stopCharge(4)
> 0F-FE-02-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-0F stopCharge(1)
< 0F-FE-02-F0-FF-FF-00-00-00-00-00-00-00-00-00-00-00-00-00-FD
> 0F-FE-04-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-11 stopCharge(2)
< 0F-FE-04-F0-FF-FF-00-00-00-00-00-00-00-00-00-00-00-00-00-FF
> 0F-FE-08-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-15 stopCharge(3)
< 0F-FE-08-F0-FF-FF-00-00-00-00-00-00-00-00-00-00-00-00-00-03

Request
^^^^^^^

.. warning::
Channels are indexed from 1 to 4 (instead of 0 to 3) in this command!

+------------+-----------------------------------------------------+----------------------------------+
| Byte Index | Example packet (hex) | Description |
+============+=====================================================+==================================+
| 0 | ``0F`` | Packet start byte, always 0x0F |
+------------+-----------------------------------------------------+----------------------------------+
| 1 | ``FE`` | Command (0xFE = 254) |
+------------+-----------------------------------------------------+----------------------------------+
| 2 | ``01`` | Channel (between 1 and 4) |
+------------+-----------------------------------------------------+----------------------------------+
| 3-19 | ``00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00`` | Empty |
+------------+-----------------------------------------------------+----------------------------------+
| 20 | ``0E`` | Checksum (sum of previous bytes) |
+------------+-----------------------------------------------------+----------------------------------+
+------------+-----------------------------------------------------+------------------------------------+
| Byte Index | Example packet (hex) | Description |
+============+=====================================================+====================================+
| 0 | ``0F`` | Packet start byte, always 0x0F |
+------------+-----------------------------------------------------+------------------------------------+
| 1 | ``FE`` | Command (0xFE = 254) |
+------------+-----------------------------------------------------+------------------------------------+
| 2 | ``01`` | Channels (4 bits, one per channel) |
+------------+-----------------------------------------------------+------------------------------------+
| 3-19 | ``00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00`` | Empty |
+------------+-----------------------------------------------------+------------------------------------+
| 20 | ``0E`` | Checksum (sum of previous bytes) |
+------------+-----------------------------------------------------+------------------------------------+

Response
^^^^^^^^

+------------+--------------------------------------------+----------------------------------+
| Byte Index | Example packet (hex) | Description |
+============+============================================+==================================+
| 0 | ``0F`` | Packet start byte, always 0x0F |
+------------+--------------------------------------------+----------------------------------+
| 1 | ``FE`` | Command (0x05 = 5) |
+------------+--------------------------------------------+----------------------------------+
| 2 | ``01`` | Channel (between 1 and 4) |
+------------+--------------------------------------------+----------------------------------+
| 3-5 | ``F0-FF-FF`` | Unknown |
+------------+--------------------------------------------+----------------------------------+
| 6-19 | ``00-00-00-00-00-00-00-00-00-00-00-00-00`` | Empty |
+------------+--------------------------------------------+----------------------------------+
| 20 | ``FC`` | Checksum (sum of previous bytes) |
+------------+--------------------------------------------+----------------------------------+
+------------+--------------------------------------------+------------------------------------+
| Byte Index | Example packet (hex) | Description |
+============+============================================+====================================+
| 0 | ``0F`` | Packet start byte, always 0x0F |
+------------+--------------------------------------------+------------------------------------+
| 1 | ``FE`` | Command (0x05 = 5) |
+------------+--------------------------------------------+------------------------------------+
| 2 | ``01`` | Channels (4 bits, one per channel) |
+------------+--------------------------------------------+------------------------------------+
| 3-5 | ``F0-FF-FF`` | Unknown |
+------------+--------------------------------------------+------------------------------------+
| 6-19 | ``00-00-00-00-00-00-00-00-00-00-00-00-00`` | Empty |
+------------+--------------------------------------------+------------------------------------+
| 20 | ``FC`` | Checksum (sum of previous bytes) |
+------------+--------------------------------------------+------------------------------------+

0 comments on commit 41d98dd

Please sign in to comment.