Mbed LS
|
Public Member Functions | |
__init__ (self, list_unmounted=False, **kwargs) | |
find_candidates (self) | |
list_mbeds_ext (self) | |
Function adds extra information for each mbed device. | |
list_mbeds (self, fs_interaction=FSInteraction.BeforeFilter, filter_function=None, unique_names=False, read_details_txt=False) | |
mock_manufacture_id (self, mid, platform_name, oper='+') | |
Replace (or add if manufacture id doesn't exist) entry in self.manufacture_ids. | |
list_manufacture_ids (self) | |
Creates list of all available mappings for target_id -> Platform. | |
retarget_read (self) | |
Load retarget data from local file. | |
retarget (self) | |
Enable retargeting. | |
get_dummy_platform (self, platform_name) | |
Returns simple dummy platform. | |
get_supported_platforms (self, device_type=None) | |
Return a dictionary of supported target ids and the corresponding platform name. | |
list_platforms (self) | |
Useful if you just want to know which platforms are currently available on the system. | |
list_platforms_ext (self) | |
Useful if you just want to know how many platforms of each type are currently available on the system. | |
list_mbeds_by_targetid (self) | |
Get information about mbeds with extended parameters/info included. | |
__str__ (self) | |
Object to string casting. | |
get_string (self, border=False, header=True, padding_width=1, sortby='platform_name') | |
Printing with some sql table like decorators. | |
get_json_data_from_file (self, json_spec_filename, verbose=False) | |
Loads from file JSON formatted string to data structure. | |
get_htm_target_id (self, mount_point) | |
get_mbed_htm (self, mount_point) | |
get_mbed_htm_comment_section_ver_build (self, line) | |
get_mbed_htm_lines (self, mount_point) | |
get_details_txt (self, mount_point) | |
parse_details_txt (self, lines) | |
scan_html_line_for_target_id (self, line) | |
mount_point_ready (self, path) | |
Check if a mount point is ready for file operations. | |
Static Public Member Functions | |
run_cli_process (cmd, shell=True) | |
Public Attributes | |
retarget_data | |
MOCK_FILE_NAME | |
plat_db | |
list_unmounted | |
RETARGET_FILE_NAME | |
dummy_counter | |
Static Public Attributes | |
list | os_supported = [] |
HOME_DIR = expanduser("~") | |
str | MOCK_FILE_NAME = '.mbedls-mock' |
str | RETARGET_FILE_NAME = 'mbedls.json' |
str | DETAILS_TXT_NAME = 'DETAILS.TXT' |
str | MBED_HTM_NAME = 'mbed.htm' |
dict | VENDOR_ID_DEVICE_TYPE_MAP |
Protected Member Functions | |
_fs_never (self, device, filter_function, read_details_txt) | |
_fs_before_id_check (self, device, filter_function, read_details_txt) | |
_fs_after_id_check (self, device, filter_function, read_details_txt) | |
_update_device_from_fs (self, device, read_details_txt) | |
_detect_device_type (self, device) | |
_update_device_details_daplink_compatible (self, device, read_details_txt) | |
_update_device_details_jlink (self, device, _) | |
_update_device_from_htm (self, device) | |
_update_device_details_atmel (self, device, _) | |
_read_htm_ids (self, mount_point) | |
Function scans mbed.htm to get information about TargetID. | |
_mbed_htm_comment_section_ver_build (self, line) | |
Check for Version and Build date of interface chip firmware im mbed.htm file. | |
_htm_lines (self, mount_point) | |
_details_txt (self, mount_point) | |
Load DETAILS.TXT to dictionary: DETAILS.TXT example: Version: 0226 Build: Aug 24 2015 17:06:30 Git Commit SHA: 27a236b9fe39c674a703c5c89655fbd26b8e27e1 Git Local mods: Yes. | |
_parse_details (self, lines) | |
_target_id_from_htm (self, line) | |
Extract Target id from htm line. | |
Static Protected Member Functions | |
_run_cli_process (cmd, shell=True) | |
Runs command as a process and return stdout, stderr and ret code. | |
Protected Attributes | |
_fs_before_id_check | |
_fs_after_id_check | |
Base class for mbed-lstools, defines mbed-ls tools interface for mbed-enabled devices detection for various hosts
Definition at line 54 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.__init__ | ( | self, | |
list_unmounted = False , |
|||
** | kwargs | ||
) |
ctor
Reimplemented in mbed_lstools.linux.MbedLsToolsLinuxGeneric.
Definition at line 79 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.__str__ | ( | self | ) |
Object to string casting.
Definition at line 489 of file lstools_base.py.
|
protected |
Load DETAILS.TXT to dictionary: DETAILS.TXT example: Version: 0226 Build: Aug 24 2015 17:06:30 Git Commit SHA: 27a236b9fe39c674a703c5c89655fbd26b8e27e1 Git Local mods: Yes.
or:
Unique ID: 0240000029164e45002f0012706e0006f301000097969900 HIF ID: 97969900 Auto Reset: 0 Automation allowed: 0 Daplink Mode: Interface Interface Version: 0240 Git SHA: c765cbb590f57598756683254ca38b211693ae5e Local Mods: 0 USB Interfaces: MSD, CDC, HID Interface CRC: 0x26764ebf
Definition at line 620 of file lstools_base.py.
|
protected |
Returns a string of the device type @param device Dictionary containing device information @return Device type located in VENDOR_ID_DEVICE_TYPE_MAP or None if unknown
Definition at line 244 of file lstools_base.py.
|
protected |
Filter device before touching the file system of the device. Said another way: Touch the file system after filtering
Definition at line 201 of file lstools_base.py.
|
protected |
Filter device after touching the file system of the device. Said another way: Touch the file system before filtering
Definition at line 189 of file lstools_base.py.
|
protected |
Filter device without touching the file system of the device
Definition at line 180 of file lstools_base.py.
|
protected |
Definition at line 609 of file lstools_base.py.
|
protected |
Check for Version and Build date of interface chip firmware im mbed.htm file.
Definition at line 581 of file lstools_base.py.
|
protected |
Definition at line 654 of file lstools_base.py.
|
protected |
Function scans mbed.htm to get information about TargetID.
mount_point | mbed mount point (disk / drive letter) |
Note: This function should be improved to scan variety of boards' mbed.htm files
Definition at line 557 of file lstools_base.py.
|
staticprotected |
Runs command as a process and return stdout, stderr and ret code.
cmd | Command to execute |
Definition at line 701 of file lstools_base.py.
|
protected |
Extract Target id from htm line.
Definition at line 670 of file lstools_base.py.
|
protected |
Updates the Atmel device information based on files from its 'mount_point' @param device Dictionary containing device information @param read_details_txt A boolean controlling the presense of the output dict attributes read from other files present on the 'mount_point'
Definition at line 339 of file lstools_base.py.
|
protected |
Updates the daplink-specific device information based on files from its 'mount_point' @param device Dictionary containing device information @param read_details_txt A boolean controlling the presense of the output dict attributes read from other files present on the 'mount_point'
Definition at line 253 of file lstools_base.py.
|
protected |
Updates the jlink-specific device information based on files from its 'mount_point' @param device Dictionary containing device information
Definition at line 288 of file lstools_base.py.
|
protected |
Updates the device information based on files from its 'mount_point' @param device Dictionary containing device information @param read_details_txt A boolean controlling the presense of the output dict attributes read from other files present on the 'mount_point'
Definition at line 213 of file lstools_base.py.
|
protected |
Set the 'target_id', 'target_id_mbed_htm', 'platform_name' and 'daplink_*' attributes by reading from mbed.htm on the device
Definition at line 320 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.find_candidates | ( | self | ) |
Find all candidate devices connected to this computer Note: Should not open any files @return A dict with the keys 'mount_point', 'serial_port' and 'target_id_usb_id'
Reimplemented in mbed_lstools.linux.MbedLsToolsLinuxGeneric.
Definition at line 98 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.get_details_txt | ( | self, | |
mount_point | |||
) |
Definition at line 617 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.get_dummy_platform | ( | self, | |
platform_name | |||
) |
Returns simple dummy platform.
Definition at line 412 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.get_htm_target_id | ( | self, | |
mount_point | |||
) |
Definition at line 547 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.get_json_data_from_file | ( | self, | |
json_spec_filename, | |||
verbose = False |
|||
) |
Loads from file JSON formatted string to data structure.
Definition at line 530 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.get_mbed_htm | ( | self, | |
mount_point | |||
) |
Definition at line 553 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.get_mbed_htm_comment_section_ver_build | ( | self, | |
line | |||
) |
Definition at line 578 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.get_mbed_htm_lines | ( | self, | |
mount_point | |||
) |
Definition at line 606 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.get_string | ( | self, | |
border = False , |
|||
header = True , |
|||
padding_width = 1 , |
|||
sortby = 'platform_name' |
|||
) |
Printing with some sql table like decorators.
border | Table border visibility |
header | Table header visibility |
padding_width | Table padding |
sortby | Column used to sort results |
Definition at line 498 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.get_supported_platforms | ( | self, | |
device_type = None |
|||
) |
Return a dictionary of supported target ids and the corresponding platform name.
device_type | Filter which device entries are returned from the platform database |
Definition at line 433 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.list_manufacture_ids | ( | self | ) |
Creates list of all available mappings for target_id -> Platform.
Definition at line 373 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.list_mbeds | ( | self, | |
fs_interaction = FSInteraction.BeforeFilter , |
|||
filter_function = None , |
|||
unique_names = False , |
|||
read_details_txt = False |
|||
) |
List details of connected devices @return Returns list of structures with detailed info about each mbed @param fs_interaction A member of the FSInteraction class that picks the trade of between quality of service and speed @param filter_function Function that is passed each mbed candidate, should return True if it should be included in the result Ex. mbeds = list_mbeds(filter_function=lambda m: m['platform_name'] == 'K64F') @param unique_names A boolean controlling the presence of the 'platform_unique_name' member of the output dict @param read_details_txt A boolean controlling the presense of the output dict attributes read from other files present on the 'mount_point' @details Function returns list of dictionaries with mbed attributes 'mount_point', TargetID name etc. Function returns mbed list with platform names if possible
Definition at line 118 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.list_mbeds_by_targetid | ( | self | ) |
Get information about mbeds with extended parameters/info included.
Ordered by target id (key: target_id).
Definition at line 477 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.list_mbeds_ext | ( | self | ) |
Function adds extra information for each mbed device.
Get information about mbeds with extended parameters/info included
Definition at line 110 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.list_platforms | ( | self | ) |
Useful if you just want to know which platforms are currently available on the system.
Definition at line 447 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.list_platforms_ext | ( | self | ) |
Useful if you just want to know how many platforms of each type are currently available on the system.
Definition at line 461 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.mock_manufacture_id | ( | self, | |
mid, | |||
platform_name, | |||
oper = '+' |
|||
) |
Replace (or add if manufacture id doesn't exist) entry in self.manufacture_ids.
oper | '+' add new mock / override existing entry '-' remove mid from mocking entry |
Definition at line 358 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.mount_point_ready | ( | self, | |
path | |||
) |
Check if a mount point is ready for file operations.
Definition at line 689 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.parse_details_txt | ( | self, | |
lines | |||
) |
Definition at line 651 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.retarget | ( | self | ) |
Enable retargeting.
Read data from local retarget configuration file
Definition at line 404 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.retarget_read | ( | self | ) |
Load retarget data from local file.
Definition at line 389 of file lstools_base.py.
|
static |
Definition at line 697 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.scan_html_line_for_target_id | ( | self, | |
line | |||
) |
Definition at line 667 of file lstools_base.py.
|
protected |
Definition at line 156 of file lstools_base.py.
|
protected |
Definition at line 155 of file lstools_base.py.
|
static |
Definition at line 69 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.dummy_counter |
Definition at line 415 of file lstools_base.py.
|
static |
Definition at line 66 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.list_unmounted |
Definition at line 92 of file lstools_base.py.
|
static |
Definition at line 70 of file lstools_base.py.
|
static |
Definition at line 67 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.MOCK_FILE_NAME |
Definition at line 85 of file lstools_base.py.
|
static |
Definition at line 63 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.plat_db |
Definition at line 90 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.retarget_data |
Definition at line 82 of file lstools_base.py.
|
static |
Definition at line 68 of file lstools_base.py.
mbed_lstools.lstools_base.MbedLsToolsBase.RETARGET_FILE_NAME |
Definition at line 393 of file lstools_base.py.
|
static |
Definition at line 72 of file lstools_base.py.