File: rpc_error.py

package info (click to toggle)
zigpy-znp 0.13.1%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 1,120 kB
  • sloc: python: 14,459; makefile: 6
file content (26 lines) | stat: -rw-r--r-- 789 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import zigpy_znp.types as t


class ErrorCode(t.enum8):
    InvalidSubsystem = 0x01
    InvalidCommandId = 0x02
    InvalidParameter = 0x03
    InvalidLength = 0x04


class RPCError(t.CommandsBase, subsystem=t.Subsystem.RPCError):
    # When the ZNP cannot recognize an SREQ command from the host processor,
    # the following SRSP is returned
    CommandNotRecognized = t.CommandDef(
        t.CommandType.SRSP,
        0x00,
        req_schema=None,  # XXX: There is no REQ, only a RSP
        rsp_schema=(
            t.Param(
                "ErrorCode",
                ErrorCode,
                "The error code maps to one of the following enumerated values.",
            ),
            t.Param("RequestHeader", t.CommandHeader, "Header of the invalid request"),
        ),
    )