[prev in list] [next in list] [prev in thread] [next in thread] 

List:       nsbasic-palm
Subject:    Re: [nsbasic-palm] Receiving an IR Print job
From:       Douglas Handy <dhandy1 () bellsouth ! net>
Date:       2005-05-31 2:07:29
Message-ID: eoen9196g6ft3tsb4hod95fm7au9537b21 () 4ax ! com
[Download RAW message or body]

Jeff,

>Is it possible to configure the IR port to emulate an IR Printer in 
>order to receive a plain text print job from a PC?  

While a plain text print job may not have special printer escape sequences, it
still isn't going to be sent as raw serial IR.  IR printers expect a higher
level protocol using one of various IrDA framing modes to encapsulate the raw
data, provide error checking, etc.

So no, you can't just use SerialOpen() and expect to receive a print job.  I
suspect it would require interfacing to the Palm OS IR Library and handling all
the IrDA acknowledgements and protocall specifications.  But I admit I haven't
done much with IR, so I may be off-base here.

Perhaps someone with more knowledge of IrDA can jump in and provide a more
complete answer, or prove me wrong.

However, I don't *think* you will be able to easily do what you want.  I'm sure
it is possible to emulate an IR printer's responses using a palm os device, but
I suspect it will require a much lower level access to the IR library than is
possible in NSB/Palm, plus a good understanding of IrDA specs.  For example,
when trying to connect to another IrDA device, the sender uses an IrDA
"discovery mode" to find nearby devices, and it gets back a device information
reply from the device.  This includes both the device name and a "hint" as to
the device type, where there are different values for a PDA, computer, printer,
modem, fax, etc.  The IrDA specification does this so that it is easier for a
device to decide who it wants to connect to during a discovery process.  That
is, if multiple devices are in range and respond to the discovery request, the
hint value can be used to distinguish between a printer and PDA without asking
the user to select from a list of neary IR devices found.  Thus you may need to
control things like the device type hint passed back during IR discovery.  

That's probably just one example of the things you may run into it.  I still
suspect it would be doable when done via an environment like C, but for IrDA the
OS's IR Library uses a callback paradigm which alone would be enough to make it
incompatible with NSB/Palm.  So at best you would have to perform the printer
emulation is a shared library.

If you can get the PC to send the data in a filename ending in *.txt, the OS
will receive it and place it in a memo for you.  It would probably have a 4K
limit on the length though, at least on OS 3.x and 4.x devices.  

YMMV.

Doug



Complete Searchable Archive:
 http://marc.theaimsgroup.com/?l=nsbasic-palm&r=1&w=2

Shortcut URL to this page:
 http://groups.yahoo.com/group/nsbasic-palm  
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/nsbasic-palm/

<*> To unsubscribe from this group, send an email to:
    nsbasic-palm-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic