BlueToe
an alternative GATT/BLE implementation
Loading...
Searching...
No Matches
Public Member Functions | List of all members
bluetoe::bootloader::bootloader_handler_prototype Class Reference

Prototype for a handler, that adapts the bootloader service to the actual hardware. More...

#include <bluetoe/services/bootloader.hpp>

Public Member Functions

bootloader::error_codes start_flash (std::uintptr_t address, const std::uint8_t *values, std::size_t size)
 
bootloader::error_codes run (std::uintptr_t start_addr)
 
bootloader::error_codes reset ()
 
std::pair< const std::uint8_t *, std::size_t > get_version ()
 
void read_mem (std::uintptr_t address, std::size_t size, std::uint8_t *destination)
 
std::uint32_t checksum32 (std::uintptr_t start_addr, std::size_t size)
 
std::uint32_t checksum32 (const std::uint8_t *start_addr, std::size_t size, std::uint32_t old_crc)
 
std::uint32_t checksum32 (std::uintptr_t start_addr)
 
bootloader::error_codes public_read_mem (std::uintptr_t address, std::size_t size, std::uint8_t *destination)
 
std::uint32_t public_checksum32 (std::uintptr_t start_addr, std::size_t size)
 version of checksum function, that will be directly called by the execution of the Get CRC procedure.
 
void control_point_notification_call_back ()
 technical required function, that have to call bootloader_control_point_notification(), with the instance of the server
 
void data_indication_call_back ()
 technical required function, that have to call bootloader_data_indication(), with the instance of the server
 

Detailed Description

Prototype for a handler, that adapts the bootloader service to the actual hardware.

Member Function Documentation

◆ checksum32() [1/3]

std::uint32_t bluetoe::bootloader::bootloader_handler_prototype::checksum32 ( const std::uint8_t *  start_addr,
std::size_t  size,
std::uint32_t  old_crc 
)

adds new data to the given crc

◆ checksum32() [2/3]

std::uint32_t bluetoe::bootloader::bootloader_handler_prototype::checksum32 ( std::uintptr_t  start_addr)

special overload to calculate the CRC over a start address

◆ checksum32() [3/3]

std::uint32_t bluetoe::bootloader::bootloader_handler_prototype::checksum32 ( std::uintptr_t  start_addr,
std::size_t  size 
)

calculate the checksum of the given range of memory.

◆ get_version()

std::pair< const std::uint8_t *, std::size_t > bluetoe::bootloader::bootloader_handler_prototype::get_version ( )

Return a custom string as response to the Get Version procedure. Make sure, that the response is not longer than 20 bytes, or othere wise it could get truncated on the link layer.

◆ public_checksum32()

std::uint32_t bluetoe::bootloader::bootloader_handler_prototype::public_checksum32 ( std::uintptr_t  start_addr,
std::size_t  size 
)

version of checksum function, that will be directly called by the execution of the Get CRC procedure.

Attention
If there are ranges that contain sensitiv information, make sure, that size is large enough, so that one can not get the content of the memory from the resulting CRC. In case, that such an attempt is detected, return a fixed value (0 for example).

◆ public_read_mem()

bootloader::error_codes bluetoe::bootloader::bootloader_handler_prototype::public_read_mem ( std::uintptr_t  address,
std::size_t  size,
std::uint8_t *  destination 
)

This function is used, when reading from memory, while the Read procedure is executed.

Attention
Make sure, that this function does not reveal any sensitiv information. Make sure, that address and size are resonable parameters.
Returns
an value != error_codes::success, if read access to the given range is not possible or not authorized.

◆ read_mem()

void bluetoe::bootloader::bootloader_handler_prototype::read_mem ( std::uintptr_t  address,
std::size_t  size,
std::uint8_t *  destination 
)

this is very handy, when it comes to testing...

◆ reset()

bootloader::error_codes bluetoe::bootloader::bootloader_handler_prototype::reset ( )

reset bootloader

◆ run()

bootloader::error_codes bluetoe::bootloader::bootloader_handler_prototype::run ( std::uintptr_t  start_addr)

Run the program given at start_addr

◆ start_flash()

bootloader::error_codes bluetoe::bootloader::bootloader_handler_prototype::start_flash ( std::uintptr_t  address,
const std::uint8_t *  values,
std::size_t  size 
)

Start to flash

When the hardware signals, that the memory is flashed, end_flash( server) have to be called on the server instance


The documentation for this class was generated from the following file: