poco.agent module¶
-
class
PocoAgent
(hierarchy, input, screen, command=None)[源代码]¶ 基类:
object
This is the agent class for poco to communicate with target device.
This class is an aggregation of 4 major interfaces for now.
HierarchyInterface
: defines the hierarchy accessibility methods such as dump(crawl the whole UI tree), getAttr(retrieve attribute value by name)InputInterface
: defines the simulated input methods to allow inject simulated input on target deviceScreenInterface
: defines methods to access the screen surfaceCommandInterface
: defines methods to communicate with target device in arbitrary way. This is optional.
-
driver
¶ Return the driver of this agent related to. None if the driver is not ready to bind.
返回: the driver of this agent related to. 返回类型: inherit from Poco
-
get_sdk_version
()[源代码]¶ Retrieve the sdk version from remote runtime. Each poco agent implementation should override this method.
返回: version string of the poco sdk. usually in “0.0.0” format. None if not provided by poco sdk. 返回类型: str
-
rpc
¶ Return the interface of this agent handled.
返回: the rpc interface of this agent handled. 返回类型: object
Raises: NotImplementedError
– raises if the agent implementation dose not expose the rpc interface to user.