Yeah my bad... My reason code explains it all.
Printable View
Yeah my bad... My reason code explains it all.
STX = Start Of Text:
http://www.december.com/html/spec/ascii.html
aka CTRL-B
Code:cMsgFinal = malloc(iLen + 4);
if(cMsgFinal)
{
cMsgFinal[0] = cSTX;
cMsgFinal[1] = 0;
strcat(cMsgFinal, pMsg);
strcat (cMsgFinal, "\r\n");
VcomSendSocket(iUserSocket, cMsgFinal, iLen+4);
free(cMsgFinal);
}
else
{
// Do some error for out of memory situation!
}
The blue bit is something I'm not sure of - I suspect you want to send ALL of the message, not all but the last 4 [but perhaps it's adding 4 somewhere else?]
The red bits I'm pretty darn sure are right.
--
Mats