Skip to content

Commit 47051d5

Browse files
authored
implement feedback from Christian
1 parent 9b7fa31 commit 47051d5

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

canopen/sdo/server.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ def block_download(self, data):
123123
self.abort(0x05040001)
124124

125125
def init_download(self, request):
126-
# TODO: Check if writable
127126
command, index, subindex = SDO_STRUCT.unpack_from(request)
128127
self._index = index
129128
self._subindex = subindex
@@ -136,7 +135,7 @@ def init_download(self, request):
136135
size = 4 - ((command >> 2) & 0x3)
137136
else:
138137
size = 4
139-
self.download(index, subindex, request[4:4 + size])
138+
self._node.set_data(index, subindex, request[4:4 + size], check_writable=True)
140139
else:
141140
logger.info("Initiating segmented download for 0x%X:%d", index, subindex)
142141
if command & SIZE_SPECIFIED:
@@ -210,4 +209,4 @@ def download(self, index, subindex, data, force_segment=False):
210209
:raises canopen.SdoAbortedError:
211210
When node responds with an error.
212211
"""
213-
return self._node.set_data(index, subindex, data, check_writable=True)
212+
return self._node.set_data(index, subindex, data)

0 commit comments

Comments
 (0)