openpilot

opendbc

class CANPacker

Public Functions

CANPacker(const std::string &dbc_name)
std::vector<uint8_t> pack(uint32_t address, const std::vector<SignalPackValue> &values)
Msg *lookup_message(uint32_t address)

Private Members

const DBC *dbc = NULL
std::map<std::pair<uint32_t, std::string>, Signal> signal_lookup
std::map<uint32_t, Msg> message_lookup
std::map<uint32_t, uint32_t> counters
class CANParser

Public Functions

CANParser(int abus, const std::string &dbc_name, const std::vector<std::pair<uint32_t, int>> &messages)
CANParser(int abus, const std::string &dbc_name, bool ignore_checksum, bool ignore_counter)
void update_string(const std::string &data, bool sendcan)
void update_strings(const std::vector<std::string> &data, std::vector<SignalValue> &vals, bool sendcan)
void UpdateCans(uint64_t nanos, const capnp::List<cereal::CanData>::Reader &cans)
void UpdateCans(uint64_t nanos, const capnp::DynamicStruct::Reader &cans)
void UpdateValid(uint64_t nanos)
void query_latest(std::vector<SignalValue> &vals, uint64_t last_ts = 0)

Public Members

bool can_valid = false
bool bus_timeout = false
uint64_t first_nanos = 0
uint64_t last_nanos = 0
uint64_t last_nonempty_nanos = 0
uint64_t bus_timeout_threshold = 0
uint64_t can_invalid_cnt = CAN_INVALID_CNT

Private Members

const int bus
kj::Array<capnp::word> aligned_buf
const DBC *dbc = NULL
std::unordered_map<uint32_t, MessageState> message_states
class MessageState

Public Functions

bool parse(uint64_t nanos, const std::vector<uint8_t> &dat)
bool update_counter_generic(int64_t v, int cnt_size)

Public Members

std::string name
uint32_t address
unsigned int size
std::vector<Signal> parse_sigs
std::vector<double> vals
std::vector<std::vector<double>> all_vals
uint64_t last_seen_nanos
uint64_t check_threshold
uint8_t counter
uint8_t counter_fail
bool ignore_checksum = false
bool ignore_counter = false
file common.h
#include <map>
#include <string>
#include <utility>
#include <unordered_map>
#include <vector>
#include <capnp/dynamic.h>
#include <capnp/serialize.h>
#include “cereal/gen/cpp/log.capnp.h”
#include “opendbc/can/common_dbc.h”

Defines

INFO
WARN
DEBUG(...)
MAX_BAD_COUNTER
CAN_INVALID_CNT

Functions

void init_crc_lookup_tables()
unsigned int honda_checksum(uint32_t address, const Signal &sig, const std::vector<uint8_t> &d)
unsigned int toyota_checksum(uint32_t address, const Signal &sig, const std::vector<uint8_t> &d)
unsigned int subaru_checksum(uint32_t address, const Signal &sig, const std::vector<uint8_t> &d)
unsigned int chrysler_checksum(uint32_t address, const Signal &sig, const std::vector<uint8_t> &d)
unsigned int volkswagen_mqb_checksum(uint32_t address, const Signal &sig, const std::vector<uint8_t> &d)
unsigned int xor_checksum(uint32_t address, const Signal &sig, const std::vector<uint8_t> &d)
unsigned int hkg_can_fd_checksum(uint32_t address, const Signal &sig, const std::vector<uint8_t> &d)
unsigned int pedal_checksum(uint32_t address, const Signal &sig, const std::vector<uint8_t> &d)
dir /tmp/openpilot/opendbc/can
dir /tmp/openpilot/opendbc

cereal

messaging

class AlignedBuffer

Public Functions

kj::ArrayPtr<const capnp::word> align(const char *data, const size_t size)
kj::ArrayPtr<const capnp::word> align(Message *m)

Private Members

kj::Array<capnp::word> aligned_buf
size_t words_size
class Context

Subclassed by MSGQContext, ZMQContext

Public Functions

virtual void *getRawContext() = 0
virtual ~Context()

Public Static Functions

static Context *create()
class Event

Public Functions

Event(int fd = -1)
void set() const
int clear() const
void wait(int timeout_sec = -1) const
bool peek() const
bool is_valid() const
int fd() const

Public Static Functions

static int wait_for_one(const std::vector<Event> &events, int timeout_sec = -1)

Private Functions

void throw_if_invalid() const

Private Members

int event_fd = -1
struct EventState

Public Members

int fds[2]
bool enabled
class FakePoller : public Poller

Public Functions

void registerSocket(SubSocket *socket)
std::vector<SubSocket*> poll(int timeout)
~FakePoller()

Private Members

std::vector<SubSocket*> sockets
template<typename TSubSocket>
class FakeSubSocket : public TSubSocket

Public Functions

FakeSubSocket()
~FakeSubSocket()
int connect(Context *context, std::string endpoint, std::string address, bool conflate = false, bool check_endpoint = true)
Message *receive(bool non_blocking = false)

Private Members

Event *recv_called = nullptr
Event *recv_ready = nullptr
EventState *state = nullptr
class Message

Subclassed by MSGQMessage, ZMQMessage

Public Functions

virtual void init(size_t size) = 0
virtual void init(char *data, size_t size) = 0
virtual void close() = 0
virtual size_t getSize() = 0
virtual char *getData() = 0
virtual ~Message()
class MessageBuilder : public MallocMessageBuilder

Public Functions

MessageBuilder()
cereal::Event::Builder initEvent(bool valid = true)
kj::ArrayPtr<capnp::byte> toBytes()
size_t getSerializedSize()
int serializeToBuffer(unsigned char *buffer, size_t buffer_size)

Private Members

kj::Array<capnp::word> heapArray_
struct msgq_header_t

Public Members

uint64_t num_readers
uint64_t write_pointer
uint64_t write_uid
uint64_t read_pointers[NUM_READERS]
uint64_t read_valids[NUM_READERS]
uint64_t read_uids[NUM_READERS]
struct msgq_msg_t

Public Members

size_t size
char *data
struct msgq_pollitem_t

Public Members

msgq_queue_t *q
int revents
struct msgq_queue_t

Public Members

std::atomic<uint64_t> *num_readers
std::atomic<uint64_t> *write_pointer
std::atomic<uint64_t> *write_uid
std::atomic<uint64_t> *read_pointers[NUM_READERS]
std::atomic<uint64_t> *read_valids[NUM_READERS]
std::atomic<uint64_t> *read_uids[NUM_READERS]
char *mmap_p
char *data
size_t size
int reader_id
uint64_t read_uid_local
uint64_t write_uid_local
bool read_conflate
std::string endpoint
class MSGQContext : public Context

