leaps_cert_update_write

This call is available only on the ethernet gateway. It should be called repeatedly after leaps_cert_update_start to transfer the certificate until all the data chunks are transferred. Returns status “ok” followed by the data request until all the data is transferred, in which case status “ok” is returned with no data request following or until the update ends with some error. The error is indicated by a status code other than “ok”. The reasons for the failed update are:

  • internal error

  • invalid parameter - e.g. data chunk with zero length, or data chunk has been skipped

  • not permitted - not started yet, or the whole update process has failed

The offset and requested size of the next transfer window are returned after each call to leaps_cert_update_write until the update is completed.


Input
  • offset: 32-bit unsigned integer (Certificate data offset.)

  • data: from 4 to 240 bytes (Certificate data chunk currently being uploaded, up to 240 bytes.)

Output
  • offset: 32-bit unsigned integer (Offset of the next requested transfer window.)

  • size: 32-bit unsigned integer (Requested size of the next transfer window, capped at 240 bytes.)


Example

TLV Request

Type

Length

Value

0x3B

0xF4

offset

data (240 bytes)

0x00 0x00 0x00 0x00

0xA5 0xA5 0xA5 0xA5 0xA5 0xA5 0xA5 0xA5 …. 0xA5 0xA5 0xA5 0xA5

Type 0x3B (59 dec) means command leaps_cert_update_write

TLV Response

Type

Length

Value

type

Length

Value

0x40

0x01

0x00

0x7E

0x08

offset

size

0xF0 0x00 0x00 0x00

0xF0 0x00 0x00 0x00

Type 0x40 means status code
Type 0x7E (126 dec) means data request

This request writes the full 240-byte window, so its TLV payload length is 0xF4 (4-byte offset plus 240 data bytes). After acceptance, the next offset and requested window size are both 240 (F0 00 00 00).