uuu
uuu (Universal Update Utility), mfgtools 3.0
 
Loading...
Searching...
No Matches
uuu.cpp File Reference
#include <iostream>
#include <stdio.h>
#include <thread>
#include <atomic>
#include <iomanip>
#include <map>
#include <mutex>
#include <vector>
#include <sstream>
#include <fstream>
#include <stdarg.h>
#include <time.h>
#include <string.h>
#include <signal.h>
#include "buildincmd.h"
#include <string>
#include <streambuf>
#include "../libuuu/libuuu.h"
#include "uuu.clst"
#include <termios.h>
#include <unistd.h>
#include <sys/ioctl.h>

Classes

class  AutoCursor
 
class  string_ex
 
class  ShowNotify
 

Macros

#define _putenv   putenv
 

Functions

void clean_vt_color () noexcept
 
int get_console_width ()
 
void print_oneline (string str)
 
int auto_complete (int argc, char **argv)
 
void print_autocomplete_help ()
 
void ctrl_c_handle (int)
 
int ask_passwd (char *prompt, char user[MAX_USER_LEN], char passwd[MAX_USER_LEN])
 
void print_help (bool detail=false)
 
void print_version ()
 
int print_cfg (const char *pro, const char *chip, const char *, uint16_t vid, uint16_t pid, uint16_t bcdmin, uint16_t bcdmax, void *)
 
int print_udev_rule (const char *, const char *, const char *, uint16_t vid, uint16_t pid, uint16_t, uint16_t, void *)
 
int polling_usb (std::atomic< int > &bexit)
 
string build_process_bar (size_t width, size_t pos, size_t total)
 
void print_auto_scroll (string str, size_t len, size_t start)
 
ShowNotify Summary (map< uint64_t, ShowNotify > *np)
 
int progress (uuu_notify nt, void *p)
 
bool enable_vt_mode ()
 
void print_usb_filter ()
 
int runshell (int shell)
 
void print_udev ()
 
int print_usb_device (const char *path, const char *chip, const char *pro, uint16_t vid, uint16_t pid, uint16_t bcd, const char *serial_no, void *)
 
void print_lsusb ()
 
int set_ignore_serial_number ()
 
int main (int argc, char **argv)
 

Variables

const char * g_vt_yellow = "\x1B[93m"
 
const char * g_vt_default = "\x1B[0m"
 
const char * g_vt_green = "\x1B[92m"
 
const char * g_vt_red = "\x1B[91m"
 
const char * g_vt_kcyn = "\x1B[36m"
 
const char * g_vt_boldwhite = "\x1B[97m"
 
size_t g_max_process_width = 0
 
char g_sample_cmd_list []
 
vector< string > g_usb_path_filter
 
vector< string > g_usb_serial_no_filter
 
int g_verbose = 0
 
static bool g_start_usb_transfer
 
int g_overall_status
 
int g_overall_okay
 
int g_overall_failure
 
char g_wait [] = "|/-\\"
 
int g_wait_index
 
static map< string, ShowNotifyg_map_path_nt
 
mutex g_callback_mutex
 

Macro Definition Documentation

◆ _putenv

#define _putenv   putenv

Function Documentation

◆ ask_passwd()

int ask_passwd ( char * prompt,
char user[MAX_USER_LEN],
char passwd[MAX_USER_LEN] )

◆ auto_complete()

int auto_complete ( int argc,
char ** argv )

◆ build_process_bar()

string build_process_bar ( size_t width,
size_t pos,
size_t total )

◆ clean_vt_color()

void clean_vt_color ( )
noexcept

◆ ctrl_c_handle()

void ctrl_c_handle ( int )

◆ enable_vt_mode()

bool enable_vt_mode ( )

◆ get_console_width()

int get_console_width ( )

◆ main()

int main ( int argc,
char ** argv )

◆ polling_usb()

int polling_usb ( std::atomic< int > & bexit)

◆ print_auto_scroll()

void print_auto_scroll ( string str,
size_t len,
size_t start )

◆ print_autocomplete_help()

void print_autocomplete_help ( )

◆ print_cfg()

int print_cfg ( const char * pro,
const char * chip,
const char * ,
uint16_t vid,
uint16_t pid,
uint16_t bcdmin,
uint16_t bcdmax,
void *  )

◆ print_help()

void print_help ( bool detail = false)

◆ print_lsusb()

void print_lsusb ( )

◆ print_oneline()

void print_oneline ( string str)

◆ print_udev()

void print_udev ( )

◆ print_udev_rule()

int print_udev_rule ( const char * ,
const char * ,
const char * ,
uint16_t vid,
uint16_t pid,
uint16_t ,
uint16_t ,
void *  )

◆ print_usb_device()

int print_usb_device ( const char * path,
const char * chip,
const char * pro,
uint16_t vid,
uint16_t pid,
uint16_t bcd,
const char * serial_no,
void *  )

◆ print_usb_filter()

void print_usb_filter ( )

◆ print_version()

void print_version ( )

◆ progress()

int progress ( uuu_notify nt,
void * p )

◆ runshell()

int runshell ( int shell)

◆ set_ignore_serial_number()

int set_ignore_serial_number ( )

◆ Summary()

ShowNotify Summary ( map< uint64_t, ShowNotify > * np)

Variable Documentation

◆ g_callback_mutex

mutex g_callback_mutex

◆ g_map_path_nt

map<string, ShowNotify> g_map_path_nt
static

◆ g_max_process_width

size_t g_max_process_width = 0

◆ g_overall_failure

int g_overall_failure

◆ g_overall_okay

int g_overall_okay

◆ g_overall_status

int g_overall_status

◆ g_sample_cmd_list

char g_sample_cmd_list[]
Initial value:
= {
}

◆ g_start_usb_transfer

bool g_start_usb_transfer
static

◆ g_usb_path_filter

vector<string> g_usb_path_filter

◆ g_usb_serial_no_filter

vector<string> g_usb_serial_no_filter

◆ g_verbose

int g_verbose = 0

◆ g_vt_boldwhite

const char* g_vt_boldwhite = "\x1B[97m"

◆ g_vt_default

const char* g_vt_default = "\x1B[0m"

◆ g_vt_green

const char* g_vt_green = "\x1B[92m"

◆ g_vt_kcyn

const char* g_vt_kcyn = "\x1B[36m"

◆ g_vt_red

const char* g_vt_red = "\x1B[91m"

◆ g_vt_yellow

const char* g_vt_yellow = "\x1B[93m"

◆ g_wait

char g_wait[] = "|/-\\"

◆ g_wait_index

int g_wait_index