Thread: Setting the Character Size-serial port-c_cflag

  1. #1
    Registered User
    Join Date
    May 2010
    Posts
    8

    Setting the Character Size-serial port-c_cflag

    hi,
    while configuring the serial port, the character size is set as
    Code:
        options.c_cflag &= ~CSIZE; /* Mask the character size bits */
        options.c_cflag |= CS8;    /* Select 8 data bits */
    source: Serial Programming Guide for POSIX Operating Systems - Michael R Sweet
    if i want to take more bits than 8, what do i use?

    thanks.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,656
    > if i want to take more bits than 8, what do i use?
    Split the data into multiples of 8 bits.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    May 2010
    Posts
    8
    alrighty! thanks...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Can you help me about tolower() in file
    By nctar in forum C Programming
    Replies: 7
    Last Post: 05-12-2010, 10:04 AM
  2. Serial port communcation and computer standby mode
    By MWAAAHAAA in forum Windows Programming
    Replies: 0
    Last Post: 07-09-2009, 10:38 AM
  3. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 05:49 PM
  4. Replies: 11
    Last Post: 03-25-2003, 05:13 PM
  5. DOS, Serial, and Touch Screen
    By jon_nc17 in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 01-08-2003, 04:59 PM

Tags for this Thread