|    |  
      Hey, 
 
I am trying to get my computer to talk to 2 rcxs.  I have the program and 
when I send ir messages to the RCX loaded with LegOS, it shows the IR port 
on.  However I do not understand what the packets should look like with the 
intergrity layer.  Right now I have something like: 
 
	MsgData[0] = 0xF0; //Header 
	MsgData[1] = 0x01; //Lenght 
	MsgData[2] = 0x01; //Data 
	MsgData[3] = 0x03; //Checksum (Not sure about this) 
 
and the rcx is loaded with: 
 
#include <conio.h> 
#include <unistd.h> 
#include <string.h> 
#include <lnp.h> 
 
static int quit = 0; 
 
void my_integrity_handler(const unsigned char *data, unsigned char len) 
{ 
	char msg[7]; 
	int i; 
 
	if (len > 5) len = 5; 
	for (i = 0; (i < len); i++) msg[i] = data[i]; 
	msg[i] = '\0'; 
	cputs(msg); 
	if (data[0] == 1) quit = 1; 
} 
 
int main() 
{ 
 
	lnp_integrity_set_handler(my_integrity_handler); 
	cputs("ready"); 
 
	while(!quit) 
	{ 
	} 
	return 0; 
} 
 
I would like the rcx to quit.  When it recieves the message 1.  I know the 
message is sending because I used NCQ before and it worked great. 
 
Thanks for you help, 
Trevor Foley 
 |  
       |  
           
   
        Message has 1 Reply:        |    | Re: LNP Help
  |  
  |  (...) Is there some reason you're not using liblnp? It will take care of all this junk for you and you just have to give it the data.    (25 years ago, 14-Jan-01, to lugnet.robotics.rcx.legos)   
   |         
      2 Messages in This Thread:      
 
      - Entire Thread on One Page:
      
        
- Nested: 
        All | Brief | Compact | Dots
        
 Linear: 
        All | Brief | Compact
           
         | 
        
  | 
      
 
   | 
           |