File: app.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 (45 lines) | stat: -rw-r--r-- 1,554 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import zigpy_znp.types as t


class APP(t.CommandsBase, subsystem=t.Subsystem.APP):
    # This command is sent to the target in order to test the functions defined
    # for individual applications.
    # This command sends a raw data to an application
    Msg = t.CommandDef(
        t.CommandType.SREQ,
        0x00,
        req_schema=(
            t.Param(
                "Endpoint",
                t.uint8_t,
                "Application endpoint of the outgoing message",
            ),
            t.Param("DstAddr", t.NWK, "Destination address of the outgoing message"),
            t.Param(
                "DstEndpoint",
                t.uint8_t,
                "Destination endpoint of the outgoing message",
            ),
            t.Param("ClusterId", t.ClusterId, "Cluster ID"),
            t.Param("Data", t.ShortBytes, "Data request"),
        ),
        rsp_schema=t.STATUS_SCHEMA,
    )

    # This command is used by tester to issue user's defined commands to the
    # application
    UserTest = t.CommandDef(
        t.CommandType.SREQ,
        0x01,
        req_schema=(
            t.Param(
                "SrcEndpoint",
                t.uint8_t,
                "Source Endpoint of the user-defined command",
            ),
            t.Param("CommandId", t.uint16_t, "Command Id of the user-defined command"),
            t.Param("Parameter1", t.uint16_t, "Parameter #1 of the command"),
            t.Param("Parameter2", t.uint16_t, "Parameter #2 of the command"),
        ),
        rsp_schema=t.STATUS_SCHEMA,
    )