-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathustruct.py
76 lines (61 loc) · 1.83 KB
/
ustruct.py
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
"""
Module: 'ustruct' on esp32 1.11.0
"""
# MCU: (sysname='esp32', nodename='esp32', release='1.11.0', version='v1.11-580-g973f68780 on 2019-11-17', machine='ESP32 module with ESP32')
# Stubber: 1.3.2
def calcsize(fmt) -> int:
"""
Return the number of bytes needed to store the given fmt.
Parameters
----------
- fmt
http://docs.micropython.org/en/latest/library/ustruct.html#ustruct.calcsize
"""
pass
def pack(fmt, v1, v2):
"""
Pack the values v1, v2, ... according to the format string fmt. The return value is a bytes object encoding the values.
Parameters
----------
- fmt
- v1
- v2
- ...
http://docs.micropython.org/en/latest/library/ustruct.html#ustruct.pack
"""
pass
def pack_into(fmt, buffer, offset, v1, v2):
"""
Pack the values v1, v2, ... according to the format string fmt into a buffer starting at offset. offset may be negative to count from the end of buffer.
Parameters
----------
- fmt
- buffer
- offset
- v1
- v2
- ...
http://docs.micropython.org/en/latest/library/ustruct.html#ustruct.pack_into
"""
pass
def unpack(fmt, data) -> tuple:
"""
Unpack from the data according to the format string fmt. The return value is a tuple of the unpacked values.
Parameters
----------
- fmt
- data
http://docs.micropython.org/en/latest/library/ustruct.html#ustruct.unpack
"""
pass
def unpack_from(fmt, data, offset=0) -> tuple:
"""
Unpack from the data starting at offset according to the format string fmt. offset may be negative to count from the end of buffer. The return value is a tuple of the unpacked values.
Parameters
----------
- fmt
- data
- offset=0
http://docs.micropython.org/en/latest/library/ustruct.html#ustruct.unpack_from
"""
pass