Skip to content

Commit

Permalink
Merge pull request #108 from matrix-io/kp/handle_errors
Browse files Browse the repository at this point in the history
Manage everloop size
  • Loading branch information
kdpatino authored Jun 1, 2018
2 parents 11ff257 + cb08e96 commit c2ff707
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/driver_everloop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ namespace matrix_malos {
bool EverloopDriver::ProcessConfig(const pb::driver::DriverConfig& config) {
pb::io::EverloopImage image(config.image());

if (MatrixLeds() != image.led_size()) {
std::string error_msg("WARNING: Invalid number of Leds it must be =");
error_msg += std::to_string(MatrixLeds());
zmq_push_error_->Send(error_msg);
return false;
}

matrix_hal::EverloopImage image_for_hal(MatrixLeds());
int idx = 0;
for (const pb::io::LedValue& value : image.led()) {
Expand Down
2 changes: 1 addition & 1 deletion src/malos.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ int RunServer() {
std::cerr << std::endl;

matrix_hal::MatrixIOBus* bus = new matrix_hal::MatrixIOBus();

if (!bus->Init()) return false;

DriverManager driver_manager(kBasePort, kUnsecureBindScope);
Expand Down

0 comments on commit c2ff707

Please sign in to comment.