Myriota UltraLite SDK 2.4.0
Loading...
Searching...
No Matches
System update

Update or get system information. More...

Enumerations

enum  SystemUpdateID {
  SYSTEM_UPDATE_ID_WRITE_START = 0 , SYSTEM_UPDATE_ID_NETWORK = SYSTEM_UPDATE_ID_WRITE_START , SYSTEM_GET_ID_START = (1 << 4) , SYSTEM_GET_ID_NETWORK = SYSTEM_GET_ID_START ,
  SYSTEM_GET_ID_DIAGNOSTICS
}
 System update or get operation IDs. More...
 

Functions

MYRIOTA_USER_API int SystemUpdateStart (uint8_t ID, uint32_t Size, uint32_t Timeout)
 Initiate a system update or get request.
 
MYRIOTA_USER_API int SystemUpdateXfer (uint32_t Offset, uint8_t *Buf, size_t BufSize)
 System update or get data transfer.
 
MYRIOTA_USER_API int SystemUpdateFinish (void)
 Indicates the finish of the content transfer.
 

Detailed Description

Update or get system information.

Interface for user to update or retrieve selected system information. i.e. to update network information. It is recommended that the entire process done in a single task window.

Enumeration Type Documentation

◆ SystemUpdateID

System update or get operation IDs.

Enumerator
SYSTEM_UPDATE_ID_WRITE_START 

Start of system update operation IDs.

Update network information.

SYSTEM_UPDATE_ID_NETWORK 

Start of system get operation IDs.

SYSTEM_GET_ID_START 

Get network information.

SYSTEM_GET_ID_NETWORK 

Get diagnostics information.

Function Documentation

◆ SystemUpdateStart()

MYRIOTA_USER_API int SystemUpdateStart ( uint8_t  ID,
uint32_t  Size,
uint32_t  Timeout 
)

Initiate a system update or get request.

Pass 0 to Size for get operation. Update or get will be cancelled automatically when the Timeout expires.

Parameters
IDThe ID of the system update or get operation SystemUpdateID.
SizeThe size of the data to be transferred.
TimeoutThe maximum time in seconds for the entire operation.
Returns
For update operation: returns 0 if the update starts successfully and -1 if ID is unknown, Size is too big or there is an ongoing operation. For get operation: returns number of bytes to transfer if it starts successfully and -1 if ID is unknown, or there is an ongoing operation.

◆ SystemUpdateXfer()

MYRIOTA_USER_API int SystemUpdateXfer ( uint32_t  Offset,
uint8_t *  Buf,
size_t  BufSize 
)

System update or get data transfer.

For the best transfer speed, it is recommended that Offset and BufSize are set to multiple of 2048 bytes where possible.

Parameters
OffsetThe offset in the data buffer.
Buf[out]The data buffer.
BufSizeThe size of the data buffer.
Returns
For update operation: returns 0 if the transfer succeeds and -1 if it fails. For get operation: returns the number of bytes written to Buf if the transfer succeeds and -1 if it fails.

◆ SystemUpdateFinish()

MYRIOTA_USER_API int SystemUpdateFinish ( void  )

Indicates the finish of the content transfer.

For update operation, actual update will be performed if the transferred data are validated.

Returns
0 on success and -1 on failure.