首次提交完整的python工程代码

This commit is contained in:
2026-06-15 20:38:42 +08:00
commit bca485d748
159 changed files with 248076 additions and 0 deletions

13
structure/b_frame.py Normal file
View File

@@ -0,0 +1,13 @@
# structure/b_frame.py
import struct
B_STAR_TIME_OFFSET = 41 # 根据你协议计算出的星上时偏移(可精调)
B_STAR_TIME_LEN = 6
def build_b_frame(data_id: int, processed_values: list[float]) -> bytes:
# 每个结果占8字节大端double
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