Loading...
Searching...
No Matches
SUIT secure firmware OTA mock transport

SUIT firmware mock transport. More...

Detailed Description

SUIT firmware mock transport.

Mock transport backend definitions for SUIT manifests

Author
Koen Zandberg koen@.nosp@m.berg.nosp@m.zand..nosp@m.net

The mock transport is a noop transport. Payloads are preloaded in flash and provided as an array of suit_transport_mock_payload_t to the module.

Both the array of payloads named payloads and the size with name num_payloads must be provided.

Data Structures

struct  suit_transport_mock_payload_t
 Mock payload. More...
 

Macros

#define SUIT_TRANSPORT_MOCK_APP_MANIFEST
 Enable to provide a mocked manifest file from an application.
 

Functions

ssize_t suit_transport_mock_get_manifest (uint8_t *buf, size_t buf_len)
 Get mock manifest from an application.
 
int suit_transport_mock_fetch (const suit_manifest_t *manifest)
 'fetch' a payload
 

Macro Definition Documentation

◆ SUIT_TRANSPORT_MOCK_APP_MANIFEST

#define SUIT_TRANSPORT_MOCK_APP_MANIFEST

Enable to provide a mocked manifest file from an application.

See also
suit_transport_mock_get_manifest()

Set this if you want to provide a manifest in suit_handle_url() from a test application. The test application then needs to implement the function suit_transport_mock_get_manifest().

Definition at line 53 of file mock.h.

Function Documentation

◆ suit_transport_mock_fetch()

int suit_transport_mock_fetch ( const suit_manifest_t * manifest)

'fetch' a payload

The payload fetched from the payloads array is indicated by the suit_manifest_t::component_current member

Parameters
[in]manifestsuit manifest context
Returns
SUIT_OK if valid
negative otherwise

◆ suit_transport_mock_get_manifest()

ssize_t suit_transport_mock_get_manifest ( uint8_t * buf,
size_t buf_len )

Get mock manifest from an application.

Parameters
[out]bufManifest buffer
[in]buf_lenMaximum length of buf
See also
SUIT_TRANSPORT_MOCK_APP_MANIFEST

If SUIT_TRANSPORT_MOCK_APP_MANIFEST is not defined, the function is a macro that returns 0U.

Returns
Actual length of the manifest.
-ENOBUFS, if buf_len does not fit the manifest.