Talk About Network

Google





Programming > C - C++ Learning > Re: If NULL End...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 11 of 19 Topic 4067 of 4400
Post > Topic >>

Re: If NULL Ends a String or Char[], How to Send NULL to a File?

by Hal Vaughan <hal@[EMAIL PROTECTED] > Mar 13, 2008 at 06:59 PM

Hal Vaughan wrote:

....
> On the other end, in what will be another thread once I get it all
> working, I'm writing to the serial ****t as a binary file and I open it
> like this:
> 
>         int serfd;
>         string serdev = "/dev/ttyS0";
>         serfd = open(serdev, O_RDWR | O_NOCTTY | O_NDELAY);

Just as an update:

This method works and the device connected to the serial ****t responds to
it.  The other method I tried (using fopen, putc), didn't work.  I don't
know if there's an issue with the serial ****t or not, but I can write a
character at a time to the serial ****t either way, so I'm not changing
what
works.

I also realize it's possible this changes settings that I'll be setting
once
I add all the initialization code to make sure the ****t is behaving on all
computers no matter what was using it last, but if it works, I'm not going
to fix it.

Just for general info, in case anyone is curious, I'm controlling an HD
Radio from the computer.  The idea is to make this part of a carputer. 
Unless you go with a pre-made system, you can't control your car radio
from
a carputer, so you can pick your tunes or switch over to the car radio,
but
you can't do both from one control point.  When this is done, and after we
send the code to nGhost to use, it'll be part of that system for Linux
carputers and on the LinuxICE distro.

Now that I've got the programs actually listening and writing to the
serial
****t and we have tables of the command codes, the rest is basically
tedious
bookkeeping to decode and encode commands and data.

Thanks for the help!  (I'm sure I'll be back to read more and ask more if
I
get stuck again!)

Hal
 




 19 Posts in Topic:
If NULL Ends a String or Char[], How to Send NULL to a File?
Hal Vaughan <hal@[EMAI  2008-03-13 08:28:33 
Re: If NULL Ends a String or Char[], How to Send NULL to a File?
Richard Heathfield <rj  2008-03-13 10:33:41 
Re: If NULL Ends a String or Char[], How to Send NULL to a File?
Hal Vaughan <hal@[EMAI  2008-03-13 13:38:19 
Re: If NULL Ends a String or Char[], How to Send NULL to a File?
Richard Heathfield <rj  2008-03-13 14:00:08 
Re: If NULL Ends a String or Char[], How to Send NULL to a File?
Hal Vaughan <hal@[EMAI  2008-03-13 14:27:55 
Re: If NULL Ends a String or Char[], How to Send NULL to a File?
Richard Heathfield <rj  2008-03-13 14:35:06 
Re: If NULL Ends a String or Char[], How to Send NULL to a File?
Hal Vaughan <hal@[EMAI  2008-03-13 14:38:36 
Re: If NULL Ends a String or Char[], How to Send NULL to a File?
Richard Heathfield <rj  2008-03-13 16:14:14 
Re: If NULL Ends a String or Char[], How to Send NULL to a File?
Hal Vaughan <hal@[EMAI  2008-03-13 16:47:31 
Re: If NULL Ends a String or Char[], How to Send NULL to a File?
"R. Scott Mellow&quo  2008-03-13 13:07:37 
Re: If NULL Ends a String or Char[], How to Send NULL to a File?
Hal Vaughan <hal@[EMAI  2008-03-13 18:59:08 
Re: If NULL Ends a String or Char[], How to Send NULL to a File?
"Ralph D. Ungermann&  2008-03-13 15:03:06 
Re: If NULL Ends a String or Char[], How to Send NULL to a File?
Hal Vaughan <hal@[EMAI  2008-03-13 16:56:49 
Re: If NULL Ends a String or Char[], How to Send NULL to a File?
Richard Heathfield <rj  2008-03-13 17:04:36 
Re: If NULL Ends a String or Char[], How to Send NULL to a File?
Anand Hariharan <mailt  2008-03-13 15:45:18 
Re: If NULL Ends a String or Char[], How to Send NULL to a File?
"Ralph D. Ungermann&  2008-03-13 14:38:28 
Re: If NULL Ends a String or Char[], How to Send NULL to a File?
Philip Potter <pgp@[EM  2008-03-13 16:20:55 
Re: If NULL Ends a String or Char[], How to Send NULL to a File?
"Ralph D. Ungermann&  2008-03-13 18:57:23 
Re: If NULL Ends a String or Char[], How to Send NULL to a File?
"Ed Norris" <  2008-03-15 20:05:55 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Wed Jan 7 12:45:06 PST 2009.