Communication#

Host communication interface.

The Communication component provides an interface for implementing communication with a host device, such as a computer or a microcontroller.

Communication Protocol Implementations#

Several components implement the communication interface, using different transports and protocols.

Modules#

UART XMODEM

BGAPI UART DFU

Bluetooth Apploader OTA DFU

EZSP-SPI

Utils

Functions#

void

Initialize hardware for the UART XMODEM Bootloader communication.

int32_t

Initialize communication between the UART XMODEM bootloader and external host.

int32_t
bootloader_xmodem_communication_main(ImageProperties_t *imageProps, const BootloaderParserCallbacks_t *parseCb)

Communication main for the UART XMODEM bootloader.

void

Initialize hardware for the BGAPI UART DFU Bootloader communication.

int32_t

Initialize communication between the BGAPI UART DFU bootloader and external host.

int32_t
bootloader_bgapi_communication_main(ImageProperties_t *imageProps, ParserContext_t *parserContext, const BootloaderParserCallbacks_t *parseCb)

Communication main for the BGAPI UART DFU bootloader.

void

Initialize hardware for the BLE Apploader OTA DFU Bootloader communication.

int32_t

Initialize communication between the BLE Apploader OTA DFU bootloader and external host.

int32_t
bootloader_apploader_communication_main(ImageProperties_t *imageProps, void *parserContext, void *decryptContext, void *authContext, const BootloaderParserCallbacks_t *parseCb)

Communication main for the BLE Apploader OTA DFU bootloader.

void
bootloader_apploader_get_custom_device_address(sl_apploader_address_t *btAddress)

Get custom device address.

void

Initialize hardware for the communication component.

int32_t

Initialize communication between the bootloader and external host.

int32_t

Not supposed to return until either the host signals the end of the current session or a new image has been flashed and verified.

void

Stop communication between the bootloader and external host.

void

Initialize hardware for the EZSP SPI Bootloader communication.

int32_t

Initialize communication between the EZSP SPI bootloader and external host.

int32_t
bootloader_ezsp_communication_main(ImageProperties_t *imageProps, ParserContext_t *parserContext, const BootloaderParserCallbacks_t *parseCb)

Communication main for the EZSP SPI bootloader.

void

Stop communication between the bootloader and external host.

Function Documentation#

bootloader_xmodem_communication_init#

void bootloader_xmodem_communication_init (void )

Initialize hardware for the UART XMODEM Bootloader communication.

Parameters
TypeDirectionArgument NameDescription
voidN/A

bootloader_xmodem_communication_start#

int32_t bootloader_xmodem_communication_start (void )

Initialize communication between the UART XMODEM bootloader and external host.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • Error code indicating success or failure.


bootloader_xmodem_communication_main#

int32_t bootloader_xmodem_communication_main (ImageProperties_t * imageProps, const BootloaderParserCallbacks_t * parseCb)

Communication main for the UART XMODEM bootloader.

Parameters
TypeDirectionArgument NameDescription
ImageProperties_t *N/AimageProps

The image file processed

const BootloaderParserCallbacks_t *N/AparseCb

Bootloader parser callbacks

Returns

  • Error code indicating success or failure.


bootloader_bgapi_communication_init#

void bootloader_bgapi_communication_init (void )

Initialize hardware for the BGAPI UART DFU Bootloader communication.

Parameters
TypeDirectionArgument NameDescription
voidN/A

bootloader_bgapi_communication_start#

int32_t bootloader_bgapi_communication_start (void )

Initialize communication between the BGAPI UART DFU bootloader and external host.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • Error code indicating success or failure.


bootloader_bgapi_communication_main#

int32_t bootloader_bgapi_communication_main (ImageProperties_t * imageProps, ParserContext_t * parserContext, const BootloaderParserCallbacks_t * parseCb)

Communication main for the BGAPI UART DFU bootloader.

Parameters
TypeDirectionArgument NameDescription
ImageProperties_t *N/AimageProps

The image file processed

ParserContext_t *N/AparserContext

Image parser context

const BootloaderParserCallbacks_t *N/AparseCb

