Dear Developer's,<div><br></div><div>I have been working in decoding the IEEE802154 packets and 6LoWPAN packets. It took some time to understand the decoding functionality. Pls Help! </div>
<div><br></div><div>Now my problem is, </div><div><br></div><div>One byte is missing when i try to separate the structure like ( uint16_t , uint8_t,<b>here next 8 bit is missing,</b> uint16_t ...) it jumps to the next 16 bit and next 16 bit and soo on! What is the problem here? </div>
<div><br></div><div>whereas it works correctly either if i use ( uint16_t , uint8_t ,uint8_t,uint16_t ,uint16_t , and so.... ) or ( uint16_t ,uint16_t ,uint16_t ,uint16_t , ... ) . I couldn't understand this. </div><div>
<br></div><div><b>Details :</b></div><div><br></div><div>The current Header of IEEE802154 packet.</div><div><br></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div>octects 2 1 2 2 2 </div>
<div>| FCF | Seq no | Dst Pan | Dst Add | Src Add | remaining data </div></blockquote><div><div><br></div><div>Hex : 61 88 d9 <b>22</b> 00 01 00 64 00 e0 ... Data... [ <b><i>the byte 22 is missing when i print the hole order ]</i></b> </div>
<div><br></div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div>My Structure Declarations</div></div><div><div><br></div><div><i>typedef struct Ieee802154Hdr_ {</i></div><div><i> uint16_t ieee802154_fcf;</i></div>
<div><i> uint8_t ieee802154_seq;</i></div><div><i> uint16_t ieee802154_dstpan;</i></div><div><i> uint16_t ieee802154_dstadd;</i></div><div><i> uint16_t ieee802154_srcadd;</i></div><div><i>} Ieee802154Hdr;</i></div>
</div><div><br></div><div> SCLogInfo("\n Length %d ieee FCF: %x | ieee seq %x | DstPan %04x | Dstadd %04X | SrcAdd %04x",len,ntohs(p->ieeeh->ieee802154_fcf),ntohs(p->ieeeh->ieee802154_seq),ntohs(p->ieeeh->ieee802154_dstpan),ntohs(p->ieeeh->ieee802154_dstadd),ntohs(p->ieeeh->ieee802154_srcadd));</div>
</blockquote><div><div><b><br></b></div><div><b>Output is:</b> </div></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div><div>Length 26 ieee FCF: 6188 | ieee seq d9 | DstPan 0001 | Dstadd 0064 | SrcAdd 00e0</div>
</div></blockquote><div><div> <b>it should be 0022 0001 0064</b> </div><div><br></div><div>Note: If I use the (uint16_t) continuously, I get the bytes correctly. How to overcome this problem. </div>
<div><br></div><div><b>Question 2: </b></div><div><br></div><div>How to use the SCLogDebug and Printf lines to get printed in console? Since I couldn't find that. I started using SCLogInfo to print and debug the error's. </div>
<div><br></div>-- <br>Best Regards,<br>Prabhakaran Kasinathan<br><a href="tel:%2B39%203279720502" value="+393279720502" target="_blank">+39 3279720502</a><br><br>
</div>