gravi
Full Member level 2
- Joined
- May 30, 2006
- Messages
- 128
- Helped
- 10
- Reputation
- 20
- Reaction score
- 10
- Trophy points
- 1,298
- Location
- Hyderabad, India
- Activity points
- 2,452
memset sprintf
Hi
This is Ravi and working on Pic 18LF8722,MPLAB18 v3.00 compiler
static unsigned char PacketBuff[50];
memset(PacketBuff, 0, strlen(PacketBuff));
sprintf(PacketBuff,"<RESET BOR='%d' POR='%d' WDT='%d'/>",BORCount,PORCount,WDTCount);
Putsusart(PacketBuff);
result:
<RESET BOR='34', POR= '46' WDT='56'/>
<RESET BOR='34', POR= '46' WDT='56'/>
<RESET BOR=' ', POR= '46' WDT='56'/>
<RESET BOR='34', POR= ' ' WDT='56'/>
<REET BOR='34', POR= '46' WDT='56'/>
I observed sometimes that when I am trying to put the string on the hyperterminal, I have blank spaces in the buffer.
I am actually trying to print a packet data which is in User understandable format...I am seeing the spaces in between.
can anybody help me out on this....
Can anyone tell me why this is caused.
Thanks in adavance
Ravi
Hi
This is Ravi and working on Pic 18LF8722,MPLAB18 v3.00 compiler
static unsigned char PacketBuff[50];
memset(PacketBuff, 0, strlen(PacketBuff));
sprintf(PacketBuff,"<RESET BOR='%d' POR='%d' WDT='%d'/>",BORCount,PORCount,WDTCount);
Putsusart(PacketBuff);
result:
<RESET BOR='34', POR= '46' WDT='56'/>
<RESET BOR='34', POR= '46' WDT='56'/>
<RESET BOR=' ', POR= '46' WDT='56'/>
<RESET BOR='34', POR= ' ' WDT='56'/>
<REET BOR='34', POR= '46' WDT='56'/>
I observed sometimes that when I am trying to put the string on the hyperterminal, I have blank spaces in the buffer.
I am actually trying to print a packet data which is in User understandable format...I am seeing the spaces in between.
can anybody help me out on this....
Can anyone tell me why this is caused.
Thanks in adavance
Ravi