Thread: Sending a byte down serial pipe

  1. #1
    Registered User
    Join Date
    Jan 2008

    Sending a byte down serial pipe

    I have been trying to piece together some code to send one byte down a serial port. I am very new to C and have looked around with no luck on a function to do this. I found some stuff that might have done it but wasn't sure. Can anybody provide a definite answer and/or some tutorial resources?

    Thanks in advance.

  2. #2
    Registered User
    Join Date
    Oct 2006
    this is pretty broad in my opinion. a simple search yields this, have you gone through it? is this not what your looking for? if not then be more specific.

  3. #3
    Registered User
    Join Date
    Jan 2008
    I think this is might do it. I tried to search on output functions instead of c serial programming if you think that I am the lazy type. I actually spent upwards of 4 hours searching through linux man and other sources. Thanks again .|..

  4. #4
    Kernel hacker
    Join Date
    Jul 2007
    Farncombe, Surrey, England
    In linux, the serial port (on a PC at least) is called "/dev/ttyS<n>", where n is the number of the port, e.g. /dev/ttyS0 is the first port on a PC.

    To send data to the serial port, you need to (at least) open the port and write to it. If you want to also receive data, you will need to read from the same file-handle.

    For more advice, it would be necessary to know more about what you actually want to achieve and what sort of communication needs you have in mind.

    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. sending data over UDP from serial port
    By forumguy in forum Linux Programming
    Replies: 0
    Last Post: 04-25-2009, 02:10 PM
  2. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 05:49 PM
  3. About aes
    By gumit in forum C Programming
    Replies: 13
    Last Post: 10-24-2006, 03:42 PM
  4. Please help with serial communication problem - Long
    By spdylude in forum Windows Programming
    Replies: 3
    Last Post: 04-06-2005, 09:41 AM
  5. error: identifier "byte" is undefined.
    By Hulag in forum C++ Programming
    Replies: 4
    Last Post: 12-10-2003, 05:46 PM