Skip to content
Snippets Groups Projects
Commit 3d1e410f authored by jkerdreu's avatar jkerdreu
Browse files

Fix noonce way to pack long/int

git-svn-id: https://redmine.imt-atlantique.fr/svn/xaal/code/Python/branches/fork@1564 b32b6428-25c9-4566-ad07-03861ab6144f
parent 5525d1d4
No related branches found
No related tags found
No related merge requests found
......@@ -345,11 +345,11 @@ class Message(object):
def build_nonce(data):
""" Big-Endian, time in seconds and time in microseconds """
nonce = struct.pack('>LLL', 0,data[0], data[1])
nonce = struct.pack('>QL', data[0], data[1])
return nonce
def build_timestamp():
"""Return array [seconds since epoch, microseconds since last seconds] Time = UTC+0000 """
epoch = datetime.datetime.utcfromtimestamp(0)
timestamp = datetime.datetime.utcnow() - epoch
return [int(timestamp.total_seconds()), int(timestamp.microseconds)]
return [long(timestamp.total_seconds()), int(timestamp.microseconds)]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment