cellular_status.cpp
Go to the documentation of this file.
1 
9 /*
10  * Copyright 2021 Jaeyoung Lim.
11  *
12  * This file is part of the mavros package and subject to the license terms
13  * in the top-level LICENSE file of the mavros repository.
14  * https://github.com/mavlink/mavros/tree/master/LICENSE.md
15  */
16 
17 #include <mavros/mavros_plugin.h>
18 #include <mavros_msgs/CellularStatus.h>
19 
20 namespace mavros {
21 namespace extra_plugins {
29 public:
31  cc_nh("~cellular_status")
32  { }
33 
37  void initialize(UAS &uas_)
38  {
41  }
42 
52  return {};
53  }
54 
55 private:
58 
65  void cellularStatusCb(const mavros_msgs::CellularStatus &msg)
66  {
67  mavlink::common::msg::CELLULAR_STATUS cs{};
68 
69  cs.status = msg.status;
70  cs.failure_reason = msg.failure_reason;
71  cs.type = msg.type;
72  cs.quality = msg.quality;
73  cs.mcc = msg.mcc;
74  cs.mnc = msg.mnc;
75  cs.lac = msg.lac;
76 
77  UAS_FCU(m_uas)->send_message_ignore_drop(cs);
78  }
79 };
80 } // namespace std_plugins
81 } // namespace mavros
82 
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
void cellularStatusCb(const mavros_msgs::CellularStatus &msg)
Send Cellular Status messages to mavlink system.
#define UAS_FCU(uasobjptr)
std::vector< HandlerInfo > Subscriptions
void initialize(UAS &uas_) override
#define PLUGINLIB_EXPORT_CLASS(class_type, base_class_type)


mavros_extras
Author(s): Vladimir Ermakov , Amilcar Lucas
autogenerated on Tue Jun 13 2023 02:17:59