Thank you Mr Christensen,
I finally got it working, here is my c server code:
buffer[0] = (char) 0x55;
buffer[1] = (char) 0x00;
buffer[2] = (char) 0x05;
buffer[3] = (char) 0x00;
buffer[4] = (char) 0x68;
buffer[5] = (char) 0x00;
buffer[6] = (char) 0x61;
buffer[7] = (char) 0x00;
buffer[8] = (char) 0x6C;
buffer[9] = (char) 0x00;
buffer[10] = (char) 0x6C;
buffer[11] = (char) 0x00;
buffer[12] = (char) 0x6F;
//assumed the same , 55 00 05 00 68 00 61 00 6C 00 6C
00 6F, and buffer length 13, gives "hallo" and "OK"
//from the CODEC_TEST , 50 00 00 55 00 05 00 68 00 61 00 6C 00 6C
00 6F, and buffer length 16, gives "桡汬漀 o" and "INVALID_OBJECT"
//suggested , 55 00 05 68 61 6C 6C
6F , and buffer length 8 , gives "" and "OK"
n = write(newsockfd,buffer,13);
as you can see I tried everything (spend much time) and finally got it
working with the way I used all along. Embarrassed... the trick was to
set the numbers of bytes sent, in the write command, correctly ...
oops.
Your time and assistance are much appreciated, I would have given up
if it wasn't for your help.
Regards
Anro
On Oct 11, 4:07 pm, James Christensen <
james.h.christen...@gmail.com>
wrote:
> ASN.1 is a Tag/Length/Value notation. Your example is missing the Tag
> and half of the Length for the STRING data type.
> The correct contents of the message in hexadecimal notation would be
> 50 00 05 68 61 6C 6C 6F
> Here the Tag is 50, Length is 0005 and Value is as indicated.
>
> For some data types the Length value is implicit in the Tag type; for
> others (such as STRING) it is often encoded more simply than the more
> complex rules given for ASN.1.
>
> You can learn the formatting of messages by using the CODEC_TEST
> configuration in the src/ita folder. Instructions for using this
> configuration are athttp://
www.holobloc.com/doc/ita/panels/index.htm
> .
> --
> Best regards,
> Jim Christensen
>