class FastbootBase
Defined at line 70 of file ../../src/firmware/lib/fastboot/include/lib/fastboot/fastboot_base.h
An abstract base class for fastboot. It provides built in support for `fastboot download`
command. Implementation provide the download buffer by implementing GetDownloadBuffer() method.
It also provides a few utility helpers such as sending fastboot response and matching/parsing
fastboot commands. Other commands are implemented by overriding the ProcessCommand() method.
Public Methods
size_t total_download_size ()
Get the total and remaining download size when running `fastboot download` command.
Defined at line 80 of file ../../src/firmware/lib/fastboot/include/lib/fastboot/fastboot_base.h
size_t remaining_download_size ()
Defined at line 81 of file ../../src/firmware/lib/fastboot/include/lib/fastboot/fastboot_base.h
State state ()
Defined at line 82 of file ../../src/firmware/lib/fastboot/include/lib/fastboot/fastboot_base.h
zx::result<> ProcessPacket (Transport * transport)
Defined at line 93 of file ../../src/firmware/lib/fastboot/fastboot_base.cc
bool MatchCommand (std::string_view cmd, std::string_view ref)
Match an in-coming command `cmd` with a reference command `ref`
Defined at line 16 of file ../../src/firmware/lib/fastboot/fastboot_base.cc
bool MatchCommand (std::string_view cmd, std::string_view ref)
Match an in-coming command `cmd` with a reference command `ref`
Defined at line 16 of file ../../src/firmware/lib/fastboot/fastboot_base.cc
void ExtractCommandArgs (std::string_view cmd, const char * delimeter, CommandArgs & ret)
A helper to extract command arguments.
Defined at line 139 of file ../../src/firmware/lib/fastboot/fastboot_base.cc
void ExtractCommandArgs (std::string_view cmd, const char * delimeter, CommandArgs & ret)
A helper to extract command arguments.
Defined at line 139 of file ../../src/firmware/lib/fastboot/fastboot_base.cc
zx::result<> SendResponse (ResponseType resp_type, std::string_view message, Transport * transport, zx::result<> status_code)
A helper to send fastboot response message of type OKAY, INFO, and FAIL. Caller can specify
a failure code in `status_code` to add to the message. `status_code` will be merged into the
return status. Specifically, if response is successfully sent without error, `status_code` is
returned. Otherwise the error code while sending the message is returned. This is to make it
easier for callsite so that it doesn't have to check multiple error codes and decide which to
returns.
Defined at line 29 of file ../../src/firmware/lib/fastboot/fastboot_base.cc
zx::result<> SendResponse (ResponseType resp_type, std::string_view message, Transport * transport, zx::result<> status_code)
A helper to send fastboot response message of type OKAY, INFO, and FAIL. Caller can specify
a failure code in `status_code` to add to the message. `status_code` will be merged into the
return status. Specifically, if response is successfully sent without error, `status_code` is
returned. Otherwise the error code while sending the message is returned. This is to make it
easier for callsite so that it doesn't have to check multiple error codes and decide which to
returns.
Defined at line 29 of file ../../src/firmware/lib/fastboot/fastboot_base.cc
zx::result<> SendDataResponse (size_t data_size, Transport * transport)
Send a data response package "DATA<hex string of `datasize`>" i.e. DATA0x12345678
Defined at line 87 of file ../../src/firmware/lib/fastboot/fastboot_base.cc
zx::result<> SendDataResponse (size_t data_size, Transport * transport)
Send a data response package "DATA<hex string of `datasize`>" i.e. DATA0x12345678
Defined at line 87 of file ../../src/firmware/lib/fastboot/fastboot_base.cc
Enumerations
enum State
| Name | Value |
|---|---|
| kCommand | 0 |
| kDownload | 1 |
Defined at line 72 of file ../../src/firmware/lib/fastboot/include/lib/fastboot/fastboot_base.h
enum ResponseType
| Name | Value |
|---|---|
| kOkay | 0 |
| kInfo | 1 |
| kFail | 2 |
Defined at line 95 of file ../../src/firmware/lib/fastboot/include/lib/fastboot/fastboot_base.h