@@ -178,25 +178,30 @@ def process_transaction(self):
178
178
179
179
return new_frame
180
180
181
- def _process_data_frame (self , frame ):
182
- byte = int .from_bytes (frame .data ['data' ], 'little' )
183
-
184
-
185
- self .current_transaction .data .append (byte )
181
+ def _process_start_frame (self , frame ):
182
+ if self .current_transaction : # repeated start
183
+ print ("Repeated start, skipping" )
184
+ return
185
+ print ("Start" )
186
+ self .current_transaction = Transaction (frame .start_time )
186
187
187
188
def _process_address_frame (self , frame ):
188
189
address = frame .data ['address' ] # bytes
189
190
read = frame .data ['read' ] # bool
190
191
ack = frame .data ['ack' ] # bool
192
+ print ("Address" )
191
193
192
194
self .current_transaction .is_read = read
193
195
self .current_transaction .i2c_node_addr = address
194
- def _process_start_frame (self , frame ):
195
- if self .current_transaction : # repeated start
196
- return
197
- self .current_transaction = Transaction (frame .start_time )
196
+
197
+ def _process_data_frame (self , frame ):
198
+ print ("Data" )
199
+ byte = int .from_bytes (frame .data ['data' ], 'little' )
200
+
201
+ self .current_transaction .data .append (byte )
198
202
199
203
def _process_stop_frame (self , frame ):
204
+ print ("Stop" )
200
205
self .current_transaction .end_time = frame .end_time
201
206
new_frame = self .process_transaction ()
202
207
self .current_transaction = None
@@ -213,7 +218,8 @@ def decode(self, frame):
213
218
if frame_type == 'start' : # begin new transaction or repeated start
214
219
self ._process_start_frame (frame )
215
220
if self .current_transaction is None :
216
- if self ._debug : print ("EXITing `decode` due to missing transaction for non-start frame" )
221
+ print ("the first stop will trigger this?" )
222
+ print ("EXITing `decode` due to missing transaction for non-start frame" )
217
223
return
218
224
219
225
if frame_type == 'address' : # read or write + I2C slave addr
@@ -233,6 +239,8 @@ def decode(self, frame):
233
239
print (key , "=>" , value )
234
240
235
241
return new_frame
242
+ else :
243
+ print ("new frame is None" )
236
244
237
245
# return AnalyzerFrame('mytype', frame.start_time, frame.end_time, {
238
246
# 'input_type': frame.type
0 commit comments