diff --git a/docs/protocol.rst b/docs/protocol.rst index 68c0526..5c38dce 100644 --- a/docs/protocol.rst +++ b/docs/protocol.rst @@ -65,28 +65,23 @@ follows. : B;set_led: Set LED brightness. @brightness: Brightness.\0 \0 -For more complex objects, like Tuples, Objects and Vectors, some more syntax is -needed to communicate their structure to the host. +For more complex objects, like Tuples and Vectors, some more syntax is needed +to communicate their structure to the host. -A Tuple type is encoded as a compound type, e.g., ``hB`` (a 16-bit integer and -a byte). It can be recognised by the absence of a space between the type -signatures. Note that a concatenated or nested Tuple type can not be recognised -from its signature, e.g., ``hB`` concatenated with ``ff`` is indistinguishable -from ``hBff``. - -An Object type is encoded as a compound type like a Tuple, but its type -signature is enclosed in parentheses ``(`` and ``)``, which makes it possible +A Tuple type is encoded as a compound type enclosed in parentheses ``(`` and +``)``, e.g., ``(hB)`` (a 16-bit integer and a byte). +The parentheses make it possible to communicate its structure to the host, e.g., the concatenation of ``(hB)`` -and ``(ff)`` is ``(hB)(ff)`` and the type signature of a nested Object may look +and ``(ff)`` is ``(hB)(ff)`` and the type signature of a nested Tuple may look like this ``((hB)(ff))``. A Vector type signature is enclosed in brackets ``[`` and ``]``. So a vector of 16-bit integers will have as type signature ``[h]``. -Finally, any arbitrary combination of Tuples, Objects and Vectors can be made, -resulting in type signatures like ``[((hB)f)]``, i.e., a Vector of Objects that -contain a Tuple of which the first element is an other Object ``(hB)`` and -the second element is a float ``f``. +Finally, any arbitrary combination of Tuples and Vectors can be made, resulting +in type signatures like ``[((hB)f)]``, i.e., a Vector of Tuples of which the +first element is an other Tuple ``(hB)`` and the second element is a float +``f``. Remote procedure calls @@ -99,9 +94,9 @@ parameters, their values are written to the I/O device. After the parameter values have been received, the device executes the method and writes its return value (if any) back to the I/O device. -All native C types (``int``, ``float``, ``double``, etc.), Tuples, Objects, -Vectors and any combination of these are currently supported. The host is -responsible for packing and unpacking of the values. +All native C types (``int``, ``float``, ``double``, etc.), Tuples, Vectors and +any combination of these are currently supported. The host is responsible for +packing and unpacking of the values. .. _struct: https://docs.python.org/3.5/library/struct.html#format-strings diff --git a/docs/usage.rst b/docs/usage.rst index 7fbdfab..6a7a615 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -173,8 +173,8 @@ Arbitrary combinations of these higher order objects can be made to construct complex objects. In the following example, we create a 2-dimensional matrix of integers, a -Vector of Tuples and an Object containing an integer, a Vector and an other -Object respectively. +Vector of Tuples and a Tuple containing an integer, a Vector and an other +Tuple respectively. .. code-block:: cpp @@ -182,10 +182,10 @@ Object respectively. Vector > v; - Object, Object > o; + Tuple, Tuple > t; -These objects can be used for parameters as well as for return values. Note -that these objects, like any higher order data structure should be passed by +These objects can be used as parameters as well as return values. Note that +these objects, like any higher order data structure should be passed by reference. diff --git a/tests/arduino-serial-fixture b/tests/arduino-serial-fixture index dc077fc..2dfbba3 160000 --- a/tests/arduino-serial-fixture +++ b/tests/arduino-serial-fixture @@ -1 +1 @@ -Subproject commit dc077fc5d9076e6d92ef99721e1e5081f22117d7 +Subproject commit 2dfbba300fe4b808b5672e7749e7c9e55f725979