From 34200c18bed6d9eaab34cf1c84980a3568fa32d9 Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Sat, 16 May 2015 16:07:52 +0300 Subject: [PATCH] New logic of file.Read --- dsdl/uavcan/protocol/file/218.Read.uavcan | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/dsdl/uavcan/protocol/file/218.Read.uavcan b/dsdl/uavcan/protocol/file/218.Read.uavcan index c7a54724fa..b120a86301 100644 --- a/dsdl/uavcan/protocol/file/218.Read.uavcan +++ b/dsdl/uavcan/protocol/file/218.Read.uavcan @@ -1,11 +1,15 @@ # -# Read contents of the file from remote node. -# Empty data in response means that the offset is out of file boundaries. -# Non-empty data means the end of file is not reached yet, even if the length is less than maximum. +# Read file from a remote node. +# +# There are two possible outcomes of a successful service call: +# 1. Data array size equals its capacity. This means that the end of the file is not reached yet. +# 2. Data array size is less than its capacity, possibly zero. This means that the end of file is reached. +# # Thus, if the client needs to fetch the entire file, it should repeatedly call this service while increasing the -# offset, until the empty data is returned. +# offset, until incomplete data is returned. +# # If the object pointed by 'path' cannot be read (e.g. it is a directory or it does not exist), appropriate error code -# will be returned. +# will be returned, and data array will be empty. # uint32 offset @@ -14,4 +18,4 @@ Path path --- Error error -uint8[<=250] data +uint8[<=256] data