1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-29 19:08:12 +00:00
trezor-firmware/micropython/bootloader/protobuf.h

20 lines
435 B
C
Raw Normal View History

2017-04-15 15:44:19 +00:00
#ifndef __PROTOBUF_H__
#define __PROTOBUF_H__
#include <stdint.h>
#include <stdbool.h>
typedef struct {
uint8_t buf[64];
uint32_t size;
} PB_CTX;
void pb_start(PB_CTX *ctx, uint16_t msg_id);
const uint8_t *pb_build(PB_CTX *ctx);
void pb_add_bool(PB_CTX *ctx, const char *id, bool val);
void pb_add_string(PB_CTX *ctx, const char *id, const char *val);
void pb_add_varint(PB_CTX *ctx, const char *id, uint32_t val);
#endif