J
jt
Ref: I'm building a new character array (alerts.msg).
I have a character array with a mix of binary and text characters with is
"alertmsg". Some of the characters are a DLE (0x10) char that I need to
trigger off of and then subtract the next char by 0x20. I'm not able to
match the DLE as I go thru the character array.
Also, I'm I substracting the character correctly.
Below is a snippet of my code. Can you see if I am doing something wrong?
Thanks!
===================== code snippet ======================
#define DLE 0x10
alerts.len=0;
tlen=strlen(alertmsg);
for (i=0; i<=tlen;i++)
{
if (alertmsg==DLE) -----> can't find a match as I go thru the
character array.
{
alerts.msg[alerts.len]= alertmsg[i+1] - 0x20;
i+=2;
}else{
alerts.msg[alerts.len]=alertmsg;
++i;
}
++alerts.len;
}
I have a character array with a mix of binary and text characters with is
"alertmsg". Some of the characters are a DLE (0x10) char that I need to
trigger off of and then subtract the next char by 0x20. I'm not able to
match the DLE as I go thru the character array.
Also, I'm I substracting the character correctly.
Below is a snippet of my code. Can you see if I am doing something wrong?
Thanks!
===================== code snippet ======================
#define DLE 0x10
alerts.len=0;
tlen=strlen(alertmsg);
for (i=0; i<=tlen;i++)
{
if (alertmsg==DLE) -----> can't find a match as I go thru the
character array.
{
alerts.msg[alerts.len]= alertmsg[i+1] - 0x20;
i+=2;
}else{
alerts.msg[alerts.len]=alertmsg;
++i;
}
++alerts.len;
}