From: mahendra v. <mah...@gm...> - 2010-08-05 09:08:30
|
Hi In the ATM driver during reception, I have a doubt in finding the length of the received bytes. 1. If the user send me 40 bytes of data, below is the dump of the buffer with trailer size: 56 getrsmbuffer = cf888000 ------------------------------------------------------------------------------------------------------------- 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x0 0x0 0x0 0x28 0xdf 0xe9 0x8c 0x21 0xae 0x7b 0x62 0x16 0xce 0xf5 0xf1 0x2f 0x0 0x0 0x0 0x28 0xdf 0xe9 0x8c 0x21 = trailer with 0x28 as length indicator. 2. If the user send me 80 bytes of data, below is the dump of the LAST buffer with trailer size: 56 getrsmbuffer = cf878048 --------------------------------------------------------------------------------------------------------------------------- 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x69 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x50 0xdc 0x9e 0xca 0xa4 0x0 0x0 0x0 0x0 0x1e 0xd8 0xd2 0xeb 0xff 0xff 0xff 0xff 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 = padding data(8 bytes) after data 0x69 0x0 0x0 0x0 0x50 0xdc 0x9e 0xca 0xa4 = trailer with 0x50 as length indicator But, In realtime I do not know how many bytes the user will send to me. The padding bytes and the trailer area in the last buffer differs depending on the number of received bytes. I need to get the length indicator field through some logic irrespective of the number of received bytes. Can you please help me on the above ? Mahendra |