@@ -97,13 +97,6 @@ def test_expedited_upload(self):
9797 self .assertEqual (trans_type , 254 )
9898
9999 # Same with padding to a full SDO frame
100- self .data = [
101- (TX , b'\x40 \x00 \x14 \x02 \x00 \x00 \x00 \x00 ' ),
102- (RX , b'\x4f \x00 \x14 \x02 \xfe \x00 \x00 \x00 ' )
103- ]
104- trans_type = self .network [2 ].sdo [0x1400 ]['Transmission type RPDO 1' ].raw
105- self .assertEqual (trans_type , 254 )
106-
107100 self .data = [
108101 (TX , b'\x40 \x00 \x14 \x02 \x00 \x00 \x00 \x00 ' ),
109102 (RX , b'\x42 \x00 \x14 \x02 \xfe \x00 \x00 \x00 ' )
@@ -146,6 +139,17 @@ def test_segmented_upload(self):
146139 device_name = self .network [2 ].sdo [0x1008 ].raw
147140 self .assertEqual (device_name , "Tiny Node - Mega Domains !" )
148141
142+ def test_segmented_upload_too_much_data (self ):
143+ # Server sends 5 bytes, but indicated size 4
144+ self .data = [
145+ (TX , b'\x40 \x08 \x10 \x00 \x00 \x00 \x00 \x00 ' ),
146+ (RX , b'\x41 \x08 \x10 \x00 \x04 \x00 \x00 \x00 ' ),
147+ (TX , b'\x60 \x00 \x00 \x00 \x00 \x00 \x00 \x00 ' ),
148+ (RX , b'\x05 \x54 \x69 \x6E \x79 \x20 \x00 \x00 ' ),
149+ ]
150+ device_name = self .network [2 ].sdo [0x1008 ].raw
151+ self .assertEqual (device_name , "Tiny" )
152+
149153 def test_segmented_download (self ):
150154 self .data = [
151155 (TX , b'\x21 \x00 \x20 \x00 \x0d \x00 \x00 \x00 ' ),
0 commit comments