96 printf(
"rq_state(): Unknown error\r\n");
136 printf(
"rq_state(): Unknown error\r\n");
198 #if defined(_WIN32)||defined(WIN32) //For Windows 214 static unsigned int retries = 0;
221 if (retries >= max_retries)
223 #if defined(_WIN32)||defined(WIN32) //For Windows 278 strcpy(value,
"Done");
281 strcpy(value,
"Unsupported command_id");
299 if( value == NULL || name == NULL)
304 if(strstr(name,
"SNU"))
308 else if(strstr(name,
"FWV"))
312 else if(strstr(name,
"PYE"))
void rq_com_get_str_production_year(INT_8 *production_year)
Retrieves the sensor firmware version.
float rq_com_get_received_data(UINT_8 i)
Return an effort component.
void rq_sensor_com_read_info_high_lvl(void)
Reads and stores high level information from the sensor. These include the firmware version...
INT_8 rq_sensor_com()
Discovers and initialize the communication with the sensor.
bool rq_state_got_new_message()
Returns true if a stream message is available.
bool rq_com_get_valid_stream(void)
returns if the stream message is valid
enum rq_sensor_state_values rq_sensor_get_current_state()
Returns this module's state machine current state.
void rq_com_get_str_firmware_version(INT_8 *firmware_version)
Retrieves the sensor firmware version.
void rq_com_get_str_serial_number(INT_8 *serial_number)
Retrieves the sensor serial number.
static void rq_state_run(unsigned int max_retries)
void rq_com_do_zero_force_flag(void)
Set the "zero sensor" flag to 1. When the next stream message will be decoded, the effort values will...
static void rq_state_read_info_high_lvl()
Reads the high level information from the sensor and set the next state to RQ_STATE_START_STREAM.
void stop_connection(void)
close the serial port.
INT_8 rq_com_start_stream(void)
Starts the sensor streaming mode.
State that initialize the com. with the sensor.
void rq_state_do_zero_force_flag()
Command a zero on the sensor.
static enum rq_sensor_state_values current_state
float rq_state_get_received_data(UINT_8 i)
static void rq_state_start_stream()
Send the command to start the streaming mode If the stream doesn't start, return to state init...
bool rq_state_get_command(INT_8 command, INT_8 *const value)
Gets the value of high level information from the sensor.
INT_8 rq_sensor_state(unsigned int max_retries, const std::string &ftdi_id)
void rq_com_listen_stream(void)
Listens and decode a valid stream input.
static INT_8 rq_state_init_com()
Initialize communication with the sensor and set the next state to RQ_STATE_READ_INFO.
bool rq_com_got_new_message(void)
Returns true if a new valid stream message has been decoded and is available.