Public Functions

MSGQContext()
void *getRawContext()
~MSGQContext()

Private Members

void *context = NULL
class MSGQMessage : public Message

Public Functions

void init(size_t size)
void init(char *data, size_t size)
void takeOwnership(char *data, size_t size)
size_t getSize()
char *getData()
void close()
~MSGQMessage()

Private Members

char *data
size_t size
class MSGQPoller : public Poller

Public Functions

void registerSocket(SubSocket *socket)
std::vector<SubSocket*> poll(int timeout)
~MSGQPoller()

Private Members

std::vector<SubSocket*> sockets
msgq_pollitem_t polls[MAX_POLLERS]
size_t num_polls = 0
class MSGQPubSocket : public PubSocket

Public Functions

int connect(Context *context, std::string endpoint, bool check_endpoint = true)
int sendMessage(Message *message)
int send(char *data, size_t size)
bool all_readers_updated()
~MSGQPubSocket()

Private Members

msgq_queue_t *q = NULL
class MSGQSubSocket : public SubSocket

Public Functions

int connect(Context *context, std::string endpoint, std::string address, bool conflate = false, bool check_endpoint = true)
void setTimeout(int timeout)
void *getRawSocket()
Message *receive(bool non_blocking = false)
~MSGQSubSocket()

Private Members

msgq_queue_t *q = NULL
int timeout
class Poller

Subclassed by FakePoller, MSGQPoller, ZMQPoller

Public Functions

virtual void registerSocket(SubSocket *socket) = 0
virtual std::vector<SubSocket*> poll(int timeout) = 0
virtual ~Poller()

Public Static Functions

static Poller *create()
static Poller *create(std::vector<SubSocket*> sockets)
class PubMaster

Public Functions

PubMaster(const std::vector<const char*> &service_list)
int send(const char *name, capnp::byte *data, size_t size)
int send(const char *name, MessageBuilder &msg)
~PubMaster()

Private Members

std::map<std::string, PubSocket*> sockets_
class PubSocket

Subclassed by MSGQPubSocket, ZMQPubSocket

Public Functions

virtual int connect(Context *context, std::string endpoint, bool check_endpoint = true) = 0
virtual int sendMessage(Message *message) = 0
virtual int send(char *data, size_t size) = 0
virtual bool all_readers_updated() = 0
virtual ~PubSocket()

Public Static Functions

static PubSocket *create()
static PubSocket *create(Context *context, std::string endpoint, bool check_endpoint = true)
static PubSocket *create(Context *context, std::string endpoint, int port, bool check_endpoint = true)
class SocketEventHandle

Public Functions

SocketEventHandle(std::string endpoint, std::string identifier = "", bool override = true)
~SocketEventHandle()
bool is_enabled()
void set_enabled(bool enabled)
Event recv_called()
Event recv_ready()

Public Static Functions

static void toggle_fake_events(bool enabled)
static void set_fake_prefix(std::string prefix)
static std::string fake_prefix()

Private Members

std::string shm_path
EventState *state
class SubMaster

Public Functions

SubMaster(const std::vector<const char*> &service_list, const std::vector<const char*> &poll = {}, const char *address = nullptr, const std::vector<const char*> &ignore_alive = {})
void update(int timeout = 1000)
void update_msgs(uint64_t current_time, const std::vector<std::pair<std::string, cereal::Event::Reader>> &messages)
bool allAlive(const std::vector<const char*> &service_list = {})
bool allValid(const std::vector<const char*> &service_list = {})
bool allAliveAndValid(const std::vector<const char*> &service_list = {})
void drain()
~SubMaster()
bool updated(const char *name) const
bool alive(const char *name) const
bool valid(const char *name) const
uint64_t rcv_frame(const char *name) const
uint64_t rcv_time(const char *name) const
cereal::Event::Reader &operator[](const char *name) const

Public Members

uint64_t frame = 0

Private Functions

bool all_(const std::vector<const char*> &service_list, bool valid, bool alive)

Private Members

Poller *poller_ = nullptr
std::map<SubSocket*, SubMessage*> messages_
std::map<std::string, SubMessage*> services_
class SubSocket

Subclassed by MSGQSubSocket, ZMQSubSocket

Public Functions

virtual int connect(Context *context, std::string endpoint, std::string address, bool conflate = false, bool check_endpoint = true) = 0
virtual void setTimeout(int timeout) = 0
virtual Message *receive(bool non_blocking = false) = 0
virtual void *getRawSocket() = 0
virtual ~SubSocket()

Public Static Functions

static SubSocket *create()
static SubSocket *create(Context *context, std::string endpoint, std::string address = "127.0.0.1", bool conflate = false, bool check_endpoint = true)
class ZMQContext : public Context

Public Functions

ZMQContext()
void *getRawContext()
~ZMQContext()

Private Members

void *context = NULL
class ZMQMessage : public Message

Public Functions

void init(size_t size)
void init(char *data, size_t size)
size_t getSize()
char *getData()
void close()
~ZMQMessage()

Private Members

char *data
size_t size
class ZMQPoller : public Poller

Public Functions

void registerSocket(SubSocket *socket)
std::vector<SubSocket*> poll(int timeout)
~ZMQPoller()

Private Members

std::vector<SubSocket*> sockets
zmq_pollitem_t polls[MAX_POLLERS]
size_t num_polls = 0
class ZMQPubSocket : public PubSocket

Public Functions

int connect(Context *context, std::string endpoint, bool check_endpoint = true)
int sendMessage(Message *message)
int send(char *data, size_t size)
bool all_readers_updated()
~ZMQPubSocket()

Private Members

void *sock
std::string full_endpoint
int pid = -1
class ZMQSubSocket : public SubSocket

Public Functions

int connect(Context *context, std::string endpoint, std::string address, bool conflate = false, bool check_endpoint = true)
void setTimeout(int timeout)
void *getRawSocket()
Message *receive(bool non_blocking = false)
~ZMQSubSocket()

Private Members

void *sock
std::string full_endpoint
file event.h
#include <string>
#include <vector>

Defines

CEREAL_EVENTS_PREFIX

Enums

enum EventPurpose

Values:

enumerator RECV_CALLED
enumerator RECV_READY

Functions

