0x00 char in String ?

General discussion on mikroPascal PRO for AVR.
Post Reply
Author
Message
Mira80
Posts: 18
Joined: 10 Jun 2011 07:33

0x00 char in String ?

#1 Post by Mira80 » 04 Mar 2012 23:28

Hello,
im writing application which send packet over TCP/IP. I create a telegram string like this
...
dyna := dyna + Chr(0xFF);
dyna := dyna + Chr(0xFA);
dyna := dyna + Chr(0x2C);
dyna := dyna + Chr(0x97);
dyna := dyna + Chr(PORTC);
dyna := dyna + Chr(0xFF);
dyna := dyna + Chr(0xF0);
result := result + SPI_Ethernet_putString(@dyna);
...

buw..whats a problem. If a value of PORTC is 0x00, this byte is missing in telegram. Some idea what with this ?

Thank you

User avatar
janko.kaljevic
Posts: 3565
Joined: 16 Jun 2011 13:48

Re: 0x00 char in String ?

#2 Post by janko.kaljevic » 09 Mar 2012 17:22

Hello,

Please notice that SPI_Ethernet_putstring function will transfer your string up to null terminating character.
And if your port C takes 0x00 as value, this will be considered as null termination, and any characters from it will not be transmitted.
Please check help file for details.

Best regards.

Post Reply

Return to “mikroPascal PRO for AVR General”