Browse Source

Added/moved namespaces in events module

sbg
Alessandro Simovic 7 years ago committed by Beat Küng
parent
commit
1982957bef
  1. 8
      src/modules/events/rc_loss_alarm.cpp
  2. 8
      src/modules/events/rc_loss_alarm.h
  3. 5
      src/modules/events/send_event.cpp
  4. 9
      src/modules/events/send_event.h
  5. 8
      src/modules/events/set_leds.cpp
  6. 8
      src/modules/events/status_display.cpp
  7. 5
      src/modules/events/status_display.h
  8. 5
      src/modules/events/subscriber_handler.cpp

8
src/modules/events/rc_loss_alarm.cpp

@ -47,6 +47,11 @@ @@ -47,6 +47,11 @@
#include <uORB/topics/tune_control.h>
namespace events
{
namespace rc_loss
{
RC_Loss_Alarm::RC_Loss_Alarm(const events::SubscriberHandler &subscriber_handler)
: _subscriber_handler(subscriber_handler)
{
@ -101,3 +106,6 @@ void RC_Loss_Alarm::play_tune() @@ -101,3 +106,6 @@ void RC_Loss_Alarm::play_tune()
orb_publish(ORB_ID(tune_control), _tune_control_pub, &tune_control);
}
}
} /* namespace rc_loss */
} /* namespace events */

8
src/modules/events/rc_loss_alarm.h

@ -44,6 +44,11 @@ @@ -44,6 +44,11 @@
#include <uORB/uORB.h>
#include <uORB/topics/vehicle_status.h>
namespace events
{
namespace rc_loss
{
class RC_Loss_Alarm
{
public:
@ -73,3 +78,6 @@ private: @@ -73,3 +78,6 @@ private:
orb_advert_t _tune_control_pub = nullptr;
const events::SubscriberHandler &_subscriber_handler;
};
} /* namespace rc_loss */
} /* namespace events */

5
src/modules/events/send_event.cpp

@ -38,6 +38,9 @@ @@ -38,6 +38,9 @@
#include <px4_log.h>
#include <drivers/drv_hrt.h>
namespace events
{
struct work_s SendEvent::_work = {};
// Run it at 30 Hz.
@ -283,3 +286,5 @@ int SendEvent::custom_command(int argc, char *argv[]) @@ -283,3 +286,5 @@ int SendEvent::custom_command(int argc, char *argv[])
return 0;
}
} /* namespace events */

9
src/modules/events/send_event.h

@ -42,6 +42,9 @@ @@ -42,6 +42,9 @@
#include <uORB/topics/vehicle_command.h>
#include <uORB/topics/vehicle_command_ack.h>
namespace events
{
extern "C" __EXPORT int send_event_main(int argc, char *argv[]);
class SendEvent : public ModuleBase<SendEvent>
@ -83,8 +86,10 @@ private: @@ -83,8 +86,10 @@ private:
void answer_command(const vehicle_command_s &cmd, unsigned result);
static struct work_s _work;
events::SubscriberHandler _subscriber_handler;
SubscriberHandler _subscriber_handler;
status::StatusDisplay _status_display;
RC_Loss_Alarm _rc_loss_alarm;
rc_loss::RC_Loss_Alarm _rc_loss_alarm;
orb_advert_t _command_ack_pub = nullptr;
};
} /* namespace events */

8
src/modules/events/set_leds.cpp

@ -40,9 +40,15 @@ @@ -40,9 +40,15 @@
#include "status_display.h"
using namespace status;
namespace events
{
namespace status
{
void StatusDisplay::set_leds()
{
// Put your LED handling here
}
} /* namespace status */
} /* namespace events */

8
src/modules/events/status_display.cpp

@ -43,7 +43,10 @@ @@ -43,7 +43,10 @@
#include "status_display.h"
#include <drivers/drv_led.h>
using namespace status;
namespace events
{
namespace status
{
StatusDisplay::StatusDisplay(const events::SubscriberHandler &subscriber_handler)
: _subscriber_handler(subscriber_handler)
@ -106,3 +109,6 @@ void StatusDisplay::publish() @@ -106,3 +109,6 @@ void StatusDisplay::publish()
_led_control_pub = orb_advertise_queue(ORB_ID(led_control), &_led_control, LED_UORB_QUEUE_LENGTH);
}
}
} /* namespace status */
} /* namespace events */

5
src/modules/events/status_display.h

@ -51,6 +51,8 @@ @@ -51,6 +51,8 @@
#include <uORB/topics/vehicle_status.h>
#include <uORB/topics/vehicle_status_flags.h>
namespace events
{
namespace status
{
@ -98,4 +100,5 @@ private: @@ -98,4 +100,5 @@ private:
const events::SubscriberHandler &_subscriber_handler;
};
} /* status */
} /* namespace status */
} /* namespace events */

5
src/modules/events/subscriber_handler.cpp

@ -3,7 +3,8 @@ @@ -3,7 +3,8 @@
#include <px4_log.h>
using namespace events;
namespace events
{
void SubscriberHandler::subscribe()
{
@ -97,3 +98,5 @@ void SubscriberHandler::check_for_updates() @@ -97,3 +98,5 @@ void SubscriberHandler::check_for_updates()
}
}
} /* namespace events */

Loading…
Cancel
Save