summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'contexthub/1.0/default/Contexthub.cpp')
-rw-r--r--contexthub/1.0/default/Contexthub.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/contexthub/1.0/default/Contexthub.cpp b/contexthub/1.0/default/Contexthub.cpp
index bf459005..3626a094 100644
--- a/contexthub/1.0/default/Contexthub.cpp
+++ b/contexthub/1.0/default/Contexthub.cpp
@@ -440,18 +440,15 @@ Return<Result> Contexthub::loadNanoApp(uint32_t hubId,
440 // Data from the nanoapp header is passed through HIDL as explicit fields, 440 // Data from the nanoapp header is passed through HIDL as explicit fields,
441 // but the legacy HAL expects it prepended to the binary, therefore we must 441 // but the legacy HAL expects it prepended to the binary, therefore we must
442 // reconstruct it here prior to passing to the legacy HAL. 442 // reconstruct it here prior to passing to the legacy HAL.
443 uint32_t targetChreApiVersion =
444 (appBinary.targetChreApiMajorVersion << 24) |
445 (appBinary.targetChreApiMinorVersion << 16);
446 const struct nano_app_binary_t header = { 443 const struct nano_app_binary_t header = {
447 .header_version = htole32(1), 444 .header_version = htole32(1),
448 .magic = htole32(NANOAPP_MAGIC), 445 .magic = htole32(NANOAPP_MAGIC),
449 .app_id.id = htole64(appBinary.appId), 446 .app_id.id = htole64(appBinary.appId),
450 .app_version = htole32(appBinary.appVersion), 447 .app_version = htole32(appBinary.appVersion),
451 .flags = htole32(appBinary.flags), 448 .flags = htole32(appBinary.flags),
452 .hw_hub_type = htole64(0), 449 .hw_hub_type = htole64(0),
453 .reserved[0] = htole32(targetChreApiVersion), 450 .target_chre_api_major_version = appBinary.targetChreApiMajorVersion,
454 .reserved[1] = 0, 451 .target_chre_api_minor_version = appBinary.targetChreApiMinorVersion,
455 }; 452 };
456 const uint8_t *headerBytes = reinterpret_cast<const uint8_t *>(&header); 453 const uint8_t *headerBytes = reinterpret_cast<const uint8_t *>(&header);
457 454