void event_state_shm_mmap(std::string endpoint, std::string identifier, char **shm_mem, std::string *shm_path)
file impl_fake.h
#include <cassert>
#include <iostream>
#include <string>
#include <vector>
#include <filesystem>
#include <sys/mman.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include “cereal/messaging/event.h
file impl_msgq.h
#include <string>
#include <vector>
#include “cereal/messaging/msgq.h

Defines

MAX_POLLERS
file impl_zmq.h
#include <zmq.h>
#include <string>
#include <vector>

Defines

MAX_POLLERS
file messaging.h
#include <cstddef>
#include <map>
#include <string>
#include <vector>
#include <utility>
#include <time.h>
#include <capnp/serialize.h>
#include “cereal/gen/cpp/log.capnp.h”

Defines

MSG_MULTIPLE_PUBLISHERS

Functions

bool messaging_use_zmq()
file msgq.h
#include <cstdint>
#include <cstring>
#include <string>
#include <atomic>

Defines

DEFAULT_SEGMENT_SIZE
NUM_READERS
ALIGN(n)
UNUSED(x)
UNPACK64(higher, lower, input)
PACK64(output, higher, lower)

Functions

void msgq_wait_for_subscriber(msgq_queue_t *q)
void msgq_reset_reader(msgq_queue_t *q)
int msgq_msg_init_size(msgq_msg_t *msg, size_t size)
int msgq_msg_init_data(msgq_msg_t *msg, char *data, size_t size)
int msgq_msg_close(msgq_msg_t *msg)
int msgq_new_queue(msgq_queue_t *q, const char *path, size_t size)
void msgq_close_queue(msgq_queue_t *q)
void msgq_init_publisher(msgq_queue_t *q)
void msgq_init_subscriber(msgq_queue_t *q)
int msgq_msg_send(msgq_msg_t *msg, msgq_queue_t *q)
int msgq_msg_recv(msgq_msg_t *msg, msgq_queue_t *q)
int msgq_msg_ready(msgq_queue_t *q)
int msgq_poll(msgq_pollitem_t *items, size_t nitems, int timeout)
bool msgq_all_readers_updated(msgq_queue_t *q)
dir /tmp/openpilot/cereal
dir /tmp/openpilot/cereal/messaging

visionipc

class VisionBuf

Public Functions

void allocate(size_t len)
void import()
void init_cl(cl_device_id device_id, cl_context ctx)
void init_rgb(size_t width, size_t height, size_t stride)
void init_yuv(size_t width, size_t height, size_t stride, size_t uv_offset)
int sync(int dir)
int free()
void set_frame_id(uint64_t id)
uint64_t get_frame_id()

Public Members

size_t len = 0
size_t mmap_len = 0
void *addr = nullptr
uint64_t *frame_id
int fd = 0
bool rgb = false
size_t width = 0
size_t height = 0
size_t stride = 0
size_t uv_offset = 0
uint8_t *y = nullptr
uint8_t *uv = nullptr
uint64_t server_id = 0
size_t idx = 0
VisionStreamType type
cl_mem buf_cl = nullptr
cl_command_queue copy_q = nullptr
int handle = 0
class VisionIpcClient

Public Functions

VisionIpcClient(std::string name, VisionStreamType type, bool conflate, cl_device_id device_id = nullptr, cl_context ctx = nullptr)
~VisionIpcClient()
VisionBuf *recv(VisionIpcBufExtra *extra = nullptr, const int timeout_ms = 100)
bool connect(bool blocking = true)
bool is_connected()

Public Members

bool connected = false
VisionStreamType type
int num_buffers = 0
VisionBuf buffers[VISIONIPC_MAX_FDS]

Public Static Functions

static std::set<VisionStreamType> getAvailableStreams(const std::string &name, bool blocking = true)

Private Members

std::string name
Context *msg_ctx
SubSocket *sock
Poller *poller
cl_device_id device_id = nullptr
cl_context ctx = nullptr
class VisionIpcServer

Public Functions

VisionIpcServer(std::string name, cl_device_id device_id = nullptr, cl_context ctx = nullptr)
~VisionIpcServer()
VisionBuf *get_buffer(VisionStreamType type)
void create_buffers(VisionStreamType type, size_t num_buffers, bool rgb, size_t width, size_t height)
void create_buffers_with_sizes(VisionStreamType type, size_t num_buffers, bool rgb, size_t width, size_t height, size_t size, size_t stride, size_t uv_offset)
void send(VisionBuf *buf, VisionIpcBufExtra *extra, bool sync = true)
void start_listener()

Private Functions

void listener(void)

Private Members

cl_device_id device_id = nullptr
cl_context ctx = nullptr
uint64_t server_id
std::atomic<bool> should_exit = false
std::string name
std::thread listener_thread
std::map<VisionStreamType, std::atomic<size_t>> cur_idx
std::map<VisionStreamType, std::vector<VisionBuf*>> buffers
Context *msg_ctx
std::map<VisionStreamType, PubSocket*> sockets
file ipc.h
#include <cstddef>

Functions

int ipc_connect(const char *socket_path)
int ipc_bind(const char *socket_path)
int ipc_sendrecv_with_fds(bool send, int fd, void *buf, size_t buf_size, int *fds, int num_fds, int *out_num_fds)
file visionbuf.h
#include “cereal/visionipc/visionipc.h”
#include <CL/cl.h>

Defines

CL_USE_DEPRECATED_OPENCL_1_2_APIS
VISIONBUF_SYNC_FROM_DEVICE
VISIONBUF_SYNC_TO_DEVICE

Enums

enum VisionStreamType

Values:

enumerator VISION_STREAM_ROAD
enumerator VISION_STREAM_DRIVER
enumerator VISION_STREAM_WIDE_ROAD
enumerator VISION_STREAM_MAP
enumerator VISION_STREAM_MAX

Functions

void visionbuf_compute_aligned_width_and_height(int width, int height, int *aligned_w, int *aligned_h)
file visionipc_client.h
#include <set>
#include <string>
#include “cereal/messaging/messaging.h”
file visionipc_server.h
#include <vector>
#include <string>
#include <thread>
#include <atomic>
#include <map>
#include “cereal/messaging/messaging.h”

Functions

std::string get_endpoint_name(std::string name, VisionStreamType type)
std::string get_ipc_path(const std::string &name)
dir /tmp/openpilot/cereal
dir /tmp/openpilot/cereal/visionipc

selfdrive

camerad

class CameraBuf

Public Functions

