Midnight Sun Firmware
Loading...
Searching...
No Matches
Bootloader_packet_handler

bootloader_packet_handler Firmware More...

Collaboration diagram for Bootloader_packet_handler:

Classes

struct  PacketManager
 Stores info related to receiving data. More...
 

Functions

BootloaderError packet_handler_init (PacketManager *pm)
 Initialize the PacketManager struct. More...
 
BootloaderError bootloader_start (PacketManager *pm, BootloaderDatagram *datagram)
 Function call for the BOOTLOADER_START state. More...
 
BootloaderError bootloader_receive_data (PacketManager *pm, BootloaderDatagram *datagram, uint8_t *flash_buffer)
 Function call for the BOOTLOADER_DATA_RECEIVE state. More...
 
BootloaderError bootloader_wait_sequencing (PacketManager *pm, BootloaderDatagram *datagram)
 Function call for BOOTLOADER_WAIT_SEQUENCING state. More...
 
BootloaderError bootloader_ping (PacketManager *pm, BootloaderDatagram *datagram, uint8_t *flash_buffer)
 Function call for the BOOTLOADER_PING state. More...
 

Detailed Description

bootloader_packet_handler Firmware

Function Documentation

◆ bootloader_ping()

BootloaderError bootloader_ping ( PacketManager pm,
BootloaderDatagram datagram,
uint8_t *  flash_buffer 
)

Function call for the BOOTLOADER_PING state.

Sends over misc data (Not yet completed)

Parameters
pmBelieve it or not, it is a pointer to the PacketManager struct
datagramPointer to the incoming datagram
flash_bufferThe current buffer to be flashed
Returns
BOOTLOADER_ERROR_NONE if successful

◆ bootloader_receive_data()

BootloaderError bootloader_receive_data ( PacketManager pm,
BootloaderDatagram datagram,
uint8_t *  flash_buffer 
)

Function call for the BOOTLOADER_DATA_RECEIVE state.

Receives incoming chunks, if buffer is the size of one page, flash onto board

Parameters
pmPointer to the PacketManager struct
datagramA pointer to the incoming datagram
flash_bufferThe current buffer to be flashed
Returns
BOOTLOADER_ERROR_NONE if successful

◆ bootloader_start()

BootloaderError bootloader_start ( PacketManager pm,
BootloaderDatagram datagram 
)

Function call for the BOOTLOADER_START state.

Primes everything to start receiving data

Parameters
pmPointer to the PacketManager struct
datagramA pointer to the incoming datagram
Returns
BOOTLOADER_DATA_NOT_ALIGNED, BOOTLOADER_ERROR_NONE

◆ bootloader_wait_sequencing()

BootloaderError bootloader_wait_sequencing ( PacketManager pm,
BootloaderDatagram datagram 
)

Function call for BOOTLOADER_WAIT_SEQUENCING state.

Validates datagram packets, in terms of sequencing, to ensure packets were not missed

Parameters
pmPointer to the PacketManager struct
datagramPointer to incoming datagram
Returns
BOOTLOADER_ERROR_NONE if successful else BOOTLOADER_SEQUENCE_ERROR

◆ packet_handler_init()

BootloaderError packet_handler_init ( PacketManager pm)

Initialize the PacketManager struct.

Parameters
pmA pointer to the PacketManager struct
Returns
BOOTLOADER_ERROR_NONE on success