Linux Send Binary Data To Serial Port Average ratng: 6,3/10 3682 reviews
Free hollywood movies in hindi. Your serial port is setup for canonical input, i.e. Lines of ASCII text. Either switch to raw mode or transform the binary data at both ends. Look at uuencode and uudecode for transmission of binary data over an ASCII medium. It's the traditional way of sending binary data in text-only e-mail and USENET postings. Hi Guys, I am trying to build an Ad-hoc system where i am using Cpro's to send and receive data over wifi but this data will be fetched to the Cpro via. Tried to write C code to write on the serial port and read the same data back as mentioned in the sample python code “Example Usage” in the above link.
Linux Connect To Serial Port
P: 2 | - #define STRICT
- #include <tchar.h>
- #include <windows.h>
- #include 'Serial.h'
- int WINAPI _tWinMain
- (
- HINSTANCE /*hInst*/,
- HINSTANCE /*hInstPrev*/,
- LPTSTR /*lptszCmdLine*/,
- int /*nCmdShow*/
- )
- {
- CSerial serial;
- // Attempt to open the serial port (COM1)
- serial.Open(_T('COM1'));
- // Setup the serial port (9600,N81) using hardware handshaking
- serial.Setup(CSerial::EBaud9600,CSerial::EData8,CSerial::EParNone,CSerial::EStop1);
- serial.SetupHandshaking(CSerial::EHandshakeHardware);
- // The serial port is now ready and we can send/receive data. If
- // the following call blocks, then the other side doesn't support
- // hardware handshaking.
- serial.Write('Hello world');
- // Close the port again
- serial.Close();
- return 0;
- }
I have used this code and it says 'Just call the Write method and supply a string. The Write routine will detect how long the string is and send these bytes across the cable.' But program give some errors while building the exe file. |
|
Active5 years, 10 months ago


I'm working a lot with CuteCom at the moment. But I could not yet find out how to send hex to the serial port. As an example I would like to send the character 0xFF. In the description on the internet it says, that CuteCom can do that. But how?
Braiam
54.1k2121 gold badges144144 silver badges229229 bronze badges
BotnicBotnic
1 Answer
I found the solution:
In the lower right corner you can find a drop-down. Set it to 'Hex input'. Now you can insert hex to the 'Input' LineEdit. Do not use any 0x or similar. Example:

karel
Linux Binary File To Text
67.6k1414 gold badges150150 silver badges170170 bronze badges
BotnicBotnic
Not the answer you're looking for? Browse other questions tagged serial-port or ask your own question.