NASA Astrobee Robot Software  0.19.1
Flight software for the Astrobee robots operating inside the International Space Station.
smart_dock_tool.cc File Reference
#include <ff_common/init.h>
#include <gflags/gflags.h>
#include <gflags/gflags_completions.h>
#include <smart_dock/smart_dock.h>
#include <algorithm>
#include <cerrno>
#include <cstring>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <sstream>
#include <string>
Include dependency graph for smart_dock_tool.cc:

Typedefs

typedef std::vector< std::string > Keywords
 
typedef std::pair< std::string, KeywordsValue
 
typedef std::map< uint32_t, ValueValueMap
 
using SD = smart_dock::SmartDock
 
using EPS = eps_driver::EPS
 

Functions

 DEFINE_string (device, "/dev/i2c-2", "i2c bus of smart dock")
 
 DEFINE_int32 (address, 0x42, "i2c address of smart dock")
 
 DEFINE_int32 (retries, 3, "i2c retries")
 
 DEFINE_bool (state, false, "Get the state of the dock")
 
 DEFINE_bool (reboot, false, "Reboot")
 
 DEFINE_bool (hk, false, "View housekeeping information")
 
 DEFINE_bool (string, false, "View string information")
 
 DEFINE_bool (fault, false, "View and clear faults")
 
 DEFINE_bool (power, false, "View and toggle power channels")
 
 DEFINE_bool (berth, false, "View berth information")
 
 DEFINE_bool (command, false, "Send a command to a berth")
 
 DEFINE_bool (led, false, "Configure LEDs")
 
 DEFINE_string (set, "", "Set a new value for all specified indexes")
 
 DEFINE_bool (get, false, "Get the current value for all specified indexes")
 
 DEFINE_bool (list, false, "List all indexes and keys for the given command")
 
 DEFINE_bool (clear, false, "Send a clear command (only for -fault)")
 
int Error (std::string const &msg, int code=-1)
 
int Print (std::string const &msg)
 
int Print (std::string const &title, ValueMap const &values, bool ro=false)
 
int HelpView (std::string const &flag, std::string const &desc, bool i=true)
 
int HelpConf (std::string const &flag, std::string const &desc, bool i=true)
 
int Help ()
 
bool Mask (ValueMap const &values, std::vector< std::string > const &idxs, uint32_t &mask, bool allow_all_to_be_selected=true)
 
bool Valid (ValueMap const &values, std::string const &input, uint32_t &val)
 
int main (int argc, char **argv)
 

Typedef Documentation

◆ EPS

◆ Keywords

typedef std::vector<std::string> Keywords

◆ SD

◆ Value

typedef std::pair<std::string, Keywords> Value

◆ ValueMap

typedef std::map<uint32_t, Value> ValueMap

Function Documentation

◆ DEFINE_bool() [1/12]

DEFINE_bool ( berth  ,
false  ,
"View berth information"   
)

◆ DEFINE_bool() [2/12]

DEFINE_bool ( clear  ,
false  ,
"Send a clear command (only for -fault)"   
)

◆ DEFINE_bool() [3/12]

DEFINE_bool ( command  ,
false  ,
"Send a command to a berth"   
)

◆ DEFINE_bool() [4/12]

DEFINE_bool ( fault  ,
false  ,
"View and clear faults  
)

◆ DEFINE_bool() [5/12]

DEFINE_bool ( get  ,
false  ,
"Get the current value for all specified indexes"   
)

◆ DEFINE_bool() [6/12]

DEFINE_bool ( hk  ,
false  ,
"View housekeeping information"   
)

◆ DEFINE_bool() [7/12]

DEFINE_bool ( led  ,
false  ,
"Configure LEDs"   
)

◆ DEFINE_bool() [8/12]

DEFINE_bool ( list  ,
false  ,
"List all indexes and keys for the given command"   
)

◆ DEFINE_bool() [9/12]

DEFINE_bool ( power  ,
false  ,
"View and toggle power channels"   
)

◆ DEFINE_bool() [10/12]

DEFINE_bool ( reboot  ,
false  ,
"Reboot"   
)

◆ DEFINE_bool() [11/12]

DEFINE_bool ( state  ,
false  ,
"Get the state of the dock"   
)

◆ DEFINE_bool() [12/12]

DEFINE_bool ( string  ,
false  ,
"View string information"   
)

◆ DEFINE_int32() [1/2]

DEFINE_int32 ( address  ,
0x42  ,
"i2c address of smart dock"   
)

◆ DEFINE_int32() [2/2]

DEFINE_int32 ( retries  ,
,
"i2c retries"   
)

◆ DEFINE_string() [1/2]

DEFINE_string ( device  ,
"/dev/i2c-2"  ,
"i2c bus of smart dock"   
)

◆ DEFINE_string() [2/2]

DEFINE_string ( set  ,
""  ,
"Set a new value for all specified indexes"   
)

◆ Error()

int Error ( std::string const &  msg,
int  code = -1 
)

◆ Help()

int Help ( )

◆ HelpConf()

int HelpConf ( std::string const &  flag,
std::string const &  desc,
bool  i = true 
)

◆ HelpView()

int HelpView ( std::string const &  flag,
std::string const &  desc,
bool  i = true 
)

◆ main()

int main ( int  argc,
char **  argv 
)

◆ Mask()

bool Mask ( ValueMap const &  values,
std::vector< std::string > const &  idxs,
uint32_t &  mask,
bool  allow_all_to_be_selected = true 
)

◆ Print() [1/2]

int Print ( std::string const &  msg)

◆ Print() [2/2]

int Print ( std::string const &  title,
ValueMap const &  values,
bool  ro = false 
)

◆ Valid()

bool Valid ( ValueMap const &  values,
std::string const &  input,
uint32_t &  val 
)