iCub-main
Classes | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
EthMaintainer Class Reference

#include <EthMaintainer.h>

Classes

struct  progData_t
 

Public Member Functions

 EthMaintainer ()
 
 ~EthMaintainer ()
 
bool open (eOipv4addr_t ipv4=hostIPaddress, eOipv4port_t port=mainIPport)
 
bool close ()
 
void verbose (bool on)
 
void debugprint (bool on)
 
bool boards_useinternal (bool on)
 
bool boards_set (EthBoardList &boards)
 
EthBoardListboards_get (void)
 
bool boards_clr (void)
 
bool boards_select (eOipv4addr_t ipv4, bool on)
 
int boards_add (eOipv4addr_t ipv4, boardInfo2_t &info2, bool force)
 
int boards_rem (eOipv4addr_t ipv4)
 
EthBoardList discover (bool clearbeforediscovery=true, int numberofdiscoveries=1, double waittimeout=1.0)
 
EthBoardList information (eOipv4addr_t ipv4, bool ask2board=true, bool forcemaintenance=true, int numberofrequests=1, double waittimeout=1.0)
 
std::string moreinformation (eOipv4addr_t ipv4, bool forcemaintenance=false)
 
bool go2maintenance (eOipv4addr_t ipv4, bool verify=true, int retries=6, double timegap=1.0)
 
bool go2application (eOipv4addr_t ipv4, bool checkdef2runapplication=true, double bootstraptime=10.0, bool verify=true)
 
bool program (eOipv4addr_t ipv4, eObrd_ethtype_t type, eOuprot_process_t process, eOversion_t targetversion, FILE *fp, bool forcemaintenance=true, void progress(float)=NULL, bool restart2application=true)
 
bool command_supported (eOipv4addr_t ipv4, eOuprot_proc_capabilities_t capability, bool ask2board=false)
 
bool command_def2run (eOipv4addr_t ipv4, eOuprot_process_t process, bool forcemaintenance=true, bool verify=true)
 
bool command_restart (eOipv4addr_t ipv4)
 
bool command_changeaddress (eOipv4addr_t ipv4, eOipv4addr_t ipv4new, bool checkifnewispresent=true, bool forcemaintenance=true, bool restart=false, bool verify=false)
 
bool command_info32_clr (eOipv4addr_t ipv4)
 
bool command_info32_set (eOipv4addr_t ipv4, const string &info32)
 
vector< string > command_info32_get (eOipv4addr_t ipv4)
 
bool command_jump2updater (eOipv4addr_t ipv4)
 
bool command_jump2address (eOipv4addr_t ipv4, uint32_t romaddress)
 
bool command_blink (eOipv4addr_t ipv4)
 
bool command_eeprom_erase (eOipv4addr_t ipv4)
 
bool command_eeprom_read (eOipv4addr_t ipv4, uint16_t from, uint16_t size, uint8_t **value)
 
bool command_program (eOipv4addr_t ipv4, FILE *programFile, eOuprot_partition2prog_t partition, void(*updateProgressBar)(float), EthBoardList *pboardlist, string &stringresult)
 

Static Public Attributes

static const eOipv4addr_t hostIPaddress = EO_COMMON_IPV4ADDR(10, 0, 1, 104)
 
static const eOipv4port_t mainIPport = 3333
 
static const eOipv4addr_t ipv4OfAllSelected = EO_COMMON_IPV4ADDR(0, 0, 0, 0)
 
static const eOipv4addr_t ipv4Broadcast = EO_COMMON_IPV4ADDR(255, 255, 255, 255)
 

Protected Member Functions

bool sendCommand (eOipv4addr_t ipv4, void *cmd, uint16_t len, EthBoardList *boardlist=NULL)
 
int sendPROG2 (const uint8_t opc, progData_t &progdata)
 
bool isInMaintenance (eOipv4addr_t ipv4, EthBoardList &boardlist)
 
bool isInApplication (eOipv4addr_t ipv4, EthBoardList &boardlist)
 
string processDiscoveryReplies2 (EthBoardList &boardlist, double waittimeout=1.0)
 
