Skip to content

Commit 6f23c3a

Browse files
committed
Updated documentation for issue #29
1 parent c0db7a0 commit 6f23c3a

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

doc/source/udsoncan/client.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,8 @@ Methods by services
403403

404404
.. automethod:: udsoncan.client.Client.write_data_by_identifier
405405

406+
.. note:: If the DID Codec that is written is defined with a pack string (default codec), multiple values may be passed with a tuple.
407+
406408
-------------
407409

408410
:ref:`WriteMemoryByAddress<WriteMemoryByAddress>`

udsoncan/services/WriteDataByIdentifier.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ def make_request(cls, did, value, didconfig):
2222
:param did: The data identifier to write
2323
:type did: int
2424
25-
:param value: Value given to the :ref:`DidCodec <DidCodec>`.encode method
25+
:param value: Value given to the :ref:`DidCodec <DidCodec>`.encode method. If involved codec is defined with a pack string (default codec), multiple values may be passed with a tuple.
2626
:type value: object
2727
2828
:param didconfig: Definition of DID codecs. Dictionary mapping a DID (int) to a valid :ref:`DidCodec <DidCodec>` class or pack/unpack string
@@ -39,7 +39,7 @@ def make_request(cls, did, value, didconfig):
3939
req.data = struct.pack('>H', did) # encode DID number
4040
codec = DidCodec.from_config(didconfig[did])
4141
if codec.__class__ == DidCodec and isinstance(value, tuple):
42-
req.data += codec.encode(*value)
42+
req.data += codec.encode(*value) # Fixes issue #29
4343
else:
4444
req.data += codec.encode(value)
4545

0 commit comments

Comments
 (0)