Skip to content

Commit

Permalink
updated the data encoding schema when uploading data; reduce the wait…
Browse files Browse the repository at this point in the history
…time for re-upload
  • Loading branch information
johnnzhou committed Jun 2, 2023
1 parent 704634a commit e598433
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ class UploadWorker @AssistedInject constructor(
fun periodicSyncWork() =
PeriodicWorkRequestBuilder<DelegatingWorker>(4, TimeUnit.HOURS)
.setConstraints(Constraints(requiredNetworkType = NetworkType.CONNECTED))
.setInitialDelay(10, TimeUnit.MINUTES)
.setBackoffCriteria(BackoffPolicy.EXPONENTIAL, Duration.ofMinutes(5))
.setInitialDelay(5, TimeUnit.MINUTES)
.setBackoffCriteria(BackoffPolicy.EXPONENTIAL, Duration.ofMinutes(10))
.setInputData(UploadWorker::class.delegatedData())
.build()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ import kotlinx.serialization.json.Json
fun prepareReportData(measureDataModel: BaseMeasureDataModel, userData: UserData): String {
val serialized = Json.encodeToString(measureDataModel).toByteArray()
val sig_m = ECDSA.Sign(serialized, ECDSA.DeserializePrivateKey(userData.skT.toByteArray()))
val report = MeasurementReportModel(sig_m.toString(), userData.hPKR.toStringUtf8(), serialized.toString(), userData.showData)
val report = MeasurementReportModel(Hex.encodeHexString(sig_m), Hex.encodeHexString(userData.hPKR.toByteArray()), Hex.encodeHexString(serialized), userData.showData)
return Json.encodeToString(report)
}

0 comments on commit e598433

Please sign in to comment.