> -----Original Message----- > From: [EMAIL PROTECTED] [mailto:tinyos-help- > [EMAIL PROTECTED] On Behalf Of Philip Levis > Sent: Thursday, June 29, 2006 14:06 > To: [EMAIL PROTECTED] > Cc: tinyos-help@Millennium.Berkeley.EDU > Subject: RE: [Tinyos-help] Mate and send_lqi on Telosb/tmote > > On Thu, 2006-06-29 at 11:29, Ben Kelley wrote: > > MateRoute to the MultiHop > > format? > > > > I can't help but wonder if this also has something to do with the > > AM_BUFFERMSG that my makefile keeps trying to mig. > > It doesn't have much to do with AM_BUFFERMSG. This is just how the Mate' > build system gets mig to generate a Java class for the actual buffer > data structure. > > It has to do with the packet format. The mig-generated packet formats > are not the same as those the node is using. What you need to do is get > them to agree. My intention was to get you to correct the MateRoute to > match the MultiHop format. > > You want to put this in mhop.h: > > typedef struct MateRouteMsg { > uint16_t sourceaddr; > uint16_t originaddr; > int16_t seqno; > int16_t originseqno; > uint16_t hopcount; > uint8_t data[(TOSH_DATA_LENGTH - 10)]; > } MateRouteMsg; > > You then need to go into your VM app directory and > > make clean > > To remove all of the generated packet files. Then do the standard make, > make install. > > Here are the basic issues you might run into and their causes: > > type UNKNOWN, type NONE: the packet format TinyOS is generating and the > packet format the Java side is expecting do not agree. The Java side is > looking for a type field in the buffer, and because the formats do not > agree, it is looking in the wrong place, seeing a different byte, and > then complaining it is not valid. > > too short: The packet formats do not agree. TinyOS is sending a shorter > packet than what the Java side expects. This happens if the Java side > has been compiled to think that the header is larger than the one TinyOS > expects. > > Apologies that I can't look into the code right now: trying to get the > 2.0 beta2 release out. > > Phil >
I finally got it to work, I have no idea how. I ended up going with typedef struct MateRouteMsg { uint16_t sourceaddr; uint16_t originaddr; int16_t seqno; int16_t originseqno; uint16_t hopcount; uint8_t data[]; } __attribute__ ((packed)) MateRouteMsg; In $TOSDIR/lib/VM/types/mhop.h I don't believe I changed anything else; however, just for the archives, it at least works. Received broadcast buffer of type TTEMP, size 10 @ Wed Jul 05 17:53:30 EDT 2006 [7104][7105][7107][7107][7107][7108][7108][7108][7108][7107] Message <MateBCastMsg> [buffer.type=0x1] [buffer.data.length=0x16] [buffer.data.data=0x38 0xa 0xc0 0x1b 0xc1 0x1b 0xc3 0x1b 0xc3 0x1b 0xc3 0x1b 0xc4 0x1b 0xc4 0x1b 0xc4 0x1b 0xc4 0x1b 0xc3 0x1b 0x0 0x0 0x0 0x0 ] Message <MateMultiHopMsg> [sourceaddr=0x0] [originaddr=0x0] [seqno=0x0] [originseqno=0x8] [hopcount=0x0] Ben _______________________________________________ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help