Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pcap logging; Timestamps wrapping after 59 seconds. #454

Merged
merged 1 commit into from
May 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cflib/crtp/pcap.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import os
import struct
from datetime import datetime
import time
from enum import IntEnum


Expand Down Expand Up @@ -139,6 +139,6 @@ def _assemble_record(self, link_type, receive, address, channel, devid, crtp_pac
)

def _pcap_header(self, len):
ts = datetime.now()

return struct.pack('<LLLL', ts.second, ts.microsecond, len, len)
seconds = time.time()
u_sec = int((seconds % 1)*1000000)
return struct.pack('<LLLL', int(seconds), u_sec, len, len)
Loading