import struct def search_value_in_packet(p: bytes, val: int, label: str): # Search as uint8 for offset in range(len(p)): if p[offset] == val: print(f" {label} found as uint8 at offset {offset}") # Search as uint16 LE for offset in range(len(p) - 1): v = struct.unpack_from(' 8192: consumed += 1 continue if consumed + pkt_len <= len(stream): packets.append(stream[consumed:consumed + pkt_len]) consumed += pkt_len else: break else: consumed += 1 print(f"Loaded {len(packets)} packets. Scanning for HR=88, Systolic=108, MAP=75...") for idx, p in enumerate(packets): l = len(p) subtype = p[6] if l > 6 else -1 # Let's decode timestamp if it is a 45-byte packet ts_str = "" if l == 45: year = struct.unpack_from('