Functions
Functions
Collaboration diagram for Functions:

Functions

void m2m_flash_get_state (tstrFlashState *pstrState)
 Get information about the module current state and about the most recent access attempt. More...
 
sint8 m2m_flash_init (void)
 Initialize the module. More...
 
sint8 m2m_flash_readimage (tenuImageId enuImageId, uint16 u16Id, tpfDataAccessFn pfDestFn, uint32 u32DestSize)
 Read a WINC firmware image. More...
 
sint8 m2m_flash_rootcert_add (uint16 u16Id, tpfDataAccessFn pfFn, uint32 u32Size)
 Add an entry to the WINC TLS root certificate store. More...
 
sint8 m2m_flash_rootcert_read (uint16 u16Id, tpfDataAccessFn pfDestFn, uint32 u32DestSize, uint8 *pu8Identifier, uint32 u32IdentifierSz)
 Read an entry from the WINC TLS root certificate store, referenced by entry identifier. More...
 
sint8 m2m_flash_rootcert_readidx (uint16 u16Id, tpfDataAccessFn pfDestFn, uint32 u32DestSize, uint8 u8Index)
 Read an entry from the WINC TLS root certificate store, referenced by entry index. More...
 
sint8 m2m_flash_rootcert_remove (uint16 u16Id, uint8 *pu8Identifier, uint32 u32IdentifierSz)
 Remove an entry from the WINC TLS root certificate store. More...
 
sint8 m2m_flash_updateimage (uint8 u8Options, uint16 u16Id, tpfDataAccessFn pfSourceFn, uint32 u32SourceSize)
 Write/validate/switch a WINC firmware image. More...
 

Detailed Description

Function Documentation

◆ m2m_flash_get_state()

void m2m_flash_get_state ( tstrFlashState pstrState)

Get information about the module current state and about the most recent access attempt.

Parameters
[out]pstrStateModule state and most recent access attempt info.
Returns
None.

Definition at line 487 of file m2m_flash.c.

◆ m2m_flash_init()

sint8 m2m_flash_init ( void  )

Initialize the module.

Warning
This API must be called at a particular point during MCU application initialization.
See also
m2m_wifi_init
m2m_wifi_init_hold
m2m_wifi_init_start

Example

This example demonstrates how to add m2m_flash_init and m2m_flash_get_state to MCU application initialization code.

Original code:

{
sint8 status = 0;
status = m2m_wifi_init(param);
if (status != 0)
{
// Wifi init failed.
}
}

New code:

{
tstrWifiInitParam param = {...}
sint8 status = 0;
status = m2m_wifi_init_hold();
if (status == 0)
{
tstrFlashState strFlashState;
m2m_flash_get_state(&strFlashState);
printf("FlashAccess:%x:%d%d\n", strFlashState.u16LastAccessId, strFlashState.u8Success, strFlashState.u8Changed);
switch (strFlashState.u16LastAccessId)
{
// Application code dependent on meaning of u16LastAccessId.
}
status = m2m_wifi_init_start(param);
}
if (status != 0)
{
// Wifi init failed.
}
}
Returns
Zero for successful initialization of module. Negative value otherwise.

Definition at line 540 of file m2m_flash.c.

◆ m2m_flash_readimage()

sint8 m2m_flash_readimage ( tenuImageId  enuImageId,
uint16  u16Id,
tpfDataAccessFn  pfDestFn,
uint32  u32DestSize 
)

Read a WINC firmware image.

Parameters
[in]enuImageIdWhich partition to read image from.
[in]u16IdTransfer identifier, not interpreted by this module.
[in]pfDestFnFunction for the module to call to send the image to the MCU application.
[in]u32DestSizeSize of the memory available to the MCU application for storing the image.
Returns
Zero indicates success. Negative values indicate failure.

◆ m2m_flash_rootcert_add()

sint8 m2m_flash_rootcert_add ( uint16  u16Id,
tpfDataAccessFn  pfSourceFn,
uint32  u32SourceSize 
)

Add an entry to the WINC TLS root certificate store.

