31 #ifndef SERIAL_CONTROLLER_H 32 #define SERIAL_CONTROLLER_H 38 #include <condition_variable> 71 bool command(
string msg,
string params=
"",
string type=
"!");
73 bool query(
string msg,
string params=
"",
string type=
"?");
77 if(query(msg, params))
88 return command(msg, params,
"^");
91 string getParam(
string msg,
string params=
"") {
92 if(query(msg, params,
"~"))
104 return command(msg, params,
"%");
121 return "V" + _script_ver;
130 mSerial.write(
"%RESET 321654987");
141 return maintenance(
"EERST");
149 return maintenance(
"EELD");
157 return maintenance(
"EESAV");
171 return command(
"R",
"0");
181 return setParam(
"ECHOF",
"0");
184 return setParam(
"ECHOF",
"1");
191 bool downloadScript();
197 bool addCallback(
const callback_data_t &callback,
const string data);
201 template <
class T>
bool addCallback(
void(T::*fp)(
const string), T* obj,
const string data) {
202 return addCallback(bind(fp, obj, _1), data);
225 std::condition_variable
cv;
240 bool enableDownload();
245 #endif // SERIAL_CONTROLLER_H
bool script(bool status)
script Run and stop the script inside the Roboteq
bool setParam(string msg, string params="")
map< string, callback_data_t > hashmap
bool echo(bool type)
echo Enable or disable the echo message
bool factoryReset()
factoryReset Factory reset of Roboteq board
function< void(string data) > callback_data_t
Read complete callback - Array of callback.
ROSLIB_DECL std::string command(const std::string &cmd)
void reset()
reset Reset the Roboteq board
string getParam(string msg, string params="")
bool loadFromEEPROM()
loadFromEEPROM
string getQuery(string msg, string params="")
bool maintenance(string msg, string params="")
bool saveInEEPROM()
saveInEEPROM The EESAV it's a real-time Command must be used to copy the RAM array to Flash...
string getVersionScript()
getVersionScript The version of the script loaded
std::condition_variable cv
bool addCallback(void(T::*fp)(const string), T *obj, const string data)