TMYUtils

class tlkcore.TMYUtils.RetType(ret=RetCode.OK, msg=None, data=None)

Bases: _RetTypeBase

A general returns class for returning error code, sometimes with error msg and data.

Parameters:
  • ret (RetCode, optional) – Error code. Defaults to OK.

  • msg (str|None, optional) – Error message. Defaults to None.

  • data (None, optional) – Return data(described in functions). Defaults to None.

RetCode = 0

Default error code, please refer to RetCode

RetMsg = None

Error message if error code is not OK

RetData = None

Return data if available

toJson() str

Convert current RetType to json format with string

Returns:

Description for this RetType with json format likes {'RetCode':0, 'RetData':None, 'RetMsg':None}

Return type:

str

reload(value)

Reload & update values from json string to current RetType

class tlkcore.TMYUtils.ScanMode(*values)

Bases: Enum

Device scanning parameters

Deprecated since version v2.0.0.

SCAN_NORMAL = 0
SCAN_FAST = 1
SCAN_COMM_SKIP = 2
class tlkcore.TMYUtils.VER(ver: str | VER = None)

Bases: object

A version comparator

Parameters:

ver (str) – Version string with 3~4 digits and separated by ‘.’