std::string processMoreInfoReplies (EthBoardList &boardlist)
 
std::string prepareMoreInfoText (eOuprot_cmd_DISCOVER_REPLY_t *disc, const char *ipv4string)
 
std::string prepareMoreInfoText (eOuprot_cmd_DISCOVER_REPLY2_t *disc, const char *ipv4string)
 
std::string getMoreInfoText (eOuprot_cmd_MOREINFO_REPLY_t *moreinfo, char *ipv4string)
 

Protected Attributes

bool _opened
 
bool _verbose
 
bool _debugprint
 
bool _useofinternalboardlist
 
EthBoardList _internalboardlist
 
unsigned char mRxBuffer [uprot_UDPmaxsize]
 
unsigned char mTxBuffer [uprot_UDPmaxsize]
 
eOipv4addr_t myIPV4addr
 
eOipv4port_t myIPV4port
 
DSocket mSocket
 

Detailed Description

Definition at line 43 of file EthMaintainer.h.

Constructor & Destructor Documentation

◆ EthMaintainer()

EthMaintainer::EthMaintainer ( )

Definition at line 78 of file EthMaintainer.cpp.

◆ ~EthMaintainer()

EthMaintainer::~EthMaintainer ( )

Definition at line 87 of file EthMaintainer.cpp.

Member Function Documentation

◆ boards_add()

int EthMaintainer::boards_add ( eOipv4addr_t  ipv4,
boardInfo2_t info2,
bool  force 
)

Definition at line 1411 of file EthMaintainer.cpp.

◆ boards_clr()

bool EthMaintainer::boards_clr ( void  )

Definition at line 1399 of file EthMaintainer.cpp.

◆ boards_get()

EthBoardList & EthMaintainer::boards_get ( void  )

Definition at line 1393 of file EthMaintainer.cpp.

◆ boards_rem()

int EthMaintainer::boards_rem ( eOipv4addr_t  ipv4)

Definition at line 1418 of file EthMaintainer.cpp.

◆ boards_select()

bool EthMaintainer::boards_select ( eOipv4addr_t  ipv4,
bool  on 
)

Definition at line 1405 of file EthMaintainer.cpp.

◆ boards_set()

bool EthMaintainer::boards_set ( EthBoardList boards)

Definition at line 1386 of file EthMaintainer.cpp.

◆ boards_useinternal()

bool EthMaintainer::boards_useinternal ( bool  on)

Definition at line 1337 of file EthMaintainer.cpp.

◆ close()

bool EthMaintainer::close ( void  )

Definition at line 114 of file EthMaintainer.cpp.

◆ command_blink()

bool EthMaintainer::command_blink ( eOipv4addr_t  ipv4)

Definition at line 2470 of file EthMaintainer.cpp.

◆ command_changeaddress()

bool EthMaintainer::command_changeaddress ( eOipv4addr_t  ipv4,
eOipv4addr_t  ipv4new,
bool  checkifnewispresent = true,
bool  forcemaintenance = true,
bool  restart = false,
bool  verify = false 
)

Definition at line 2114 of file EthMaintainer.cpp.

◆ command_def2run()

bool EthMaintainer::command_def2run ( eOipv4addr_t  ipv4,
eOuprot_process_t  process,
bool  forcemaintenance = true,
bool  verify = true 
)

Definition at line 2010 of file EthMaintainer.cpp.

◆ command_eeprom_erase()

bool EthMaintainer::command_eeprom_erase ( eOipv4addr_t  ipv4)

Definition at line 170 of file EthMaintainer.cpp.

◆ command_eeprom_read()

bool EthMaintainer::command_eeprom_read ( eOipv4addr_t  ipv4,
uint16_t  from,
uint16_t  size,
uint8_t **  value 
)

Definition at line 188 of file EthMaintainer.cpp.

◆ command_info32_clr()

bool EthMaintainer::command_info32_clr ( eOipv4addr_t  ipv4)

Definition at line 2282 of file EthMaintainer.cpp.

◆ command_info32_get()

