To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 26807
26806  |  26808
Subject: 
NBC and NXC API macro testing (bluetooth-related)
Newsgroups: 
lugnet.robotics, lugnet.robotics.nxt
Date: 
Tue, 30 Jan 2007 03:27:59 GMT
Viewed: 
8476 times
  
If you have 2 NXTs lying around and you are moderately interested in testing
some potentially interesting new NBC and NXC API macros then I would definitely
be interested in hearing from you via email.  I have written a few additions to
the NXTDefs.h and NXCDefs.h header files for NBC and NXC and I plan on testing
all these new functions myself but if I could get a little help from other
people I would be very grateful.

To wet your appetite:

result = ReceiveRemoteBool(queue, clear, bval);
result = ReceiveRemoteNumber(queue, clear, val);
result = ReceiveRemoteString(queue, clear, str);
result = ReceiveRemoteMessageEx(queue, clear, str, val, bval);

result = SendRemoteBool(conn, queue, bval);
result = SendRemoteNumber(conn, queue, val);
result = SendRemoteString(conn, queue, str);

result = RemoteMessageRead(conn, queue);
result = RemoteMessageWrite(conn, queue, msg);
result = RemoteStartProgram(conn, filename);
result = RemoteStopProgram(conn);
result = RemotePlaySoundFile(conn, filename, bloop);
result = RemotePlayTone(conn, frequency, duration);
result = RemoteStopSound(conn);
result = RemoteKeepAlive(conn);
result = RemoteResetScaledValue(conn, port);
result = RemoteResetMotorPosition(conn, port, brelative);
result = RemoteSetInputMode(conn, port, type, mode);
result = RemoteSetOutputState(conn, port, speed, mode, regmode, turnpct,
runstate, tacholimit);

The NBC versions are identical except that instead of returning a result you
pass a result variable as the last parameter (i.e., RemoteKeepAlive(conn,
result)).

I have tested many of these myself with good success.  My testing, however, has
definitely not been exhaustive.

All of them (except the first four) use the BluetoothWrite system call under the
hood so they will probably need to be used in conjunction with the
BluetoothStatus function so that you do not stomp on previous write attempts.

If you want to try them out yourself and report your findings (successes or
failures) to me then send me an email and I'll send you the modified header
files.

John Hansen



1 Message in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR