DebugFunctions.h
Go to the documentation of this file.
00001 /* 
00002  * File:   DebugFunctions.h
00003  * Author: Guenther Cwioro
00004  *
00005  * Created on May 21, 2014, 10:04 AM
00006  */
00007 
00008 
00009 #ifndef DEBUGFUNCTIONS_H
00010 #define DEBUGFUNCTIONS_H
00011 
00012 #ifdef DEBUG
00013 
00014 
00015 void printRouteRequests()
00016 {
00017     for (std::list<route_request>::iterator it=route_requests_l.begin(); it != route_requests_l.end(); ++it)
00018     {
00019         route_request &req(*it);
00020         ROS_DEBUG("REQUEST ID[%u] SOUCRE[%s]",req.id,req.hostname_source.c_str());
00021     }
00022 }
00023 
00024 void printMcTree(mc_tree* m)
00025 {
00026    
00027     ROS_ERROR("MC TREE GROUP[%s] ", m->group_name.c_str());
00028     ROS_ERROR("UPLINK: HOSTNAME[%s] MAC[%s]",getHostnameFromMac(m->route_uplink.next_hop).c_str(),getMacAsStr(m->route_uplink.next_hop).c_str());
00029     ROS_ERROR("ACTIVE[%u] CONNECTED[%u] MEMBER[%u] ROOT[%u] DISTANCE TO ROOT[%u]",m->active,m->connected,m->member,m->root,m->root_distance);
00030     ROS_ERROR("DOWNLINKS:");
00031     for(std::list<mac>::iterator i = m->mc_downlinks.begin(); i != m->mc_downlinks.end(); i++)
00032         ROS_ERROR("DOWNLINK %s",getMacAsStr((*i).mac_adr).c_str());
00033     
00034   
00035         
00036 }
00037 
00038 void printMcConnections(std::list<mc_tree> *tree)
00039 {
00040     ROS_ERROR("ALL MC CONNECTIONS OF ROBOT %s:",hostname.c_str());
00041     std::list<mc_tree>::iterator i = tree->begin();
00042     for(;i != tree->end(); i++)
00043     {
00044         ROS_ERROR(" ");
00045         printMcTree(&(*i));
00046     }
00047     
00048    
00049 }
00050 void printRouteRequest(RouteRequest* r)
00051 {
00052 
00053     ROS_ERROR("ROUTE REQUEST: ID[%u] SOURCE[%s] DEST[%s]",r->header_.id,r->hostname_source_.c_str(),r->hostname_destination_.c_str());
00054     ROS_ERROR("H COUN[%u] H LIMIT[%u] MC FLAG[%u]",r->header_.hop_count,r->header_.hop_limit,r->mc_flag_);
00055     ROS_ERROR("PATH[%s]",getPathAsStr(r->path_l_).c_str());
00056 
00057 }
00058 void printRouteResponse(RouteResponse* r)
00059 {
00060     ROS_ERROR(" ");
00061     ROS_ERROR("ROUTE REQUEST: ID[%u] SOURCE[%s]",r->request_id_,r->hostname_source_.c_str());
00062     ROS_ERROR("ROOT DISTANCE[%u] HOP COUN[%u]  MC FLAG[%u]",r->root_distance,r->hop_count_,r->mc_flag_);
00063     ROS_ERROR("CURRENT HOP[%s]",getMacAsStr(r->mac_current_hop_).c_str());
00064     ROS_ERROR("PATH[%s]",getPathAsStr(r->path_l_).c_str());
00065     ROS_ERROR(" ");
00066 }
00067 
00068 #endif
00069 
00070 #endif  /* DEBUGFUNCTIONS_H */
00071 


adhoc_communication
Author(s): Guenter Cwioro , Torsten Andre
autogenerated on Thu Aug 27 2015 11:56:40