iCub-main
Loading...
Searching...
No Matches
Macros | Functions | Variables
main.cpp File Reference
#include "downloader.h"
#include "driver.h"
#include <yarp/os/Time.h>
#include <yarp/os/Log.h>
#include <yarp/dev/Drivers.h>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <fcntl.h>
#include <iCubCanProtocol.h>
#include <iCubCanProto_types.h>
+ Include dependency graph for main.cpp:

Go to the source code of this file.

Macros

#define ALL_OK   0
 
#define INVALID_CMD_STRING   -1
 
#define INVALID_PARAM_CANTYPE   -2
 
#define INVALID_PARAM_CANNUM   -3
 
#define INVALID_PARAM_BOARDID   -4
 
#define INVALID_PARAM_FILE   -5
 
#define ERR_NO_BOARDS_FOUND   -10
 
#define ERR_BOARD_ID_NOT_FOUND   -11
 
#define ERR_UNKNOWN   -12
 
#define ERR_NO_NETWORK_INTERFACE   -13
 
#define DOWNLOADERR_NOT_CONNECTED   -20
 
#define DOWNLOADERR_BOARD_NOT_SEL   -21
 
#define DOWNLOADERR_FILE_NOT_SEL   -22
 
#define DOWNLOADERR_FILE_NOT_OPEN   -23
 
#define DOWNLOADERR_BOARD_NOT_START   -24
 
#define DOWNLOADERR_TRANSFER_ERROR   -25
 

Functions

static bool compile_ip_addresses (const char *addr)
 
static void start_end_click ()
 
static int download_click (std::string *user_data)
 
bool validate_selection (int wanted_type)
 
void fatal_error (int err)
 
int myMain (int argc, char *argv[])
 
int main (int argc, char *argv[])
 

Variables

cDownloader downloader
 
int networkId =0
 
int canID =1
 
unsigned int localAddr =0
 
unsigned int remoteAddr =0
 
const int maxNetworks =10
 
std::string networkType
 
bool calibration_enabled =false
 
bool prompt_version =false
 

Macro Definition Documentation

◆ ALL_OK

#define ALL_OK   0

Definition at line 175 of file main.cpp.

◆ DOWNLOADERR_BOARD_NOT_SEL

#define DOWNLOADERR_BOARD_NOT_SEL   -21

Definition at line 186 of file main.cpp.

◆ DOWNLOADERR_BOARD_NOT_START

#define DOWNLOADERR_BOARD_NOT_START   -24

Definition at line 189 of file main.cpp.

◆ DOWNLOADERR_FILE_NOT_OPEN

#define DOWNLOADERR_FILE_NOT_OPEN   -23

Definition at line 188 of file main.cpp.

◆ DOWNLOADERR_FILE_NOT_SEL

#define DOWNLOADERR_FILE_NOT_SEL   -22

Definition at line 187 of file main.cpp.

◆ DOWNLOADERR_NOT_CONNECTED

#define DOWNLOADERR_NOT_CONNECTED   -20

Definition at line 185 of file main.cpp.

◆ DOWNLOADERR_TRANSFER_ERROR

#define DOWNLOADERR_TRANSFER_ERROR   -25

Definition at line 190 of file main.cpp.

◆ ERR_BOARD_ID_NOT_FOUND

#define ERR_BOARD_ID_NOT_FOUND   -11

Definition at line 182 of file main.cpp.

◆ ERR_NO_BOARDS_FOUND

#define ERR_NO_BOARDS_FOUND   -10

Definition at line 181 of file main.cpp.

◆ ERR_NO_NETWORK_INTERFACE

#define ERR_NO_NETWORK_INTERFACE   -13

Definition at line 184 of file main.cpp.

◆ ERR_UNKNOWN

#define ERR_UNKNOWN   -12

Definition at line 183 of file main.cpp.

◆ INVALID_CMD_STRING

#define INVALID_CMD_STRING   -1

Definition at line 176 of file main.cpp.

◆ INVALID_PARAM_BOARDID

#define INVALID_PARAM_BOARDID   -4

Definition at line 179 of file main.cpp.

◆ INVALID_PARAM_CANNUM

#define INVALID_PARAM_CANNUM   -3

Definition at line 178 of file main.cpp.

◆ INVALID_PARAM_CANTYPE

#define INVALID_PARAM_CANTYPE   -2

Definition at line 177 of file main.cpp.

◆ INVALID_PARAM_FILE

#define INVALID_PARAM_FILE   -5

Definition at line 180 of file main.cpp.

Function Documentation

◆ compile_ip_addresses()

static bool compile_ip_addresses ( const char *  addr)
static

Definition at line 198 of file main.cpp.

◆ download_click()

static int download_click ( std::string *  user_data)
static

Definition at line 281 of file main.cpp.

◆ fatal_error()

void fatal_error ( int  err)

Definition at line 485 of file main.cpp.

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 718 of file main.cpp.

◆ myMain()

int myMain ( int  argc,
char *  argv[] 
)

Definition at line 539 of file main.cpp.

◆ start_end_click()

static void start_end_click ( )
static

Definition at line 228 of file main.cpp.

◆ validate_selection()

bool validate_selection ( int  wanted_type)

Definition at line 420 of file main.cpp.

Variable Documentation

◆ calibration_enabled

bool calibration_enabled =false

Definition at line 157 of file main.cpp.

◆ canID

int canID =1

Definition at line 152 of file main.cpp.

◆ downloader

cDownloader downloader

Definition at line 148 of file main.cpp.

◆ localAddr

unsigned int localAddr =0

Definition at line 153 of file main.cpp.

◆ maxNetworks

const int maxNetworks =10

Definition at line 155 of file main.cpp.

◆ networkId

int networkId =0

Definition at line 151 of file main.cpp.

◆ networkType

std::string networkType

Definition at line 156 of file main.cpp.

◆ prompt_version

bool prompt_version =false

Definition at line 158 of file main.cpp.

◆ remoteAddr

unsigned int remoteAddr =0

Definition at line 154 of file main.cpp.