Skip to content

Commit

Permalink
new message defaults to invalid
Browse files Browse the repository at this point in the history
  • Loading branch information
adeebshihadeh committed Dec 2, 2023
1 parent 60d1ee0 commit bb7c532
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions messaging/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,13 @@ def log_from_bytes(dat: bytes) -> capnp.lib.capnp._DynamicStructReader:
return msg


def new_message(service: Optional[str] = None, size: Optional[int] = None) -> capnp.lib.capnp._DynamicStructBuilder:
def new_message(service: str, size: Optional[int] = None) -> capnp.lib.capnp._DynamicStructBuilder:
dat = log.Event.new_message()
dat.logMonoTime = int(time.monotonic() * 1e9)
dat.valid = True
if service is not None:
if size is None:
dat.init(service)
else:
dat.init(service, size)
if size is None:
dat.init(service)
else:
dat.init(service, size)
return dat


Expand Down

0 comments on commit bb7c532

Please sign in to comment.