Commit be9c56d
authored
Disregard OD variable description in SdoClient.upload() (#592)
* Disregard OD variable description in SdoClient.upload().
The upload method should behave as a raw producer of byte data.
Interpretation of the returned data based on the Object Dictionary is
the responsibility of the SdoVariable class, which delegates to the
generic ODVariable decoding functions.
Move the data truncation to the method SdoVariable.get_data(), where
access to the ODVariable is certain.
The only truncation that still happens is based on the response size
specified by the server, which might be smaller for e.g. expedited
upload. Extend the upload() function docstring to clarify the changed
behavior. Adjust the test case for expedited upload with unspecified
size in the response, which is the only incompatible change.
* Test expedited upload with 8 byte padded frame.
The existing test response is actually wrong, since the standard
mandates four bytes "data" regardless of the other flags.1 parent 1582ba5 commit be9c56d
3 files changed
+41
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
152 | 163 | | |
153 | 164 | | |
154 | 165 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
115 | 119 | | |
116 | 120 | | |
117 | 121 | | |
| |||
128 | 132 | | |
129 | 133 | | |
130 | 134 | | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
| 135 | + | |
| 136 | + | |
142 | 137 | | |
143 | 138 | | |
144 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
93 | | - | |
94 | | - | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
95 | 103 | | |
96 | 104 | | |
97 | 105 | | |
| |||
102 | 110 | | |
103 | 111 | | |
104 | 112 | | |
105 | | - | |
| 113 | + | |
106 | 114 | | |
107 | | - | |
| 115 | + | |
108 | 116 | | |
109 | 117 | | |
110 | 118 | | |
| |||
131 | 139 | | |
132 | 140 | | |
133 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
134 | 153 | | |
135 | 154 | | |
136 | 155 | | |
| |||
0 commit comments