Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Topic Options
#163178 - 28/05/2003 10:51 Serial Commands/Library?
foxtrot_xray
addict

Registered: 03/03/2002
Posts: 687
Loc: Atlanta, Georgia
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.
_________________________
Mike 'Fox' Morrey 128BPM@124MPH. Love it! 2002 BRG Mini Cooper

Top
#163179 - 28/05/2003 11:14 Re: Serial Commands/Library? [Re: foxtrot_xray]
tonyc
carpal tunnel

Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
emphatic doesn't grab the serial port, ever...
_________________________
- Tony C
my empeg stuff

Top
#163180 - 28/05/2003 11:42 Re: Serial Commands/Library? [Re: foxtrot_xray]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31565
Loc: Seattle, WA
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.
_________________________
Tony Fabris

Top
#163181 - 28/05/2003 12:09 Re: Serial Commands/Library? [Re: tonyc]
foxtrot_xray
addict

Registered: 03/03/2002
Posts: 687
Loc: Atlanta, Georgia
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.
_________________________
Mike 'Fox' Morrey 128BPM@124MPH. Love it! 2002 BRG Mini Cooper

Top
#163182 - 28/05/2003 12:18 Re: Serial Commands/Library? [Re: foxtrot_xray]
tonyc
carpal tunnel

Registered: 27/06/1999
Posts: 7058
Loc: Pittsburgh, PA
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.
_________________________
- Tony C
my empeg stuff

Top
#163183 - 28/05/2003 16:36 Re: Serial Commands/Library? [Re: tfabris]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14478
Loc: Canada
I'm adding a menu selection to Hijack v336 to enable toggling the serial port behaviour.

Cheers

Top
#163184 - 28/05/2003 16:44 Re: Serial Commands/Library? [Re: mlord]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31565
Loc: Seattle, WA
Does it allow separate home/car behavior?
_________________________
Tony Fabris

Top
#163185 - 28/05/2003 16:46 Re: Serial Commands/Library? [Re: mlord]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31565
Loc: Seattle, WA
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.
_________________________
Tony Fabris

Top
#163186 - 28/05/2003 16:57 Re: Serial Commands/Library? [Re: tonyc]
foxtrot_xray
addict

Registered: 03/03/2002
Posts: 687
Loc: Atlanta, Georgia
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.
_________________________
Mike 'Fox' Morrey 128BPM@124MPH. Love it! 2002 BRG Mini Cooper

Top
#163187 - 28/05/2003 16:59 Re: Serial Commands/Library? [Re: tfabris]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14478
Loc: Canada
Mmm.. naw, I think I'll default it to regular player behaviour.

Sorry chaps!

Top
#163188 - 28/05/2003 17:01 Re: Serial Commands/Library? [Re: tfabris]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14478
Loc: Canada
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.

??

Top
#163189 - 28/05/2003 17:03 Re: Serial Commands/Library? [Re: mlord]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31565
Loc: Seattle, WA
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.
_________________________
Tony Fabris

Top
#163190 - 28/05/2003 17:05 Re: Serial Commands/Library? [Re: tfabris]
mlord
carpal tunnel

Registered: 29/08/2000
Posts: 14478
Loc: Canada
Okay, I'll make it the same as now -- affects DC/Car mode only.

Cheers

Top
#163191 - 28/05/2003 17:07 Re: Serial Commands/Library? [Re: mlord]
tfabris
carpal tunnel

Registered: 20/12/1999
Posts: 31565
Loc: Seattle, WA
Cool.
_________________________
Tony Fabris

Top