Commit 85a367f0 authored by calocedre TAC's avatar calocedre TAC
Browse files

use long for unsigned int

parent b64f9841
......@@ -70,8 +70,8 @@ public class LocationContactMessageEncoder {
}
/* t_periodStart (32 bits) */
int periodStartTime = (int) TimeUtils.ntpTimestampFromInstant(message.getPeriodStartTime());
locationContactMessage.setNextInteger(periodStartTime, 32);
long periodStartTime = TimeUtils.ntpTimestampFromInstant(message.getPeriodStartTime());
locationContactMessage.setNextLong(periodStartTime, 32);
return locationContactMessage.getData();
}
......@@ -109,7 +109,7 @@ public class LocationContactMessageEncoder {
}
/* t_periodStart (32 bits) */
int periodStartTime = bitLocationContactMessage.getNextInteger(32);
long periodStartTime = bitLocationContactMessage.getNextLong(32);
return new LocationContact(locationPhone.toString(),
locationPin.toString(), TimeUtils.instantFromTimestamp(periodStartTime));
......
......@@ -105,8 +105,10 @@ public class LocationSpecificPartEncoder {
/* ct_periodStart (24 bits) */
message.setNextInteger(locationSpecificPart.getCompressedPeriodStartTime(), 24);
/* t_qrStart (32 bits) */
int qrCodeValidityStartTime = (int) TimeUtils.ntpTimestampFromInstant(locationSpecificPart.getQrCodeValidityStartTime());
message.setNextInteger(qrCodeValidityStartTime, 32);
long qrCodeValidityStartTime = Objects.isNull(locationSpecificPart.getQrCodeValidityStartTime()) ?
0 :
TimeUtils.ntpTimestampFromInstant(locationSpecificPart.getQrCodeValidityStartTime());
message.setNextLong(qrCodeValidityStartTime, 32);
/* LTKey (32 bytes) */
message.setNextByte(locationSpecificPart.getLocationTemporarySecretKey(), 256);
/* Encode the locContactMsg with encryption if required */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment