* Some code improvements in ser/deser code wrt passing data size
to cycdeserbase class.
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
* Move adjusting deserialisation limit in cycdeserbase to line where
data pointer is moved.
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
* Validation in Deserializer
Added validation in CDR deserialization: max buffer length is checked
when deserializing fields and strings are checked for null-terminator
(except for wstrings, which are serialized without null-terminator).
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
* Catch exceptions in serdata functions
In serdata functions rmw_print, rmw_to_sample and rmw_from_sample
catch exceptions so that correct return code is given when functions
are called from ddsi.
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
* Improve deserialisation validation
Refactored the deserialisation validation functions so that sequence
length is checked more properly and protection against overflows.
Renamed source files for exceptions so that it conforms to ros2 /
google c++ style guide.
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
* Implemented byte-swapping in deserializer
Set the correct endianness flag when serializing ROS messages to CDR
and added support for byte-swapping in CDR deserializer when in a
mixed-endian network.
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
* Fix float deser byte-swap and add byte-swap in cycprint
Fixed the byte-swapping in float/double deserialization and added byte-
swapping in cycprint by creating a cycdeserbase that is shared with
cycdeser.
Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
This commit adds stubs for the missing functions and fixes a few bugs in
the serialisation code and topic creation. With these changes, the
talker and listener demos of ROS2 Crystal Clemmys work.
The changes in this commit make it compile with ROS2 Crystal Clemmys and
current Cyclone DDS. The RMW interface of ROS2 was modified in some
ways and extended in some other ways since Bouncy Bolson; and similarly,
Cyclone now has a somewhat reasonable interface for custom sample
representations and serialization, but the code in this commit probably
contains mistakes in using it.
Therefore, the expectation should be that this doesn't actually work
just yet, though it probably is quite close. As the old state wouldn't
build at all with any version of Cyclone DDS except the early commits,
this is significant progress already.