summaryrefslogtreecommitdiff
path: root/tools/proxyclient/m1n1/fw/asc/oslog.py
blob: b1a360be682053ef466b82c1ff6885ad84ef1333 (plain)
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
# SPDX-License-Identifier: MIT
from .base import *
from ...utils import *

## OSLog endpoint

class OSLogMessage(Register64):
    TYPE        = 63, 56

class OSLog_Init(OSLogMessage):
    TYPE        = 63, 56, Constant(1)
    UNK         = 51, 0

class OSLog_Ack(OSLogMessage):
    TYPE        = 63, 56, Constant(3)

class ASCOSLogEndpoint(ASCBaseEndpoint):
    BASE_MESSAGE = OSLogMessage
    SHORT = "oslog"

    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.started = False

    @msg_handler(1, OSLog_Init)
    def Init(self, msg):
        self.log(f"oslog init: {msg.UNK:#x}")
        self.send(OSLog_Ack())
        self.started = True
        return True