mirror of
https://github.com/qmk/qmk_firmware.git
synced 2026-07-11 11:26:17 -04:00
Prep client gen for header parsing - templates
This commit is contained in:
@@ -37,9 +37,9 @@ class XAPRequest(namedtuple('XAPRequest', 'token length data')):
|
||||
def __new__(cls, *args):
|
||||
return super().__new__(cls, *args)
|
||||
|
||||
@staticmethod
|
||||
def from_bytes(data):
|
||||
return XAPRequest._make(XAPRequest.fmt.unpack(data))
|
||||
@classmethod
|
||||
def from_bytes(cls, data):
|
||||
return cls._make(cls.fmt.unpack(data))
|
||||
|
||||
def to_bytes(self):
|
||||
return self.fmt.pack(*list(self))
|
||||
@@ -51,9 +51,9 @@ class XAPResponse(namedtuple('XAPResponse', 'token flags length data')):
|
||||
def __new__(cls, *args):
|
||||
return super().__new__(cls, *args)
|
||||
|
||||
@staticmethod
|
||||
def from_bytes(data):
|
||||
return XAPResponse._make(XAPResponse.fmt.unpack(data))
|
||||
@classmethod
|
||||
def from_bytes(cls, data):
|
||||
return cls._make(cls.fmt.unpack(data))
|
||||
|
||||
def to_bytes(self):
|
||||
return self.fmt.pack(*list(self))
|
||||
|
||||
Reference in New Issue
Block a user