INNER CODE UNIT · Python
_send_msg
codematrixer/hmdriver2 · hmdriver2/_client.py:45
def _send_msg(self, msg: typing.Dict):
"""Send an message to the server.
Example:
{
"module": "com.ohos.devicetest.hypiumApiHelper",
"method": "callHypiumApi",
"params": {
"api": "Driver.create",
"this": null,
"args": [],
"message_type": "hypium"
},
"request_id": "20240815161352267072",
"client": "127.0.0.1"
}
"""
msg = json.dumps(msg, ensure_ascii=False, separators=(',', ':'))
logger.debug(f"sendMsg: {msg}")