CameraBuf()
~CameraBuf()
void init(cl_device_id device_id, cl_context context, CameraState *s, VisionIpcServer *v, int frame_cnt, VisionStreamType type)
bool acquire()
void queue(size_t buf_idx)

Public Members

cl_command_queue q
FrameMetadata cur_frame_data
VisionBuf *cur_yuv_buf
VisionBuf *cur_camera_buf
std::unique_ptr<VisionBuf[]> camera_bufs
std::unique_ptr<FrameMetadata[]> camera_bufs_metadata
int rgb_width
int rgb_height

Private Members

VisionIpcServer *vipc_server
Debayer *debayer = nullptr
VisionStreamType stream_type
int cur_buf_idx
SafeQueue<int> safe_queue
int frame_buf_count
class CameraState

Public Functions

void handle_camera_event(void *evdat)
void update_exposure_score(float desired_ev, int exp_t, int exp_g_idx, float exp_gain)
void set_camera_exposure(float grey_frac)
void sensors_start()
void camera_open(MultiCameraState *multi_cam_state, int camera_num, bool enabled)
void sensor_set_parameters()
void camera_map_bufs(MultiCameraState *s)
void camera_init(MultiCameraState *s, VisionIpcServer *v, cl_device_id device_id, cl_context ctx, VisionStreamType yuv_type)
void camera_close()
void config_isp(int io_mem_handle, int fence, int request_id, int buf0_mem_handle, int buf0_offset)
void enqueue_req_multi(int start, int n, bool dp)
void enqueue_buffer(int i, bool dp)
int clear_req_queue()
int sensors_init()
void sensors_poke(int request_id)
void sensors_i2c(const struct i2c_random_wr_payload *dat, int len, int op_code, bool data_word)

Public Members

MultiCameraState *multi_cam_state
std::unique_ptr<const SensorInfo> ci
bool enabled
std::mutex exp_lock
int exposure_time
bool dc_gain_enabled
int dc_gain_weight
int gain_idx
float analog_gain_frac
float cur_ev[3]
float best_ev_score
int new_exp_g
int new_exp_t
float measured_grey_fraction
float target_grey_fraction
unique_fd sensor_fd
unique_fd csiphy_fd
int camera_num
int32_t session_handle
int32_t sensor_dev_handle
int32_t isp_dev_handle
int32_t csiphy_dev_handle
int buf0_handle
int buf_handle[FRAME_BUF_COUNT]
int sync_objs[FRAME_BUF_COUNT]
int request_ids[FRAME_BUF_COUNT]
int request_id_last
int frame_id_last
int idx_offset
bool skipped
CameraBuf buf
MemoryManager mm

Private Members

Params params
struct FrameMetadata

Public Members

uint32_t frame_id
uint32_t request_id
uint64_t timestamp_sof
uint64_t timestamp_eof
unsigned int integ_lines
bool high_conversion_gain
float gain
float measured_grey_fraction
float target_grey_fraction
float processing_time
class MemoryManager

Public Functions

void init(int _video0_fd)
~MemoryManager()
template<class T>
auto alloc(int len, uint32_t *handle)

Private Functions

void *alloc_buf(int len, uint32_t *handle)
void free(void *ptr)

Private Members

std::mutex lock
std::map<void*, uint32_t> handle_lookup
std::map<void*, int> size_lookup
std::map<int, std::queue<void*>> cached_allocations
int video0_fd
struct MultiCameraState

Public Members

unique_fd video0_fd
unique_fd cam_sync_fd
unique_fd isp_fd
int device_iommu
int cdm_iommu
CameraState road_cam
CameraState wide_road_cam
CameraState driver_cam
PubMaster *pm
file camera_common.h
#include <fcntl.h>
#include <memory>
#include <thread>
#include “cereal/messaging/messaging.h”
#include “cereal/visionipc/visionipc_server.h”
#include “common/queue.h”

Typedefs

typedef struct FrameMetadata FrameMetadata
typedef void (*process_thread_cb)(MultiCameraState *s, CameraState *c, int cnt)

Enums

enum CameraType

Values:

enumerator RoadCam
enumerator DriverCam
enumerator WideRoadCam

Functions

void fill_frame_data(cereal::FrameData::Builder &framed, const FrameMetadata &frame_data, CameraState *c)
kj::Array<uint8_t> get_raw_frame_image(const CameraBuf *b)
float set_exposure_target(const CameraBuf *b, int x_start, int x_end, int x_skip, int y_start, int y_end, int y_skip)
std::thread start_process_thread(MultiCameraState *cameras, CameraState *cs, process_thread_cb callback)
void cameras_init(VisionIpcServer *v, MultiCameraState *s, cl_device_id device_id, cl_context ctx)
void cameras_open(MultiCameraState *s)
void cameras_run(MultiCameraState *s)
void cameras_close(MultiCameraState *s)
void camerad_thread()
int open_v4l_by_name_and_index(const char name[], int index = 0, int flags = O_RDWR | O_NONBLOCK)

Variables

const int YUV_BUFFER_COUNT = 20
const bool env_disable_road = getenv("DISABLE_ROAD") != NULL
const bool env_disable_wide_road = getenv("DISABLE_WIDE_ROAD") != NULL
const bool env_disable_driver = getenv("DISABLE_DRIVER") != NULL
const bool env_debug_frames = getenv("DEBUG_FRAMES") != NULL
const bool env_log_raw_frames = getenv("LOG_RAW_FRAMES") != NULL
const bool env_ctrl_exp_from_params = getenv("CTRL_EXP_FROM_PARAMS") != NULL
file camera_qcom2.h
#include <memory>
#include <utility>
#include “system/camerad/sensors/sensor.h”
#include “common/params.h”
#include “common/util.h”

Defines

FRAME_BUF_COUNT

Typedefs

typedef struct MultiCameraState MultiCameraState
file camera_util.h
#include <functional>
#include <map>
#include <memory>
#include <mutex>
#include <optional>
#include <queue>
#include <media/cam_req_mgr.h>

Functions

std::optional<int32_t> device_acquire(int fd, int32_t session_handle, void *data, uint32_t num_resources = 1)
int device_config(int fd, int32_t session_handle, int32_t dev_handle, uint64_t packet_handle)
int device_control(int fd, int op_code, int session_handle, int dev_handle)
int do_cam_control(int fd, int op_code, void *handle, int size)
void *alloc_w_mmu_hdl(int video0_fd, int len, uint32_t *handle, int align = 8, int flags = CAM_MEM_FLAG_KMD_ACCESS | CAM_MEM_FLAG_UMD_ACCESS | CAM_MEM_FLAG_CMD_BUF_TYPE, int mmu_hdl = 0, int mmu_hdl2 = 0)
void release(int video0_fd, uint32_t handle)
dir /tmp/openpilot/system/camerad
dir /tmp/openpilot/system/camerad/cameras
dir /tmp/openpilot/system

