Serial Commands/Library?

Posted by: foxtrot_xray

Serial Commands/Library? - 28/05/2003 10:51

Hey guys..
In anticipation for getting the PCB done for the external VFD, I'm going to start looking at making a simple interface to send basic data to it via the serial port.. However, having never used the seial port before, I have a few questions...

1. I notice that some items, like Hijack occasionally, Emphatic (when menus are entered/left) and sometimes the player binary.. What will happen to these if my program 'grabs' the serial port? Will those messages still be sent out? Will those programs halt until they CAN write to the port? Will my program even be allowed to write since Hijack (at least) has already 'grabbed' the port?

2. Anyone point me to either libraries, or man pages on functrions/such to use the serial port? (Well, I should say 'open and set' the serial port.. I figure that once it's opened, you got a standard file handle.. Tho I could be wrong..)


Thanks!
Me.
Posted by: tonyc

Re: Serial Commands/Library? - 28/05/2003 11:14

emphatic doesn't grab the serial port, ever...
Posted by: tfabris

Re: Serial Commands/Library? - 28/05/2003 11:42

Right now, Hijack is starting the player app with a special command line parameter to disable the player app grabbing the serial port in car mode. This is so that GPSapp can talk to the serial port. So your app would basically be in the same boat as GPSapp is: i.e., it would need Hijack and would "just work" when it was in car mode.
Posted by: foxtrot_xray

Re: Serial Commands/Library? - 28/05/2003 12:09

No, but it does write to it, right? I don't have my logs with me now, but I remember when running it, it would say that it like, "Unbind from Hijack Menu" or something..

Unless there's a difference between 'grabbing' it and simply outputting to it?

Me.
Posted by: tonyc

Re: Serial Commands/Library? - 28/05/2003 12:18

Unless there's a difference between 'grabbing' it and simply outputting to it?
Yes, there is. emphatic doesn't write to "the serial port." It writes to stdout (standard output) which happens to go to the serial port usually, but can be redirected to a file, or to /dev/null to get rid of them entirely.
Posted by: mlord

Re: Serial Commands/Library? - 28/05/2003 16:36

I'm adding a menu selection to Hijack v336 to enable toggling the serial port behaviour.

Cheers
Posted by: tfabris

Re: Serial Commands/Library? - 28/05/2003 16:44

Does it allow separate home/car behavior?
Posted by: tfabris

Re: Serial Commands/Library? - 28/05/2003 16:46

Oh, and if possible, you should probably default it to the current behavior so that the the GPSapp documentation doesn't have to be changed.
Posted by: foxtrot_xray

Re: Serial Commands/Library? - 28/05/2003 16:57

Aaaah!! Okay, thanks! (Me, shoing my ignorance. What's scary is I still know alot more than my company's "Core C" programmers..And I'm not a programmer!)

Me.
Posted by: mlord

Re: Serial Commands/Library? - 28/05/2003 16:59

Mmm.. naw, I think I'll default it to regular player behaviour.

Sorry chaps!
Posted by: mlord

Re: Serial Commands/Library? - 28/05/2003 17:01

Nope. One flash bit for it, affects both AC/DC.

But if we're REALLY REALLY sure that we always want the player on the serial port at HOME, then I can make it a DC-only thing.

??
Posted by: tfabris

Re: Serial Commands/Library? - 28/05/2003 17:03

It's just that I depend on the current behavior, which is different between home and car.

Edit: More detail:

At home, people need to be able to connect to the shell to do certain commands, or the player needs to be able to hear the "please reboot" command so that it can get a new logo or a new kernel from Logoedit. Yet, in order for GPSapp to work, the player must NOT be listening to serial.

If you make it one-bit, then I have to manually switch each time I move between home and car.
Posted by: mlord

Re: Serial Commands/Library? - 28/05/2003 17:05

Okay, I'll make it the same as now -- affects DC/Car mode only.

Cheers
Posted by: tfabris

Re: Serial Commands/Library? - 28/05/2003 17:07

Cool.