vector< string > EthMaintainer::command_info32_get ( eOipv4addr_t  ipv4)

Definition at line 2342 of file EthMaintainer.cpp.

◆ command_info32_set()

bool EthMaintainer::command_info32_set ( eOipv4addr_t  ipv4,
const string &  info32 
)

Definition at line 2303 of file EthMaintainer.cpp.

◆ command_jump2address()

bool EthMaintainer::command_jump2address ( eOipv4addr_t  ipv4,
uint32_t  romaddress 
)

Definition at line 2449 of file EthMaintainer.cpp.

◆ command_jump2updater()

bool EthMaintainer::command_jump2updater ( eOipv4addr_t  ipv4)

Definition at line 2428 of file EthMaintainer.cpp.

◆ command_program()

bool EthMaintainer::command_program ( eOipv4addr_t  ipv4,
FILE *  programFile,
eOuprot_partition2prog_t  partition,
void(*)(float)  updateProgressBar,
EthBoardList pboardlist,
string &  stringresult 
)

Definition at line 244 of file EthMaintainer.cpp.

◆ command_restart()

bool EthMaintainer::command_restart ( eOipv4addr_t  ipv4)

Definition at line 2090 of file EthMaintainer.cpp.

◆ command_supported()

bool EthMaintainer::command_supported ( eOipv4addr_t  ipv4,
eOuprot_proc_capabilities_t  capability,
bool  ask2board = false 
)

Definition at line 1425 of file EthMaintainer.cpp.

◆ debugprint()

void EthMaintainer::debugprint ( bool  on)

Definition at line 133 of file EthMaintainer.cpp.

◆ discover()

EthBoardList EthMaintainer::discover ( bool  clearbeforediscovery = true,
int  numberofdiscoveries = 1,
double  waittimeout = 1.0 
)

Definition at line 1344 of file EthMaintainer.cpp.

◆ getMoreInfoText()

std::string EthMaintainer::getMoreInfoText ( eOuprot_cmd_MOREINFO_REPLY_t *  moreinfo,
char *  ipv4string 
)
protected

Definition at line 1226 of file EthMaintainer.cpp.

◆ go2application()

bool EthMaintainer::go2application ( eOipv4addr_t  ipv4,
bool  checkdef2runapplication = true,
double  bootstraptime = 10.0,
bool  verify = true 
)

Definition at line 1620 of file EthMaintainer.cpp.

◆ go2maintenance()

bool EthMaintainer::go2maintenance ( eOipv4addr_t  ipv4,
bool  verify = true,
int  retries = 6,
double  timegap = 1.0 
)

Definition at line 1552 of file EthMaintainer.cpp.

◆ information()

EthBoardList EthMaintainer::information ( eOipv4addr_t  ipv4,
bool  ask2board = true,
bool  forcemaintenance = true,
int  numberofrequests = 1,
double  waittimeout = 1.0 
)

Definition at line 1459 of file EthMaintainer.cpp.

◆ isInApplication()

bool EthMaintainer::isInApplication ( eOipv4addr_t  ipv4,
EthBoardList boardlist 
)
protected

Definition at line 641 of file EthMaintainer.cpp.

◆ isInMaintenance()

bool EthMaintainer::isInMaintenance ( eOipv4addr_t  ipv4,
EthBoardList boardlist 
)
protected

Definition at line 620 of file EthMaintainer.cpp.

◆ moreinformation()

std::string EthMaintainer::moreinformation ( eOipv4addr_t  ipv4,
bool  forcemaintenance = false 
)

Definition at line 1509 of file EthMaintainer.cpp.

◆ open()

bool EthMaintainer::open ( eOipv4addr_t  ipv4 = hostIPaddress,
eOipv4port_t  port = mainIPport 
)

Definition at line 94 of file EthMaintainer.cpp.

◆ prepareMoreInfoText() [1/2]

std::string EthMaintainer::prepareMoreInfoText ( eOuprot_cmd_DISCOVER_REPLY2_t *  disc,
const char *  ipv4string 
)
protected