Bootloader parser callbacks

Returns

  • Error code indicating success or failure.


bootloader_apploader_communication_init#

void bootloader_apploader_communication_init (void )

Initialize hardware for the BLE Apploader OTA DFU Bootloader communication.

Parameters
TypeDirectionArgument NameDescription
voidN/A

bootloader_apploader_communication_start#

int32_t bootloader_apploader_communication_start (void )

Initialize communication between the BLE Apploader OTA DFU bootloader and external host.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • Error code indicating success or failure.


bootloader_apploader_communication_main#

int32_t bootloader_apploader_communication_main (ImageProperties_t * imageProps, void * parserContext, void * decryptContext, void * authContext, const BootloaderParserCallbacks_t * parseCb)

Communication main for the BLE Apploader OTA DFU bootloader.

Parameters
TypeDirectionArgument NameDescription
ImageProperties_t *N/AimageProps

The image file processed

void *N/AparserContext

Image parser context

void *N/AdecryptContext

Image decryption context

void *N/AauthContext

Image authentication context

const BootloaderParserCallbacks_t *N/AparseCb

Bootloader parser callbacks

Returns

  • Error code indicating success or failure.


bootloader_apploader_get_custom_device_address#

void bootloader_apploader_get_custom_device_address (sl_apploader_address_t * btAddress)

Get custom device address.

Parameters
TypeDirectionArgument NameDescription
sl_apploader_address_t *N/AbtAddress

Device address

The address must be set in little endian format Default implementation of this function reads the address from MFG_CUSTOM_EUI_64 manufacturing token stored in user data page. The function can be overridden if custom implementation is wanted.


communication_init#

void communication_init (void )

Initialize hardware for the communication component.

Parameters
TypeDirectionArgument NameDescription
voidN/A

communication_start#

int32_t communication_start (void )

Initialize communication between the bootloader and external host.

Parameters
TypeDirectionArgument NameDescription
voidN/A

For example, indicate that all is well to the external host.

Returns

  • Error code indicating success or failure

Return values

  • BOOTLOADER_OK: on success

  • BOOTLOADER_ERROR_COMMUNICATION_START: on failure


communication_main#

int32_t communication_main (void )

Not supposed to return until either the host signals the end of the current session or a new image has been flashed and verified.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • Error code indicating success or failure

Return values

  • BOOTLOADER_OK: when a new image was flashed

  • BOOTLOADER_ERROR_COMMUNICATION_ERROR: on communication error

  • BOOTLOADER_ERROR_COMMUNICATION_DONE: when no image was received

  • BOOTLOADER_ERROR_COMMUNICATION_IMAGE_ERROR: when received image is invalid


communication_shutdown#

void communication_shutdown (void )

Stop communication between the bootloader and external host.

Parameters
TypeDirectionArgument NameDescription
voidN/A

bootloader_ezsp_communication_init#

void bootloader_ezsp_communication_init (void )

Initialize hardware for the EZSP SPI Bootloader communication.

Parameters
TypeDirectionArgument NameDescription
voidN/A

bootloader_ezsp_communication_start#

int32_t bootloader_ezsp_communication_start (void )

Initialize communication between the EZSP SPI bootloader and external host.

Parameters
TypeDirectionArgument NameDescription
voidN/A

Returns

  • Error code indicating success or failure.


bootloader_ezsp_communication_main#

int32_t bootloader_ezsp_communication_main (ImageProperties_t * imageProps, ParserContext_t * parserContext, const BootloaderParserCallbacks_t * parseCb)

Communication main for the EZSP SPI bootloader.

Parameters
TypeDirectionArgument NameDescription
ImageProperties_t *N/AimageProps

The image file processed

ParserContext_t *N/AparserContext

Image parser context

const BootloaderParserCallbacks_t *N/AparseCb

Bootloader parser callbacks

Returns

  • Error code indicating success or failure.


bootloader_ezsp_communication_shutdown#

void bootloader_ezsp_communication_shutdown (void )

Stop communication between the bootloader and external host.

Parameters
TypeDirectionArgument NameDescription
voidN/A