Exemplo n.º 1
0
 std::string toString() const
 {
     std::ostringstream os;
     os << "ts_m="     << ts_monotonic
        << " ts_utc=" << ts_utc
        << " tt="     << transfer_type
        << " tid="    << int(transfer_id.get())
        << " snid="   << int(src_node_id.get())
        << " dnid="   << int(dst_node_id.get())
        << " dtid="   << int(data_type.getID().get())
        << "\n\t'" << payload << "'";
     return os.str();
 }
Exemplo n.º 2
0
	bool handleRestartRequest(uavcan::NodeID request_source) override
	{
		::syslog(LOG_INFO, "UAVCAN: Restarting by request from %i\n", int(request_source.get()));
		::usleep(20 * 1000 * 1000);
		px4_systemreset(false);
		return true; // Will never be executed BTW
	}
Exemplo n.º 3
0
 void printStatusLine(uavcan::NodeID nid, const uavcan::NodeStatusMonitor::NodeStatus& status)
 {
     const auto color_and_string = statusCodeToColoredString(status.status_code);
     const int nid_int = nid.get();
     std::cout << color_and_string.first;
     std::cout << " " << std::setw(3) << std::left << nid_int << " | "
               << std::setw(13) << std::left << color_and_string.second << " | "
               << uptimes_[nid_int];
     std::cout << OstreamColorizer() << "\n";
 }
Exemplo n.º 4
0
 bool match(StatusType status, uavcan::NodeID server_node_id, const typename DataType::Response& response) const
 {
     if (status == last_status &&
         server_node_id == last_server_node_id &&
         response == last_response)
     {
         return true;
     }
     else
     {
         std::cout << "MISMATCH: status=" << last_status << ", last_server_node_id="
             << int(last_server_node_id.get()) << ", last response:\n" << last_response << std::endl;
         return false;
     }
 }
Exemplo n.º 5
0
	bool handleRestartRequest(uavcan::NodeID request_source) override
	{
		PX4_INFO("UAVCAN: Restarting by request from %i\n", int(request_source.get()));
		board_reset(false);
		return true; // Will never be executed BTW
	}