std::string tester_util::read_last(const boost::filesystem::path &path, const std::uint64_t size) { try { return bacs::system::file::read_last( m_container->filesystem().keepInRoot(path), size); } catch (std::exception &) { BOOST_THROW_EXCEPTION(read_last_error() << bunsan::enable_nested_current()); } }
void on_get_button_clicked(GtkObject *object, gpointer wn) { g_print("Get Button Clicked\n"); int32_t error_code = ERR_NONE; if (0 > comm_init(com_port_name)) error_code = ERR_PORT_INIT; if (ERR_NONE == error_code) error_code = send_password("WIFIBOT123"); if (ERR_NONE == error_code) { uint32_t timestamp; error_code = read_current_time(×tamp); if (ERR_NONE == error_code) draw_current_time(wm->timestamp_control, timestamp); } if (ERR_NONE == error_code) { char program_info[64] = ""; error_code = read_program_info(program_info); if (ERR_NONE == error_code) draw_program_info(wm->program_info_control, program_info); } if (ERR_NONE == error_code) { int32_t motor_levels[NUMBER_OF_MOTOR_CHANNELS]; error_code = read_motor_levels(&motor_levels[MOTOR_SPEED_CHANNEL], &motor_levels[MOTOR_DIRECTION_CHANNEL]); if (ERR_NONE == error_code) { draw_motor_control(wm->left_motor_slide, wm->left_motor_control, motor_levels[MOTOR_SPEED_CHANNEL]); draw_motor_control(wm->right_motor_slide, wm->right_motor_control, motor_levels[MOTOR_DIRECTION_CHANNEL]); } } if (ERR_NONE == error_code) { int32_t sensor_levels[NUMBER_OF_SENSOR_CHANNELS]; error_code = read_sensor_values(&sensor_levels[SENSOR_FWD], &sensor_levels[SENSOR_REV]); if (ERR_NONE == error_code) draw_sensor_values(wm->sensor_value_control, sensor_levels); } if (ERR_NONE == error_code) { StatusLedFlashState_t led_state; int32_t flash_rate; error_code = read_status_led(&led_state, &flash_rate); if (ERR_NONE == error_code) update_led_control(wm->status_led_control, led_state, flash_rate); } if (ERR_NONE == error_code) { int32_t motor_timeout; error_code = read_motor_timeout(&motor_timeout); if (ERR_NONE == error_code) draw_motor_timeout(wm->motor_timeout_control, motor_timeout); } if (ERR_NONE == error_code) { bool on; error_code = read_ir_led(&on); if (ERR_NONE == error_code) draw_ir_led(wm->ir_led_control, on); } if (ERR_NONE == error_code) { int32_t error_id, error_timestamp; error_code = read_last_error(&error_id, &error_timestamp); if (ERR_NONE == error_code) draw_error_info(wm->error_code, wm->error_timestamp, error_id, error_timestamp); } if (ERR_NONE == error_code) { bool pressed[NUMBER_OF_PUSHBUTTONS]; error_code = read_pushbuttons(pressed); if (ERR_NONE == error_code) draw_pushbuttons(wm->pushbutton, pressed); } comm_close(); error_handler(wm->window, error_code); }