@@ -204,9 +204,12 @@ def _update_device_from_fs(self, device, include_extra_info):
204
204
return
205
205
206
206
device ['device_type' ] = self ._detect_device_type (device ['mount_point' ])
207
-
208
207
device ['target_id' ] = device ['target_id_usb_id' ]
209
- self ._update_device_details (device , include_extra_info )
208
+
209
+ {
210
+ 'daplink' : self ._update_device_details_daplink ,
211
+ 'jlink' : self ._update_device_details_jlink
212
+ }[device ['device_type' ]](device , include_extra_info )
210
213
211
214
def _detect_device_type (self , mount_point ):
212
215
""" Returns a string of the device type
@@ -216,17 +219,6 @@ def _detect_device_type(self, mount_point):
216
219
files = [f .lower () for f in os .listdir (mount_point )]
217
220
return 'jlink' if 'segger.html' in files else 'daplink'
218
221
219
- def _update_device_details (self , device , include_extra_info ):
220
- """ Updates device dict with information from the filesystem
221
- @param device Device dictionary to update. Should contain a valid
222
- 'mount_point' value
223
- @param include_extra_info Controls how much information (and by extension,
224
- the performance) is returned from the filesystem
225
- """
226
- {
227
- 'daplink' : self ._update_device_details_daplink ,
228
- 'jlink' : self ._update_device_details_jlink
229
- }[device ['device_type' ]](device , include_extra_info )
230
222
231
223
def _update_device_details_daplink (self , device , include_extra_info ):
232
224
self ._update_device_from_htm (device )
0 commit comments