Skip to content

Commit

Permalink
Fixes for diagnostics pull request CCNYRoboticsLab#20.
Browse files Browse the repository at this point in the history
* Added "/" for closing tags in package.xml
* Moved lines to non-static function as required.
  • Loading branch information
keshaviyengar authored and mani-monaj committed Jul 14, 2016
1 parent 8ab34d5 commit 337ef11
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions phidgets_api/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
<author>Ivan Dryanovski</author>

<buildtool_depend>catkin</buildtool_depend>
<build_depend>diagnostics_updater<build_depend>
<build_depend>diagnostics_msgs<build_depend>
<build_depend>diagnostics_updater</build_depend>
<build_depend>diagnostics_msgs</build_depend>

<run_depend>diagnostics_updater</run_depend>
<run_depend>diagnostics_msgs</run_depend>
Expand Down
14 changes: 7 additions & 7 deletions phidgets_api/src/phidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,41 +97,41 @@ std::string Phidget::getErrorDescription(int errorCode)

void Phidget::attachHandler()
{
is_connected = true;
updater.force_update();
printf("Phidget attached (serial# %d)\n", getDeviceSerialNumber());
}

void Phidget::detachHandler()
{
printf("Phidget detached (serial# %d)\n", getDeviceSerialNumber());
is_connected = false;
updater.force_update();
}

void Phidget::errorHandler(int error)
{
is_error = true;
updater.force_update();
is_error = false;
printf("Phidget error [%d]: %s\n", error, getErrorDescription(error).c_str());
}

int Phidget::AttachHandler(CPhidgetHandle handle, void *userptr)
{
((Phidget*)userptr)->attachHandler();
is_connected = true;
updater.force_update();
return 0;
}

int Phidget::DetachHandler(CPhidgetHandle handle, void *userptr)
{
((Phidget*)userptr)->detachHandler();
is_connected = false;
updater.force_update();
return 0;
}

int Phidget::ErrorHandler(CPhidgetHandle handle, void *userptr, int ErrorCode, const char *unknown)
{
((Phidget*)userptr)->errorHandler(ErrorCode);
is_error = true;
updater.force_update();
is_error = false;
return 0;
}

Expand Down

0 comments on commit 337ef11

Please sign in to comment.