Go to Post Gracious professionalism dictates that if you come to play, I must help you. - Al Skierkiewicz [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Spotlight this post!  
Unread 17-02-2009, 19:00
radau radau is offline
Registered User
no team
 
Join Date: Jan 2009
Location: CA
Posts: 9
radau is an unknown quantity at this point
Re: Wireless debug print ??

Quote:
Originally Posted by SuperBK View Post
Juse use printf and to see the output, open a target console. Right click on the target, select "Target Tools" and "Console". You don't have to be running in debug mode to see the output.
Brian
They want to use wifi to retrieve the output, which (using printf) is spat out to the serial on the cRio (which requires a physical connection). You could use a serial/wireless adapter ($100) .

Or maybe if you write your debugging messages to a file on the cRio, you can retrieve them by ftp-ing to it wirelessly (10.te.am.2, using "root" and no password). You could probably even watch the file grow as if it were real console output, using something like ftptail.

Here's the code you need to write stuff to files:

Code:
#include <stdio.h>
#include <stdarg.h>

FILE *debugf;

/**
 * Use this like you use printf! (e.g. debug("Gyro heading = %f", gyro->GetAngle());).
 */
void debug(char *msg, ...)
{
	if (debugf != NULL)
	{
		char buf[256];
		va_list args;
		
		va_start(args, msg);
		vsprintf(buf, msg, args);
		
		va_end(args);
		
		fputs(buf,  debugf);
		fputs("\n", debugf);
	}
}

/**
 * Put this in IterativeRobot::RobotInit!
 */
void debugInit()
{
	if (debugf == NULL)
	{
		debugf = fopen("debug.txt", "w");
	}
}
I haven't tried this! The advantages of writing to files is that it creates significantly less overhead than printfs, but I dunno about overhead caused by ftptail.

Last edited by radau : 17-02-2009 at 19:07.
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Debug Windriver issue..... programmr C/C++ 12 06-02-2011 13:47
Sidecar Debug NinjaSpawn94 NI LabVIEW 6 07-02-2009 10:48
SERAL INSTEAD OF DEBUG... EGG0900 Programming 2 05-11-2005 18:25
IFI Dynamic Debug Tool fowlerm Programming 0 25-08-2005 16:18
Debug function in programming? archiver 2001 4 24-06-2002 00:34


All times are GMT -5. The time now is 14:50.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi