11-02-2016 06:56 PM
You can certainly do that. But I'm sure you can send the data as bytes and not just as ASCII strings.
If you attached your C code, someone may help. (though this is a LabVIEW forum and not a C forum.)
In Basic, if you want to print a non-printable character, you'd print out something like chr$(10) which is the new line/linefeed character. I'm sure C has some equivalent function.
11-03-2016 03:05 AM
I am searching for the solution in ARM related forums. The ethernet library which I used, is utilizing a high level function for data sending. There must be some low-level functions to send bytes instead of string. I can not shift or replace ASCII characters, becuase I need the complete 0 to 255 values to send numeric data.
Thanks.
11-03-2016 08:05 AM
@iman_h wrote:I am searching for the solution in ARM related forums. The ethernet library which I used, is utilizing a high level function for data sending. There must be some low-level functions to send bytes instead of string. I can not shift or replace ASCII characters, becuase I need the complete 0 to 255 values to send numeric data.
Thanks.
It's hard to believe the library would require you to send ASCII. That would make it almost totally useless. How would you use this library to download a zip file, for instance? Remember also that you would have to have a decoder on the other side to decode the ASCII back into a binary string. In other words, a version of this library would have to exist on every single thing it is communicating with.
I think you are unnecessarily hung up on the fact that it is sending strings. Sending a string is just a way to send bytes of data. Remember, a string can contain non-printable characters, too.
11-03-2016 10:36 AM - edited 11-03-2016 10:40 AM
Let me attach some piece of code:
These are the definition of functions:
As I understood, when we fill buffer like this:
buffer[5]={48,64,112,0,65};
It is converted into a string like this:
str=0 @ p \0 A
I think the \0 between the array of characters, make the function terminate the string and send: 0 @ p. (Three bytes instead of 5 bytes)