locationd

class Localizer

Public Functions

Localizer(LocalizerGnssSource gnss_source = LocalizerGnssSource::UBLOX)
int locationd_thread()
void reset_kalman(double current_time = NAN)
void reset_kalman(double current_time, const Eigen::VectorXd &init_orient, const Eigen::VectorXd &init_pos, const Eigen::VectorXd &init_vel, const MatrixXdr &init_pos_R, const MatrixXdr &init_vel_R)
void reset_kalman(double current_time, const Eigen::VectorXd &init_x, const MatrixXdr &init_P)
void finite_check(double current_time = NAN)
void time_check(double current_time = NAN)
void update_reset_tracker()
bool is_gps_ok()
bool critical_services_valid(const std::map<std::string, double> &critical_services)
bool is_timestamp_valid(double current_time)
void determine_gps_mode(double current_time)
bool are_inputs_ok()
void observation_timings_invalid_reset()
kj::ArrayPtr<capnp::byte> get_message_bytes(MessageBuilder &msg_builder, bool inputsOK, bool sensorsOK, bool gpsOK, bool msgValid)
void build_live_location(cereal::LiveLocationKalman::Builder &fix)
Eigen::VectorXd get_position_geodetic()
Eigen::VectorXd get_state()
Eigen::VectorXd get_stdev()
void handle_msg_bytes(const char *data, const size_t size)
void handle_msg(const cereal::Event::Reader &log)
void handle_sensor(double current_time, const cereal::SensorEventData::Reader &log)
void handle_gps(double current_time, const cereal::GpsLocationData::Reader &log, const double sensor_time_offset)
void handle_gnss(double current_time, const cereal::GnssMeasurements::Reader &log)
void handle_car_state(double current_time, const cereal::CarState::Reader &log)
void handle_cam_odo(double current_time, const cereal::CameraOdometry::Reader &log)
void handle_live_calib(double current_time, const cereal::LiveCalibrationData::Reader &log)
void input_fake_gps_observations(double current_time)

Private Functions

void configure_gnss_source(const LocalizerGnssSource &source)

Private Members

std::unique_ptr<LiveKalman> kf
Eigen::VectorXd calib
MatrixXdr device_from_calib
MatrixXdr calib_from_device
bool calibrated = false
double car_speed = 0.0
double last_reset_time = NAN
std::deque<double> posenet_stds
std::unique_ptr<LocalCoord> converter
int64_t unix_timestamp_millis = 0
double reset_tracker = 0.0
bool device_fell = false
bool gps_mode = false
double first_valid_log_time = NAN
double ttff = NAN
double last_gps_msg = 0
LocalizerGnssSource gnss_source
bool observation_timings_invalid = false
std::map<std::string, double> observation_values_invalid
bool standstill = true
int32_t orientation_reset_count = 0
float gps_std_factor
float gps_variance_factor
float gps_vertical_variance_factor
double gps_time_offset
Eigen::VectorXd camodo_yawrate_distribution = Eigen::Vector2d(0.0, 10.0)
file locationd.h
#include <eigen3/Eigen/Dense>
#include <deque>
#include <fstream>
#include <memory>
#include <map>
#include <string>
#include “cereal/messaging/messaging.h”
#include “common/transformations/coordinates.hpp”
#include “common/transformations/orientation.hpp”
#include “common/params.h”
#include “common/swaglog.h”
#include “common/timing.h”
#include “common/util.h”
#include “system/sensord/sensors/constants.h”
#include “selfdrive/locationd/models/live_kf.h”

Defines

VISION_DECIMATION
SENSOR_DECIMATION
POSENET_STD_HIST_HALF

Enums

enum LocalizerGnssSource

Values:

enumerator UBLOX
enumerator QCOM
dir /tmp/openpilot/selfdrive/locationd
dir /tmp/openpilot/selfdrive

ui

struct Alert

Public Functions

bool equal(const Alert &a2)

Public Members

QString text1
QString text2
QString type
cereal::ControlsState::AlertSize size
cereal::ControlsState::AlertStatus status
AudibleAlert sound

Public Static Functions

static Alert get(const SubMaster &sm, uint64_t started_frame)
class Device : public QObject

Public Functions

Device(QObject *parent = 0)
bool isAwake()
void setOffroadBrightness(int brightness)

Public Slots

void resetInteractiveTimeout(int timeout = -1)
void update(const UIState &s)

Signals

void displayPowerChanged(bool on)
void interactiveTimeout()

Private Functions

void updateBrightness(const UIState &s)
void updateWakefulness(const UIState &s)
void setAwake(bool on)

Private Members

bool awake = false
int interactive_timeout = 0
bool ignition_on = false
int offroad_brightness = BACKLIGHT_OFFROAD
int last_brightness = 0
FirstOrderFilter brightness_filter
QFuture<void> brightness_future
struct UIScene

Public Members

bool calibration_valid = false
bool calibration_wide_valid = false
bool wide_cam = true
mat3 view_from_calib = DEFAULT_CALIBRATION
mat3 view_from_wide_calib = DEFAULT_CALIBRATION
cereal::PandaState::PandaType pandaType
float lane_line_probs[4]
float road_edge_stds[2]
QPolygonF track_vertices
QPolygonF lane_line_vertices[4]
QPolygonF road_edge_vertices[2]
QPointF lead_vertices[2]
float driver_pose_vals[3]
float driver_pose_diff[3]
float driver_pose_sins[3]
float driver_pose_coss[3]
vec3 face_kpts_draw[std::size(default_face_kpts_3d)]
bool navigate_on_openpilot = false
float light_sensor
bool started
bool ignition
bool is_metric
bool map_on_left
bool longitudinal_control
bool world_objects_visible = false
uint64_t started_frame
class UIState : public QObject

Public Functions

UIState(QObject *parent = 0)
void updateStatus()
bool engaged() const
void setPrimeType(PrimeType type)
PrimeType primeType() const
bool hasPrime() const

Public Members

int fb_w = 0
int fb_h = 0
std::unique_ptr<SubMaster> sm
UIStatus status
UIScene scene = {}
QString language
QTransform car_space_transform

