Agent fetches serialized task data from prologue web server and successfully parses it.
This commit is contained in:
@@ -26,6 +26,11 @@ proc uuidToUint32*(uuid: string): uint32 =
|
||||
proc uuidToString*(uuid: uint32): string =
|
||||
return uuid.toHex(8)
|
||||
|
||||
proc toString*(data: seq[byte]): string =
|
||||
result = newString(data.len)
|
||||
for i, b in data:
|
||||
result[i] = char(b)
|
||||
|
||||
proc toHexDump*(data: seq[byte]): string =
|
||||
for i, b in data:
|
||||
result.add(b.toHex(2))
|
||||
@@ -35,6 +40,20 @@ proc toHexDump*(data: seq[byte]): string =
|
||||
else:
|
||||
result.add(" ") # Regular space
|
||||
|
||||
proc toBytes*(value: uint16): seq[byte] =
|
||||
return @[
|
||||
byte(value and 0xFF),
|
||||
byte((value shr 8) and 0xFF)
|
||||
]
|
||||
|
||||
proc toBytes*(value: uint32): seq[byte] =
|
||||
return @[
|
||||
byte(value and 0xFF),
|
||||
byte((value shr 8) and 0xFF),
|
||||
byte((value shr 16) and 0xFF),
|
||||
byte((value shr 24) and 0xFF)
|
||||
]
|
||||
|
||||
# Function templates and overwrites
|
||||
template writeLine*(cq: Conquest, args: varargs[untyped]) =
|
||||
cq.prompt.writeLine(args)
|
||||
|
||||
Reference in New Issue
Block a user