|
Android-cuttlefish cvd tool
|
Namespaces | |
| namespace | impl |
Classes | |
| struct | ParsedPacket |
| struct | PayloadHeader |
Typedefs | |
| using | BufferType = std::vector< uint8_t > |
| using | Payload = std::tuple< PayloadHeader, BufferType > |
| using | ConfUiPacketInfo = std::vector< std::vector< uint8_t > > |
Functions | |
| static std::optional< std::vector< uint8_t > > | ReadRawData (SharedFD s) |
| static std::optional< ParsedPacket > | ParseRawData (const std::vector< uint8_t > &data_to_parse) |
| std::optional< ParsedPacket > | ReadPayload (SharedFD s) |
| template<typename... Args> | |
| bool | WritePayload (SharedFD d, const std::string &cmd_str, const std::string &session_id, Args &&... args) |
| std::string | ToString (const ParsedPacket &packet) |
Variables | |
| constexpr const ssize_t | kMaxPayloadLength = 10000 |
| using cuttlefish::confui::packet::BufferType = typedef std::vector<uint8_t> |
| using cuttlefish::confui::packet::ConfUiPacketInfo = typedef std::vector<std::vector<uint8_t> > |
| using cuttlefish::confui::packet::Payload = typedef std::tuple<PayloadHeader, BufferType> |
|
static |
Here is how the raw data, i.e. tokens[2:] looks like
n:l[0]:l[1]:l[2]:...:l[n-1]:data[0]data[1]data[2]...data[n]
Thus it basically has the number of items, the lengths of each item, and the byte representation of each item. n and l[i] are separated by ':' Note that the byte representation may have ':' in it. This could mess up the parsing if we totally depending on ':' separation.
However, it is safe to assume that there's no ':' inside n or the string for l[i]. So, we do anyway split the data_to_parse by ':', and take n and from l[0] through l[n-1] only.
| std::optional< ParsedPacket > cuttlefish::confui::packet::ReadPayload | ( | SharedFD | s | ) |
|
static |
| std::string cuttlefish::confui::packet::ToString | ( | const ParsedPacket & | packet | ) |
| bool cuttlefish::confui::packet::WritePayload | ( | SharedFD | d, |
| const std::string & | cmd_str, | ||
| const std::string & | session_id, | ||
| Args &&... | args | ||
| ) |
|
constexpr |