Signals

void uiUpdate(const UIState &s)
void offroadTransition(bool offroad)
void primeChanged(bool prime)
void primeTypeChanged(PrimeType prime_type)

Private Members

QTimer *timer
bool started_prev = false
PrimeType prime_type = PrimeType::UNKNOWN

Private Slots

void update()
file ui.h
#include <map>
#include <memory>
#include <string>
#include <QObject>
#include <QTimer>
#include <QColor>
#include <QFuture>
#include <QPolygonF>
#include <QTransform>
#include “cereal/messaging/messaging.h”
#include “common/mat.h”
#include “common/params.h”
#include “common/timing.h”
#include “system/hardware/hw.h”

Typedefs

typedef cereal::CarControl::HUDControl::AudibleAlert AudibleAlert
typedef enum UIStatus UIStatus
typedef struct UIScene UIScene

Enums

enum UIStatus

Values:

enumerator STATUS_DISENGAGED
enumerator STATUS_OVERRIDE
enumerator STATUS_ENGAGED
enum PrimeType

Values:

enumerator UNKNOWN
enumerator NONE
enumerator MAGENTA
enumerator LITE
enumerator BLUE
enumerator MAGENTA_NEW
enumerator PURPLE

Functions

UIState *uiState()
Device *device()
void ui_update_params(UIState *s)
int get_path_length_idx(const cereal::XYZTData::Reader &line, const float path_height)
void update_model(UIState *s, const cereal::ModelDataV2::Reader &model, const cereal::UiPlan::Reader &plan)
void update_dmonitoring(UIState *s, const cereal::DriverStateV2::Reader &driverstate, float dm_fade_state, bool is_rhd)
void update_leads(UIState *s, const cereal::RadarState::Reader &radar_state, const cereal::XYZTData::Reader &line)
void update_line_data(const UIState *s, const cereal::XYZTData::Reader &line, float y_off, float z_off, QPolygonF *pvd, int max_idx, bool allow_invert)

Variables

const int UI_BORDER_SIZE = 30
const int UI_HEADER_HEIGHT = 420
const int UI_FREQ = 20
const int BACKLIGHT_OFFROAD = 50
const float MIN_DRAW_DISTANCE = 10.0
const float MAX_DRAW_DISTANCE = 100.0
constexpr mat3 DEFAULT_CALIBRATION = {{0.0, 1.0, 0.0, 0.0, 0.0, 1.0, 1.0, 0.0, 0.0}}
constexpr mat3 FCAM_INTRINSIC_MATRIX = (mat3){{2648.0, 0.0, 1928.0 / 2, 0.0, 2648.0, 1208.0 / 2, 0.0, 0.0, 1.0}}
constexpr mat3 ECAM_INTRINSIC_MATRIX = (mat3){{567.0, 0.0, 1928.0 / 2, 0.0, 567.0, 1208.0 / 2, 0.0, 0.0, 1.0}}
constexpr vec3 default_face_kpts_3d[] = {{-5.98, -51.20, 8.00}, {-17.64, -49.14, 8.00}, {-23.81, -46.40, 8.00}, {-29.98, -40.91, 8.00}, {-32.04, -37.49, 8.00}, {-34.10, -32.00, 8.00}, {-36.16, -21.03, 8.00}, {-36.16, 6.40, 8.00}, {-35.47, 10.51, 8.00}, {-32.73, 19.43, 8.00}, {-29.30, 26.29, 8.00}, {-24.50, 33.83, 8.00}, {-19.01, 41.37, 8.00}, {-14.21, 46.17, 8.00}, {-12.16, 47.54, 8.00}, {-4.61, 49.60, 8.00}, {4.99, 49.60, 8.00}, {12.53, 47.54, 8.00}, {14.59, 46.17, 8.00}, {19.39, 41.37, 8.00}, {24.87, 33.83, 8.00}, {29.67, 26.29, 8.00}, {33.10, 19.43, 8.00}, {35.84, 10.51, 8.00}, {36.53, 6.40, 8.00}, {36.53, -21.03, 8.00}, {34.47, -32.00, 8.00}, {32.42, -37.49, 8.00}, {30.36, -40.91, 8.00}, {24.19, -46.40, 8.00}, {18.02, -49.14, 8.00}, {6.36, -51.20, 8.00}, {-5.98, -51.20, 8.00},}
const QColor bg_colors [] = {[STATUS_DISENGAGED] = QColor(0x17, 0x33, 0x49, 0xc8),[STATUS_OVERRIDE] = QColor(0x91, 0x9b, 0x95, 0xf1),[STATUS_ENGAGED] = QColor(0x17, 0x86, 0x44, 0xf1),}
static std::map<cereal::ControlsState::AlertStatus, QColor> alert_colors = {{cereal::ControlsState::AlertStatus::NORMAL, QColor(0x15, 0x15, 0x15, 0xf1)}, {cereal::ControlsState::AlertStatus::USER_PROMPT, QColor(0xDA, 0x6F, 0x25, 0xf1)}, {cereal::ControlsState::AlertStatus::CRITICAL, QColor(0xC9, 0x22, 0x31, 0xf1)},}
dir /tmp/openpilot/selfdrive
dir /tmp/openpilot/selfdrive/ui

replay

struct AVFrameDeleter

Public Functions

void operator()(AVFrame *frame) const
struct Camera

Public Members

CameraType type
VisionStreamType stream_type
int width
int height
std::thread thread
SafeQueue<std::pair<FrameReader*, const cereal::EncodeIndex::Reader>> queue
int cached_id = -1
int cached_seg = -1
VisionBuf *cached_buf
class CameraServer

Public Functions

CameraServer(std::pair<int, int> camera_size[MAX_CAMERAS] = nullptr)
~CameraServer()
void pushFrame(CameraType type, FrameReader *fr, const cereal::EncodeIndex::Reader &eidx)
void waitForSent()

Protected Functions

void startVipcServer()
void cameraThread(Camera &cam)

Protected Attributes

Camera cameras_ [MAX_CAMERAS] = {{.type = RoadCam, .stream_type = VISION_STREAM_ROAD},{.type = DriverCam, .stream_type = VISION_STREAM_DRIVER},{.type = WideRoadCam, .stream_type = VISION_STREAM_WIDE_ROAD},}
std::atomic<int> publishing_ = 0
std::unique_ptr<VisionIpcServer> vipc_server_
class ConsoleUI : public QObject

