Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions canopen/sdo/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def block_download(self, data):
self.abort(0x05040001)

def init_download(self, request):
# TODO: Check if writable
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now I remember what this was for. Preferably we should check if it is writable before accepting segmented data. Right now a segmented download won't fail until the data has been fully received. So you can just leave the TODO for now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-added the comment

# TODO: Check if writable (now would fail on end of segmented downloads)
command, index, subindex = SDO_STRUCT.unpack_from(request)
self._index = index
self._subindex = subindex
Expand All @@ -136,7 +136,7 @@ def init_download(self, request):
size = 4 - ((command >> 2) & 0x3)
else:
size = 4
self.download(index, subindex, request[4:4 + size])
self._node.set_data(index, subindex, request[4:4 + size], check_writable=True)
else:
logger.info("Initiating segmented download for 0x%X:%d", index, subindex)
if command & SIZE_SPECIFIED:
Expand Down