Seed socket payloads with opt (communicate factory) + host_probe4
This commit is contained in:
1 parent
213a0518d6
commit
bdc98484a9
5 files changed
+180
-18
No files matched your search
@@ -182,14 +182,21 @@ def direct_connect_request(
|
||||
``CommunicationService._query*ByDirectConnect`` family
|
||||
(``docs/RE_DART_FINDINGS.md`` §3). The wire ``cmdType`` is the
|
||||
*socket-transport* id (``CommunicationCmd::cmd`` for socket mode —
|
||||
e.g. ``DEVICE_APOWER_INFO`` → ``1307``, verified live). Note ``snno``
|
||||
is assigned by ``sendObject`` (see :class:`SequenceNumber`); pass the
|
||||
issued value when re-serialising.
|
||||
e.g. ``DEVICE_APOWER_INFO`` → ``1307``, verified live). On socket
|
||||
mode the factory always seeds the payload with ``"opt"`` (the
|
||||
operation type, ``0`` for query) and merges the caller's arguments
|
||||
after it — e.g. the app's ``queryAPowerData`` sends
|
||||
``dataArea = {"opt": 0, "update": 2}``. Note ``snno`` is assigned by
|
||||
``sendObject`` (see :class:`SequenceNumber`); pass the issued value
|
||||
when re-serialising.
|
||||
"""
|
||||
payload: Dict[str, Any] = {"opt": int(CommunicationOperate.QUERY)}
|
||||
if data:
|
||||
payload.update(data)
|
||||
return CommunicationObject(
|
||||
cmd_type=socket_cmd_type(cmd),
|
||||
equip_no=equip_no,
|
||||
op_type=CommunicationOperate.QUERY,
|
||||
snno=snno,
|
||||
data=data,
|
||||
data=payload,
|
||||
)
|
||||
Reference in new issue
Block a user