Public Functions

ConsoleUI(Replay *replay, QObject *parent = 0)
~ConsoleUI()

Signals

void updateProgressBarSignal(uint64_t cur, uint64_t total, bool success)
void logMessageSignal(ReplyMsgType type, const QString &msg)

Public Static Attributes

static const std::array speed_array = {0.2f, 0.5f, 1.0f, 2.0f, 3.0f}

Private Types

enum Status

Values:

enumerator Waiting
enumerator Playing
enumerator Paused
enum Win

Values:

enumerator Title
enumerator Stats
enumerator Log
enumerator LogBorder
enumerator DownloadBar
enumerator Timeline
enumerator TimelineDesc
enumerator Help
enumerator CarState
enumerator Max

Private Functions

void initWindows()
void handleKey(char c)
void displayHelp()
void displayTimelineDesc()
void updateTimeline()
void updateSummary()
void updateStatus()
void pauseReplay(bool pause)

Private Members

std::array<WINDOW*, Win::Max> w = {}
SubMaster sm
Replay *replay
QBasicTimer getch_timer
QTimer sm_timer
QSocketNotifier notifier = {0, QSocketNotifier::Read, this}
int max_width
int max_height
Status status = Status::Waiting

Private Slots

void readyRead()
void timerEvent(QTimerEvent *ev)
void updateProgressBar(uint64_t cur, uint64_t total, bool success)
void logMessage(ReplyMsgType type, const QString &msg)
class Event

Public Functions

Event(cereal::Event::Which which, uint64_t mono_time)
Event(const kj::ArrayPtr<const capnp::word> &amsg, bool frame = false)
kj::ArrayPtr<const capnp::byte> bytes() const

Public Members

uint64_t mono_time
cereal::Event::Which which
cereal::Event::Reader event
capnp::FlatArrayMessageReader reader
kj::ArrayPtr<const capnp::word> words
bool frame
class FileReader

Public Functions

FileReader(bool cache_to_local, size_t chunk_size = 0, int retries = 3)
virtual ~FileReader()
std::string read(const std::string &file, std::atomic<bool> *abort = nullptr)

Private Functions

std::string download(const std::string &url, std::atomic<bool> *abort)

Private Members

size_t chunk_size_
int max_retries_
bool cache_to_local_
class FrameReader

Public Functions

FrameReader()
~FrameReader()
bool load(const std::string &url, bool no_hw_decoder = false, std::atomic<bool> *abort = nullptr, bool local_cache = false, int chunk_size = -1, int retries = 0)
bool load(const std::byte *data, size_t size, bool no_hw_decoder = false, std::atomic<bool> *abort = nullptr)
bool get(int idx, VisionBuf *buf)
int getYUVSize() const
size_t getFrameCount() const
bool valid() const

Public Members

int width = 0
int height = 0

Private Functions

bool initHardwareDecoder(AVHWDeviceType hw_device_type)
bool decode(int idx, VisionBuf *buf)
AVFrame *decodeFrame(AVPacket *pkt)
bool copyBuffers(AVFrame *f, VisionBuf *buf)

Private Members

std::vector<AVPacket*> packets
std::unique_ptr<AVFrame, AVFrameDeleter> av_frame_
std::unique_ptr<AVFrame, AVFrameDeleter> hw_frame
AVFormatContext *input_ctx = nullptr
AVCodecContext *decoder_ctx = nullptr
int key_frames_count_ = 0
bool valid_ = false
AVIOContext *avio_ctx_ = nullptr
AVPixelFormat hw_pix_fmt = AV_PIX_FMT_NONE
AVBufferRef *hw_device_ctx = nullptr
int prev_idx = -1

Private Static Attributes

static std::atomic<bool> has_hw_decoder = true
struct lessThan

Public Functions

bool operator()(const Event *l, const Event *r)
class LogReader

Public Functions

LogReader(size_t memory_pool_block_size = DEFAULT_EVENT_MEMORY_POOL_BLOCK_SIZE)
~LogReader()
bool load(const std::string &url, std::atomic<bool> *abort = nullptr, bool local_cache = false, int chunk_size = -1, int retries = 0)
bool load(const std::byte *data, size_t size, std::atomic<bool> *abort = nullptr)

Public Members

std::vector<Event*> events

Private Functions

bool parse(std::atomic<bool> *abort)

Private Members

std::string raw_
class Replay : public QObject

Public Functions

Replay(QString route, QStringList allow, QStringList block, SubMaster *sm = nullptr, uint32_t flags = REPLAY_FLAG_NONE, QString data_dir = "", QObject *parent = 0)
~Replay()
bool load()
void start(int seconds = 0)
void stop()
void pause(bool pause)
void seekToFlag(FindFlag flag)
void seekTo(double seconds, bool relative)
bool isPaused() const
void installEventFilter(replayEventFilter filter, void *opaque)
int segmentCacheLimit() const
void setSegmentCacheLimit(int n)
bool hasFlag(REPLAY_FLAGS flag) const
void addFlag(REPLAY_FLAGS flag)
void removeFlag(REPLAY_FLAGS flag)
const Route *route() const
double currentSeconds() const
QDateTime currentDateTime() const
uint64_t routeStartTime() const
double toSeconds(uint64_t mono_time) const
int totalSeconds() const
void setSpeed(float speed)
float getSpeed() const
const std::vector<Event*> *events() const
const std::map<int, std::unique_ptr<Segment>> &segments() const
const std::string &carFingerprint() const
const std::vector<std::tuple<double, double, TimelineType>> getTimeline()

Signals

void streamStarted()
void segmentsMerged()
void seekedTo(double sec)
void qLogLoaded(int segnum, std::shared_ptr<LogReader> qlog)

Protected Types

typedef std::map<int, std::unique_ptr<Segment>> SegmentMap

Protected Functions

std::optional<uint64_t> find(FindFlag flag)
void startStream(const Segment *cur_segment)
void stream()
void setCurrentSegment(int n)
void queueSegment()
void mergeSegments(const SegmentMap::iterator &begin, const SegmentMap::iterator &end)
void updateEvents(const std::function<bool()> &lambda)
void publishMessage(const Event *e)
void publishFrame(const Event *e)
void buildTimeline()
bool isSegmentMerged(int n)

Protected Attributes