Definition at line 1118 of file EthMaintainer.cpp.

◆ prepareMoreInfoText() [2/2]

std::string EthMaintainer::prepareMoreInfoText ( eOuprot_cmd_DISCOVER_REPLY_t *  disc,
const char *  ipv4string 
)
protected

Definition at line 1016 of file EthMaintainer.cpp.

◆ processDiscoveryReplies2()

string EthMaintainer::processDiscoveryReplies2 ( EthBoardList boardlist,
double  waittimeout = 1.0 
)
protected

Definition at line 662 of file EthMaintainer.cpp.

◆ processMoreInfoReplies()

std::string EthMaintainer::processMoreInfoReplies ( EthBoardList boardlist)
protected

Definition at line 860 of file EthMaintainer.cpp.

◆ program()

bool EthMaintainer::program ( eOipv4addr_t  ipv4,
eObrd_ethtype_t  type,
eOuprot_process_t  process,
eOversion_t  targetversion,
FILE *  fp,
bool  forcemaintenance = true,
void   progressfloat = NULL,
bool  restart2application = true 
)

Definition at line 1727 of file EthMaintainer.cpp.

◆ sendCommand()

bool EthMaintainer::sendCommand ( eOipv4addr_t  ipv4,
void *  cmd,
uint16_t  len,
EthBoardList boardlist = NULL 
)
protected

Definition at line 589 of file EthMaintainer.cpp.

◆ sendPROG2()

int EthMaintainer::sendPROG2 ( const uint8_t  opc,
progData_t progdata 
)
protected

Definition at line 1247 of file EthMaintainer.cpp.

◆ verbose()

void EthMaintainer::verbose ( bool  on)

Definition at line 127 of file EthMaintainer.cpp.

Member Data Documentation

◆ _debugprint

bool EthMaintainer::_debugprint
protected

Definition at line 258 of file EthMaintainer.h.

◆ _internalboardlist

EthBoardList EthMaintainer::_internalboardlist
protected

Definition at line 261 of file EthMaintainer.h.

◆ _opened

bool EthMaintainer::_opened
protected

Definition at line 256 of file EthMaintainer.h.

◆ _useofinternalboardlist

bool EthMaintainer::_useofinternalboardlist
protected

Definition at line 260 of file EthMaintainer.h.

◆ _verbose

bool EthMaintainer::_verbose
protected

Definition at line 257 of file EthMaintainer.h.

◆ hostIPaddress

const eOipv4addr_t EthMaintainer::hostIPaddress = EO_COMMON_IPV4ADDR(10, 0, 1, 104)
static

Definition at line 56 of file EthMaintainer.h.

◆ ipv4Broadcast

const eOipv4addr_t EthMaintainer::ipv4Broadcast = EO_COMMON_IPV4ADDR(255, 255, 255, 255)
static

Definition at line 60 of file EthMaintainer.h.

◆ ipv4OfAllSelected

const eOipv4addr_t EthMaintainer::ipv4OfAllSelected = EO_COMMON_IPV4ADDR(0, 0, 0, 0)
static

Definition at line 59 of file EthMaintainer.h.

◆ mainIPport

const eOipv4port_t EthMaintainer::mainIPport = 3333
static

Definition at line 57 of file EthMaintainer.h.

◆ mRxBuffer

unsigned char EthMaintainer::mRxBuffer[uprot_UDPmaxsize]
protected

Definition at line 264 of file EthMaintainer.h.

◆ mSocket

DSocket EthMaintainer::mSocket
protected

Definition at line 270 of file EthMaintainer.h.

◆ mTxBuffer

unsigned char EthMaintainer::mTxBuffer[uprot_UDPmaxsize]
protected

Definition at line 265 of file EthMaintainer.h.

◆ myIPV4addr

eOipv4addr_t EthMaintainer::myIPV4addr
protected

Definition at line 267 of file EthMaintainer.h.

◆ myIPV4port

eOipv4port_t EthMaintainer::myIPV4port
protected

Definition at line 268 of file EthMaintainer.h.


The documentation for this class was generated from the following files: