Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
update-lwm2m-mbed-apis.h File Reference
This file contains forward declarations for all functions used as APIS for the update client. More...
Go to the source code of this file.
Functions | |
| uint32_t | ARM_UCS_LWM2M_MONITOR_GetVersion (void) |
| Get driver version. | |
| ARM_MONITOR_CAPABILITIES | ARM_UCS_LWM2M_MONITOR_GetCapabilities (void) |
| Get Source capabilities. | |
| arm_uc_error_t | ARM_UCS_LWM2M_MONITOR_Initialize (void(*notification_handler)(void)) |
| Initialize Monitor. | |
| arm_uc_error_t | ARM_UCS_LWM2M_MONITOR_Uninitialize (void) |
| Uninitialized Monitor. | |
| arm_uc_error_t | ARM_UCS_LWM2M_MONITOR_SendState (arm_uc_monitor_state_t state) |
| Send Update Client state. | |
| arm_uc_error_t | ARM_UCS_LWM2M_MONITOR_SendUpdateResult (arm_uc_monitor_result_t updateResult) |
| Send update result. | |
| arm_uc_error_t | ARM_UCS_LWM2M_MONITOR_SendName (arm_uc_buffer_t *name) |
| Send current firmware name. | |
| arm_uc_error_t | ARM_UCS_LWM2M_MONITOR_SendVersion (uint64_t version) |
| Send current firmware version. | |
| arm_uc_error_t | ARM_UCS_LWM2M_MONITOR_SetBootloaderHash (arm_uc_buffer_t *hash) |
| Set the bootloader hash. | |
| arm_uc_error_t | ARM_UCS_LWM2M_MONITOR_SetOEMBootloaderHash (arm_uc_buffer_t *hash) |
| Set the OEM bootloader hash. | |
| uint32_t | ARM_UCS_LWM2M_SOURCE_GetVersion (void) |
| Get driver version. | |
| ARM_SOURCE_CAPABILITIES | ARM_UCS_LWM2M_SOURCE_GetCapabilities (void) |
| Get Source capabilities. | |
| arm_uc_error_t | ARM_UCS_LWM2M_SOURCE_Initialize (ARM_SOURCE_SignalEvent_t cb_event) |
| Initialize Source. | |
| arm_uc_error_t | ARM_UCS_LWM2M_SOURCE_Uninitialize (void) |
| Uninitialized Source. | |
| arm_uc_error_t | ARM_UCS_LWM2M_SOURCE_GetManifestDefaultCost (uint32_t *cost) |
| Cost estimation for retrieving manifest from the default location. | |
| arm_uc_error_t | ARM_UCS_LWM2M_SOURCE_GetManifestDefault (arm_uc_buffer_t *buffer, uint32_t offset) |
| Retrieve manifest from the default location. | |
| arm_uc_error_t | ARM_UCS_LWM2M_SOURCE_GetManifestURLCost (arm_uc_uri_t *uri, uint32_t *cost) |
| Cost estimation for retrieving manifest from URL. | |
| arm_uc_error_t | ARM_UCS_LWM2M_SOURCE_GetFirmwareURLCost (arm_uc_uri_t *uri, uint32_t *cost) |
| Cost estimation for retrieving firmware from URL. | |
| arm_uc_error_t | ARM_UCS_LWM2M_SOURCE_GetKeytableURLCost (arm_uc_uri_t *uri, uint32_t *cost) |
| Cost estimation for retrieving key table from URL. | |
| arm_uc_error_t | ARM_UCS_LWM2M_SOURCE_GetManifestURL (arm_uc_uri_t *uri, arm_uc_buffer_t *buffer, uint32_t offset) |
| Retrieve manifest from URL. | |
| arm_uc_error_t | ARM_UCS_LWM2M_SOURCE_GetFirmwareFragment (arm_uc_uri_t *uri, arm_uc_buffer_t *buffer, uint32_t offset) |
| Retrieve firmware fragment. | |
| arm_uc_error_t | ARM_UCS_LWM2M_SOURCE_GetKeytableURL (arm_uc_uri_t *uri, arm_uc_buffer_t *buffer) |
| Retrieve a key table from a URL. | |
Detailed Description
This file contains forward declarations for all functions used as APIS for the update client.
Because C++ does not support designated initialisers, this file is used to provide linkage from C++ to C structure initialisers. This pattern is necessary to ensure that the APIs are not brittle and prone to breakage if APIs are added or the API structure is changed.
Definition in file update-lwm2m-mbed-apis.h.
Function Documentation
| ARM_MONITOR_CAPABILITIES ARM_UCS_LWM2M_MONITOR_GetCapabilities | ( | void | ) |
Get Source capabilities.
- Returns:
- Struct containing capabilites. See definition above.
Definition at line 37 of file lwm2m-monitor.cpp.
| uint32_t ARM_UCS_LWM2M_MONITOR_GetVersion | ( | void | ) |
| arm_uc_error_t ARM_UCS_LWM2M_MONITOR_Initialize | ( | void(*)(void) | notification_handler ) |
| arm_uc_error_t ARM_UCS_LWM2M_MONITOR_SendName | ( | arm_uc_buffer_t * | name ) |
Send current firmware name.
The firmware name is the SHA256 hash.
- Parameters:
-
name Pointer to buffer struct. Hash is stored as byte array.
- Returns:
- Error code.
Definition at line 240 of file lwm2m-monitor.cpp.
| arm_uc_error_t ARM_UCS_LWM2M_MONITOR_SendState | ( | arm_uc_monitor_state_t | state ) |
Send Update Client state.
From the OMA LWM2M Technical Specification:
Indicates current state with respect to this firmware update. This value is set by the LWM2M Client. 0: Idle (before downloading or after successful updating) 1: Downloading (The data sequence is on the way) 2: Downloaded 3: Updating
If writing the firmware package to Package Resource is done, or, if the device has downloaded the firmware package from the Package URI the state changes to Downloaded.
If writing an empty string to Package Resource is done or writing an empty string to Package URI is done, the state changes to Idle.
When in Downloaded state, and the executable Resource Update is triggered, the state changes to Updating. If the Update Resource failed, the state returns at Downloaded. If performing the Update Resource was successful, the state changes from Updating to Idle.
- Parameters:
-
state Valid states: ARM_UC_MONITOR_STATE_IDLE ARM_UC_MONITOR_STATE_DOWNLOADING ARM_UC_MONITOR_STATE_DOWNLOADED ARM_UC_MONITOR_STATE_UPDATING
- Returns:
- Error code.
Definition at line 106 of file lwm2m-monitor.cpp.
| arm_uc_error_t ARM_UCS_LWM2M_MONITOR_SendUpdateResult | ( | arm_uc_monitor_result_t | updateResult ) |
Send update result.
From the OMA LWM2M Technical Specification:
Contains the result of downloading or updating the firmware 0: Initial value. Once the updating process is initiated (Download /Update), this Resource MUST be reset to Initial value. 1: Firmware updated successfully, 2: Not enough storage for the new firmware package. 3. Out of memory during downloading process. 4: Connection lost during downloading process. 5: CRC check failure for new downloaded package. 6: Unsupported package type. 7: Invalid URI 8: Firmware update failed
This Resource MAY be reported by sending Observe operation.
- Parameters:
-
result Valid results: ARM_UC_MONITOR_RESULT_INITIAL ARM_UC_MONITOR_RESULT_SUCCESS ARM_UC_MONITOR_RESULT_ERROR_STORAGE ARM_UC_MONITOR_RESULT_ERROR_MEMORY ARM_UC_MONITOR_RESULT_ERROR_CONNECTION ARM_UC_MONITOR_RESULT_ERROR_CRC ARM_UC_MONITOR_RESULT_ERROR_TYPE ARM_UC_MONITOR_RESULT_ERROR_URI ARM_UC_MONITOR_RESULT_ERROR_UPDATE
- Returns:
- Error code.
Definition at line 173 of file lwm2m-monitor.cpp.
| arm_uc_error_t ARM_UCS_LWM2M_MONITOR_SendVersion | ( | uint64_t | version ) |
Send current firmware version.
The firmware version is the timestamp from the manifest that authorized the firmware.
- Parameters:
-
version Timestamp, 64 bit unsigned integer.
- Returns:
- Error code.
Definition at line 267 of file lwm2m-monitor.cpp.
| arm_uc_error_t ARM_UCS_LWM2M_MONITOR_SetBootloaderHash | ( | arm_uc_buffer_t * | hash ) |
Set the bootloader hash.
The bootloader hash is a hash of the bootloader. This is used for tracking the version of the bootloader used.
- Parameters:
-
name Pointer to buffer struct. Hash is stored as byte array.
- Returns:
- Error code.
Definition at line 289 of file lwm2m-monitor.cpp.
| arm_uc_error_t ARM_UCS_LWM2M_MONITOR_SetOEMBootloaderHash | ( | arm_uc_buffer_t * | hash ) |
Set the OEM bootloader hash.
If the end-user has modified the bootloader the hash of the modified bootloader can be set here.
- Parameters:
-
name Pointer to buffer struct. Hash is stored as byte array.
- Returns:
- Error code.
Definition at line 311 of file lwm2m-monitor.cpp.
| arm_uc_error_t ARM_UCS_LWM2M_MONITOR_Uninitialize | ( | void | ) |
| ARM_SOURCE_CAPABILITIES ARM_UCS_LWM2M_SOURCE_GetCapabilities | ( | void | ) |
Get Source capabilities.
- Returns:
- Struct containing capabilites. See definition above.
Definition at line 51 of file lwm2m-source.cpp.
| arm_uc_error_t ARM_UCS_LWM2M_SOURCE_GetFirmwareFragment | ( | arm_uc_uri_t * | uri, |
| arm_uc_buffer_t * | buffer, | ||
| uint32_t | offset | ||
| ) |
Retrieve firmware fragment.
Firmware fragment is stored in supplied buffer. Event is generated once fragment is in buffer.
- Parameters:
-
uri URI struct with firmware location. buffer Struct containing byte array, maximum size, and actual size. offset Firmware offset to retrieve fragment from.
- Returns:
- Error code.
Definition at line 360 of file lwm2m-source.cpp.
| arm_uc_error_t ARM_UCS_LWM2M_SOURCE_GetFirmwareURLCost | ( | arm_uc_uri_t * | uri, |
| uint32_t * | cost | ||
| ) |
Cost estimation for retrieving firmware from URL.
The estimation can vary over time and should not be cached too long. 0x00000000 - The firmware is already downloaded. 0xFFFFFFFF - Cannot retrieve firmware from this Source.
- Parameters:
-
uri URI struct with firmware location. cost Pointer to variable for the return value.
- Returns:
- Error code.
Definition at line 281 of file lwm2m-source.cpp.
| arm_uc_error_t ARM_UCS_LWM2M_SOURCE_GetKeytableURL | ( | arm_uc_uri_t * | uri, |
| arm_uc_buffer_t * | buffer | ||
| ) |
Retrieve a key table from a URL.
Key table is stored in supplied buffer. Event is generated once fragment is in buffer.
- Parameters:
-
uri URI struct with keytable location. buffer Struct containing byte array, maximum size, and actual size.
- Returns:
- Error code.
Definition at line 382 of file lwm2m-source.cpp.
| arm_uc_error_t ARM_UCS_LWM2M_SOURCE_GetKeytableURLCost | ( | arm_uc_uri_t * | uri, |
| uint32_t * | cost | ||
| ) |
Cost estimation for retrieving key table from URL.
The estimation can vary over time and should not be cached too long. 0x00000000 - The firmware is already downloaded. 0xFFFFFFFF - Cannot retrieve firmware from this Source.
- Parameters:
-
uri URI struct with keytable location. cost Pointer to variable for the return value.
- Returns:
- Error code.
Definition at line 309 of file lwm2m-source.cpp.
| arm_uc_error_t ARM_UCS_LWM2M_SOURCE_GetManifestDefault | ( | arm_uc_buffer_t * | buffer, |
| uint32_t | offset | ||
| ) |
Retrieve manifest from the default location.
Manifest is stored in supplied buffer. Event is generated once manifest is in buffer.
- Parameters:
-
buffer Struct containing byte array, maximum size, and actual size.
- Returns:
- Error code.
Definition at line 154 of file lwm2m-source.cpp.
| arm_uc_error_t ARM_UCS_LWM2M_SOURCE_GetManifestDefaultCost | ( | uint32_t * | cost ) |
Cost estimation for retrieving manifest from the default location.
The estimation can vary over time and should not be cached too long. 0x00000000 - The manifest is already downloaded. 0xFFFFFFFF - Cannot retrieve manifest from this Source.
- Parameters:
-
cost Pointer to variable for the return value.
- Returns:
- Error code.
Definition at line 123 of file lwm2m-source.cpp.
| arm_uc_error_t ARM_UCS_LWM2M_SOURCE_GetManifestURL | ( | arm_uc_uri_t * | uri, |
| arm_uc_buffer_t * | buffer, | ||
| uint32_t | offset | ||
| ) |
Retrieve manifest from URL.
Manifest is stored in supplied buffer. Event is generated once manifest is in buffer.
- Parameters:
-
uri URI struct with manifest location. buffer Struct containing byte array, maximum size, and actual size.
- Returns:
- Error code.
Definition at line 337 of file lwm2m-source.cpp.
| arm_uc_error_t ARM_UCS_LWM2M_SOURCE_GetManifestURLCost | ( | arm_uc_uri_t * | uri, |
| uint32_t * | cost | ||
| ) |
Cost estimation for retrieving manifest from URL.
The estimation can vary over time and should not be cached too long. 0x00000000 - The manifest is already downloaded. 0xFFFFFFFF - Cannot retrieve manifest from this Source.
- Parameters:
-
uri URI struct with manifest location. cost Pointer to variable for the return value.
- Returns:
- Error code.
Definition at line 253 of file lwm2m-source.cpp.
| uint32_t ARM_UCS_LWM2M_SOURCE_GetVersion | ( | void | ) |
| arm_uc_error_t ARM_UCS_LWM2M_SOURCE_Initialize | ( | ARM_SOURCE_SignalEvent_t | cb_event ) |
Initialize Source.
Function pointer to event handler is passed as argument.
- Parameters:
-
cb_event Function pointer to event handler. See events above.
- Returns:
- Error code.
Definition at line 77 of file lwm2m-source.cpp.
| arm_uc_error_t ARM_UCS_LWM2M_SOURCE_Uninitialize | ( | void | ) |
Generated on Tue Jul 12 2022 16:24:24 by
1.7.2