QThread *stream_thread_ = nullptr
std::mutex stream_lock_
std::condition_variable stream_cv_
std::atomic<bool> updating_events_ = false
std::atomic<int> current_segment_ = 0
SegmentMap segments_
std::atomic<bool> exit_ = false
bool paused_ = false
bool events_updated_ = false
uint64_t route_start_ts_ = 0
std::atomic<uint64_t> cur_mono_time_ = 0
std::unique_ptr<std::vector<Event*>> events_
std::unique_ptr<std::vector<Event*>> new_events_
std::vector<int> segments_merged_
SubMaster *sm = nullptr
std::unique_ptr<PubMaster> pm
std::vector<const char*> sockets_
std::unique_ptr<Route> route_
std::unique_ptr<CameraServer> camera_server_
std::atomic<uint32_t> flags_ = REPLAY_FLAG_NONE
std::mutex timeline_lock
QFuture<void> timeline_future
std::vector<std::tuple<double, double, TimelineType>> timeline
std::string car_fingerprint_
std::atomic<float> speed_ = 1.0
replayEventFilter event_filter = nullptr
void *filter_opaque = nullptr
int segment_cache_limit = MIN_SEGMENTS_CACHE

Protected Slots

void segmentLoadFinished(bool success)
class Route

Public Functions

Route(const QString &route, const QString &data_dir = {})
bool load()
const QString &name() const
const QDateTime datetime() const
const QString &dir() const
const RouteIdentifier &identifier() const
const std::map<int, SegmentFile> &segments() const
const SegmentFile &at(int n)

Public Static Functions

static RouteIdentifier parseRoute(const QString &str)

Protected Functions

bool loadFromLocal()
bool loadFromServer()
bool loadFromJson(const QString &json)
void addFileToSegment(int seg_num, const QString &file)

Protected Attributes

RouteIdentifier route_ = {}
QString data_dir_
std::map<int, SegmentFile> segments_
QDateTime date_time_
struct RouteIdentifier

Public Members

QString dongle_id
QString timestamp
int segment_id
QString str
class Segment : public QObject

Public Functions

Segment(int n, const SegmentFile &files, uint32_t flags)
~Segment()
bool isLoaded() const

Public Members

const int seg_num = 0
std::unique_ptr<LogReader> log
std::unique_ptr<FrameReader> frames[MAX_CAMERAS] = {}

Signals

void loadFinished(bool success)

Protected Functions

void loadFile(int id, const std::string file)

Protected Attributes

std::atomic<bool> abort_ = false
std::atomic<int> loading_ = 0
QFutureSynchronizer<void> synchronizer_
uint32_t flags
struct SegmentFile

Public Members

QString rlog
QString qlog
QString road_cam
QString driver_cam
QString wide_road_cam
QString qcamera
file camera.h
#include <unistd.h>
#include <memory>
#include <tuple>
#include <utility>
#include “cereal/visionipc/visionipc_server.h”
#include “common/queue.h”
#include “tools/replay/logreader.h

Functions

std::tuple<size_t, size_t, size_t> get_nv12_info(int width, int height)
file consoleui.h
#include <array>
#include <QBasicTimer>
#include <QObject>
#include <QSocketNotifier>
#include <QTimer>
#include <QTimerEvent>
#include “tools/replay/replay.h
#include <ncurses.h>
file filereader.h
#include <atomic>
#include <string>

Functions

std::string cacheFilePath(const std::string &url)
file framereader.h
#include <memory>
#include <string>
#include <vector>
#include “cereal/visionipc/visionbuf.h”
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
file logreader.h
#include <memory>
#include <string>
#include <vector>
#include “cereal/gen/cpp/log.capnp.h”
#include “system/camerad/cameras/camera_common.h”

Variables

const CameraType ALL_CAMERAS[] = {RoadCam, DriverCam, WideRoadCam}
const int MAX_CAMERAS = std::size(ALL_CAMERAS)
const int DEFAULT_EVENT_MEMORY_POOL_BLOCK_SIZE = 65000
file replay.h
#include <algorithm>
#include <map>
#include <memory>
#include <optional>
#include <string>
#include <tuple>
#include <vector>
#include <utility>
#include <QThread>
#include “tools/replay/camera.h
#include “tools/replay/route.h

Typedefs

typedef bool (*replayEventFilter)(const Event*, void*)

Enums

enum REPLAY_FLAGS

Values:

enumerator REPLAY_FLAG_NONE
enumerator REPLAY_FLAG_DCAM
enumerator REPLAY_FLAG_ECAM
enumerator REPLAY_FLAG_NO_LOOP
enumerator REPLAY_FLAG_NO_FILE_CACHE
enumerator REPLAY_FLAG_QCAMERA
enumerator REPLAY_FLAG_NO_HW_DECODER
enumerator REPLAY_FLAG_NO_VIPC
enumerator REPLAY_FLAG_ALL_SERVICES
enum FindFlag

Values:

enumerator nextEngagement
enumerator nextDisEngagement
enumerator nextUserFlag
enumerator nextInfo
enumerator nextWarning
enumerator nextCritical
enum TimelineType

Values:

enumerator None
enumerator Engaged
enumerator AlertInfo
enumerator AlertWarning
enumerator AlertCritical
enumerator UserFlag

Functions

Q_DECLARE_METATYPE(std::shared_ptr<LogReader>)

Variables

const QString DEMO_ROUTE = "a2a0ccea32023010|2023-07-27--13-01-19"
constexpr int MIN_SEGMENTS_CACHE = 5
file route.h
#include <map>
#include <memory>
#include <string>
#include <QDateTime>
#include <QFutureSynchronizer>
#include “tools/replay/logreader.h
#include “tools/replay/util.h”
file util.h
#include <atomic>
#include <functional>
#include <string>

Defines

rInfo(fmt, ...)
rDebug(fmt, ...)
rWarning(fmt, ...)
rError(fmt, ...)

Typedefs

typedef std::function<void(ReplyMsgType type, const std::string msg)> ReplayMessageHandler
typedef std::function<void(uint64_t cur, uint64_t total, bool success)> DownloadProgressHandler

Enums

enum ReplyMsgType

Values:

enumerator Info
enumerator Debug
enumerator Warning
enumerator Critical

Functions

void installMessageHandler(ReplayMessageHandler)
void logMessage(ReplyMsgType type, const char *fmt, ...)
std::string sha256(const std::string &str)
void precise_nano_sleep(long sleep_ns)
std::string decompressBZ2(const std::string &in, std::atomic<bool> *abort = nullptr)
std::string decompressBZ2(const std::byte *in, size_t in_size, std::atomic<bool> *abort = nullptr)