Setting the Character Size-serial port-c_cflag

This is a discussion on Setting the Character Size-serial port-c_cflag within the Networking/Device Communication forums, part of the General Programming Boards category; hi, while configuring the serial port, the character size is set as Code: options.c_cflag &= ~CSIZE; /* Mask the character ...

  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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,485
    > 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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  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, 04: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, 03:59 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21