0
다음과 같은 간단한 프로토콜 프레임이 있습니다. 테스트를 위해 고정 CRC 필드를 가정했지만 이제 프레임의 이전 바이트에서 계산 된 실제 CRC를 추가해야합니다. 그것을하는 방법? 어쩌면 중첩 구조체로?구문 파이썬 라이브러리를 사용하여 CRC 필드 추가
MyFrame = Struct("MyFrame",
ULInt8("type"),
ULInt8("IDMsg"),
ULInt8("totalPackets"),
ULInt8("numPacket"),
ULInt8("day"),
ULInt8("month"),
ULInt8("year"),
ULInt8("hour"),
ULInt8("minute"),
ULInt8("second"),
ULInt16("length"),
Bytes("payload", lambda ctx: (ctx.length - 14)),
ULInt16("crc")
)