winIDEA SDK
test_storage_get_partition_info.py
1# This script is licensed under BSD License, see file LICENSE.txt.
2#
3# (c) TASKING Germany GmbH, 2023
4
5import isystem.connect as ic
6
7
8winidea_id = ''
9
10
11def test_getPartitionInfo():
12 connMgr = ic.ConnectionMgr()
13 connMgr.connect(ic.CConnectionConfig().instanceId(winidea_id))
14
15 devName = "eMMCtest"
16 partitionName = "Boot1"
17 storageCtrl = ic.CStorageDeviceFactory.makeDevice(connMgr, ic.EStorageDevice_EMMCDevice, devName, partitionName)
18
19 partInfo = storageCtrl.getPartitionConfigurationModule().getPartitionInfo()
20
21 print(f"\tName: {partInfo.getName()}")
22 print(f"\tType: {partInfo.getType()}")
23 print(f"\tOffset: {partInfo.getOffset()}")
24 print(f"\tSize: {partInfo.getSize()}")
25 print(f"\tEnhanced offset: {partInfo.getEnhancedOffset()}")
26 print(f"\tEnhanced size: {partInfo.getEnhancedSize()}")
27 print(f"\tExtended status: {partInfo.getExtended()}")
28 print(f"\tIs bootable: {partInfo.isBootable()}")
29 print(f"\tCan modifyBoot: {partInfo.canModifyBoot()}")
30 print(f"\tCan modify name: {partInfo.canModifyName()}")
31 print(f"\tCan modify offset: {partInfo.canModifyOffset()}")
32 print(f"\tCan modify size: {partInfo.canModifySize()}")
33 print(f"\tCan remove: {partInfo.canRemove()}")
34
35 ic.CStorageDeviceFactory.terminateDevice(connMgr, 1, devName)
36
37
38if __name__ == "__main__":
39 test_getPartitionInfo()