#if 1 class MavlinkStreamDebugVectOne : public MavlinkStream { public: const char *get_name() const { return MavlinkStreamDebugVectOne::get_name_static(); } static const char *get_name_static() { return "DEBUG_VECT_ONE"; } static uint16_t get_id_static() { return MAVLINK_MSG_ID_DEBUG_VECT_ONE; } uint16_t get_id() { return get_id_static(); } static MavlinkStream *new_instance(Mavlink *mavlink) { return new MavlinkStreamDebugVectOne(mavlink); } unsigned get_size() { return (_debug_time > 0) ? MAVLINK_MSG_ID_DEBUG_VECT_ONE_LEN + MAVLINK_NUM_NON_PAYLOAD_BYTES : 0; } private: MavlinkOrbSubscription *_debug_sub; uint64_t _debug_time; /* do not allow top copying this class */ MavlinkStreamDebugVectOne(MavlinkStreamDebugVectOne &) = delete; MavlinkStreamDebugVectOne &operator = (const MavlinkStreamDebugVectOne &) = delete; protected: explicit MavlinkStreamDebugVectOne(Mavlink *mavlink) : MavlinkStream(mavlink), _debug_sub(_mavlink->add_orb_subscription(ORB_ID(debug_vect_one))), _debug_time(0) {} bool send(const hrt_abstime t) { struct debug_vect_one_s debug = {}; if (1) { mavlink_debug_vect_one_t msg = {}; msg.timestamp = debug.timestamp; //memcpy(msg.name, debug.name, sizeof(msg.name)); /* enforce null termination */ //msg.name[sizeof(msg.name) - 1] = '\0'; msg.x = 1; msg.y = 2; msg.z = 3; mavlink_msg_debug_vect_one_send_struct(_mavlink->get_channel(), &msg); return true; } return false; } }; #endif |