Parameters
[in]u16IdTransfer identifier, not interpreted by this module.
[in]pfSourceFnFunction for the module to call to obtain the certificate entry from the MCU application.
[in]u32SourceSizeSize of the certificate entry being provided by the MCU application.
Note
The data location to be accessed via pfSourceFn contains the entry to be added. The format of a TLS root certificate entry is:
Name Offset Length Contents
Key 36 KeyLength Public key and padding
Padding 36+KeyLength PadLength 0xFF
For RSA public keys, the format of Key is:
Name Offset Length
Modulus 36 ModLength RSA modulus, with leading 0s stripped off
Exponent 36+ModLength ExpLength Public exponent, with leading 0s stripped off
In this case PadLength is the amount of padding that would be required for 4-byte alignment of Modulus plus the amount of padding that would be required for 4-byte alignment of Exponent.
For ECDSA public keys, the format of Key is:
Name Offset Length
X Coord 36 CoordLength Public key X-coordinate
Y Coord 36+CoordLength CoordLength Public key Y-coordinate
In this case PadLength is the amount of padding that would be required for 4-byte alignment of X Coord plus the amount of padding that would be required for 4-byte alignment of Y Coord.
Returns
Zero indicates success. Negative values indicate failure.

Definition at line 441 of file m2m_flash.c.

◆ m2m_flash_rootcert_read()

sint8 m2m_flash_rootcert_read ( uint16  u16Id,
tpfDataAccessFn  pfDestFn,
uint32  u32DestSize,
uint8 pu8Identifier,
uint32  u32IdentifierSz 
)

Read an entry from the WINC TLS root certificate store, referenced by entry identifier.

Parameters
[in]u16IdTransfer identifier, not interpreted by this module.
[in]pfDestFnFunction for the module to call to send the certificate entry to the MCU application.
[in]u32DestSizeSize of the memory available to the MCU application for storing the entry.
[in]pu8IdentifierIdentifier for the entry to be read. This is the SHA1 digest of the certificate issuer name.
[in]u32IdentifierSzSize of the identifier (20).
Returns
Zero indicates success. Negative values indicate failure.

Definition at line 461 of file m2m_flash.c.

◆ m2m_flash_rootcert_readidx()

sint8 m2m_flash_rootcert_readidx ( uint16  u16Id,
tpfDataAccessFn  pfDestFn,
uint32  u32DestSize,
uint8  u8Index 
)

Read an entry from the WINC TLS root certificate store, referenced by entry index.

Parameters
[in]u16IdTransfer identifier, not interpreted by this module.
[in]pfDestFnFunction for the module to call to send the certificate entry to the MCU application.
[in]u32DestSizeSize of the memory available to the MCU application for storing the entry.
[in]u8IndexZero-based index of the entry to be read.
Returns
Zero indicates success. Negative values indicate failure.

Definition at line 477 of file m2m_flash.c.

◆ m2m_flash_rootcert_remove()

sint8 m2m_flash_rootcert_remove ( uint16  u16Id,
uint8 pu8Identifier,
uint32  u32IdentifierSz 
)

Remove an entry from the WINC TLS root certificate store.

Parameters
[in]u16IdTransfer identifier, not interpreted by this module.
[in]pu8IdentifierIdentifier for the entry to be removed. This is the SHA1 digest of the certificate issuer name.
[in]u32IdentifierSzSize of the identifier (20).
Returns
Zero indicates success. Negative values indicate failure.

Definition at line 450 of file m2m_flash.c.

◆ m2m_flash_updateimage()

sint8 m2m_flash_updateimage ( uint8  u8Options,
uint16  u16Id,
tpfDataAccessFn  pfSourceFn,
uint32  u32SourceSize 
)

Write/validate/switch a WINC firmware image.

Parameters
[in]u8OptionsFlags indicating the required combination of write / validate / switch.
[in]u16IdTransfer identifier, not interpreted by this module.
[in]pfSourceFnFunction for the module to call to obtain the image from the MCU application.
[in]u32SourceSizeSize of the image being provided by the MCU application.
See also
FLASH_UPDATEIMAGE_OPTION_UPDATE
FLASH_UPDATEIMAGE_OPTION_VALIDATE
FLASH_UPDATEIMAGE_OPTION_SWITCH
Returns
Zero indicates success. Negative values indicate failure.

Definition at line 224 of file m2m_flash.c.



inertial_sense_ros
Author(s):
autogenerated on Sun Feb 28 2021 03:18:00