首次提交完整的python工程代码
This commit is contained in:
7
protocol/b_frame.py
Normal file
7
protocol/b_frame.py
Normal file
@@ -0,0 +1,7 @@
|
||||
import struct
|
||||
|
||||
def build_b_frame(data_id: int, processed_values: list[float]) -> bytes:
|
||||
payload = b''.join(struct.pack('>d', v) for v in processed_values)
|
||||
data_len = len(payload)
|
||||
frame = struct.pack('>II', data_id, data_len) + payload
|
||||
return frame
|
||||
Reference in New Issue
Block a user