To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 3688
3687  |  3689
Subject: 
Respondre el missatge: Use of lnp_addressing_write() in an RCX program.
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Fri, 27 Feb 2004 12:41:34 GMT
Viewed: 
4409 times
  
  You must send the packet to port 0 of the destination. The dest address is conformed by the address in the upper 4 bits and the port in the lower 4 of the char. So if you put address = 6 you are saying -> host=0 port=6 and you must send to host=6, port=0. So it would be: dest_addr= 0x60 (in hex).

let me know if it worked.

good luck.

Gerard.

----- Missatge original -----
De: Brian Jorgage <brian.jorgage@villanova.edu>
Data: Dimarts, Febrer 24, 2004 10:50 pm
Assumpte: Use of lnp_addressing_write() in an RCX program.

Hello all.  I wrote a small program using lnp_addressing_write() to
remotelychange the host address of one RCX from another.  It
doesn't work.  I get an
occasional flash of IR icon on receiving unit - that's it.  Please
take a look:

int main(int argc, char **argv)
{
unsigned char buffer[256+3]="";
buffer[0]=7;      // CMDsethost;
buffer[1]=3;      // addr=3

if(lnp_addressing_write(buffer,2,6,0)) // 3rd arg = addr of target
rcx
  {                                    // in this case it is 6
  cputs("error");
  return -1;
  }
cputs("ok");
return 0;
}

Any ideas about what is wrong ?




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