Terjemahan disediakan oleh mesin penerjemah. Jika konten terjemahan yang diberikan bertentangan dengan versi bahasa Inggris aslinya, utamakan versi bahasa Inggris.
Menerapkan agen OTA
Ketika Anda menerima dokumen pekerjaan dari integrasi terkelola, Anda harus memiliki implementasi agen OTA Anda sendiri yang memproses dokumen pekerjaan, mengunduh pembaruan, dan melakukan operasi instalasi apa pun. Agen OTA perlu melakukan langkah-langkah berikut:
-
Mengurai dokumen pekerjaan untuk firmware Amazon URLs S3.
-
Unduh pembaruan firmware melalui HTTP.
-
Verifikasi tanda tangan digital.
-
Instal pembaruan yang divalidasi.
-
Panggilan
iotmi\_JobsHandler\_updateJobStatusdenganSUCCESSatauFAILEDstatus.
Ketika perangkat Anda berhasil menyelesaikan operasi OTA, perangkat harus memanggil iotmi\_JobsHandler\_updateJobStatus API dengan status JobSucceeded untuk melaporkan pekerjaan yang berhasil.
/** * @brief Enumeration of possible job statuses. */ typedef enum{ JobQueued, /** The job is in the queue, waiting to be processed. */ JobInProgress, /** The job is currently being processed. */ JobFailed, /** The job processing failed. */ JobSucceeded, /** The job processing succeeded. */ JobRejected /** The job was rejected, possibly due to an error or invalid request. */ } iotmi_JobCurrentStatus_t; /** * @brief Update the status of a job with optional status details. * * @param[in] pJobId Pointer to the job ID string. * @param[in] jobIdLength Length of the job ID string. * @param[in] status The new status of the job. * @param[in] statusDetails Pointer to a string containing additional details about the job status. * This can be a JSON-formatted string or NULL if no details are needed. * @param[in] statusDetailsLength Length of the status details string. Set to 0 if `statusDetails` is NULL. * * @return 0 on success, non-zero on failure. */ int iotmi_JobsHandler_updateJobStatus( const char * pJobId, size_t jobIdLength, iotmi_JobCurrentStatus_t status, const char * statusDetails, size_t statusDetailsLength );