IrDa print server - howto?

5 views
Skip to first unread message

Automatix

unread,
Jun 20, 2005, 1:31:10 PM6/20/05
to
Hi all,

i'd like to implement an IrDa print server,
receiving printing requests from mobile phones or
notebooks via IR and redirecting them to a local
port or file on the PC / PDA, with Winsock-API
(WIN32 and/or WinCE).
My problem is that i cannot find a way to set the
device info (resp. printer hint bit) via setsockopt(),
so that IR-connected devices will accept my server as a
printer device.
Is there e.g. an undocumented OptionName for
WSHSetSocketInformation() to set the hint bits for the
local device? Or is it a general limitation of
current irda.sys / wshirda.dll that device hint bits
are always hard coded, so the only way is a complete
replacement of the irda protocol stack?

Thanks for replies,
Gilbert

Alan J. McFarlane

unread,
Jun 21, 2005, 1:48:07 PM6/21/05
to
I suggest we restrict any follow-ups to
microsoft.public.win32.programmer.networks, where this is most on-topic.

In article news:uaLYa3bd...@TK2MSFTNGP15.phx.gbl, Automatix wrote:
[...]


> My problem is that i cannot find a way to set the
> device info (resp. printer hint bit) via setsockopt(),
> so that IR-connected devices will accept my server as a
> printer device.
>

I know of no way to set hint bits on Windows, it's been discussed here
before and no other answer appeared. :-( See
http://groups.google.co.uk/group/microsoft.public.win32.programmer.networks/browse_frm/thread/d195bf0ca910c1a1/6648f32db961ac09?q=irlpt.server&rnum=1&hl=en#6648f32db961ac09
and also Section 4.10.3 of
http://www.alanjmcf.me.uk/comms/infrared/Microsoft%20Windows%20IrDA%20programming.html

I'd love to hear otherwise of course.


> Is there e.g. an undocumented OptionName for
> WSHSetSocketInformation() to set the hint bits for the
> local device? Or is it a general limitation of
> current irda.sys / wshirda.dll that device hint bits
> are always hard coded, so the only way is a complete

It does appear to be hard-coded. I suppose one could try and alter the
binary, perhaps it's stored as a constant somewhere. How that plays
with system file protection etc though...

> replacement of the irda protocol stack?
>

It appears that the port of the Linux stack to Windows has indeed been
used for this purpose, see the last sentence of page 14 in this
presentation, http://www.ukuug.org/events/linux2003/papers/Kiska.pdf
--
Alan J. McFarlane
http://www.alanjmcf.me.uk/
Please follow-up in the newsgroup for the benefit of all.

Poonawala [MSFT]@discussions.microsoft.com Mazahir Poonawala [MSFT]

unread,
Jun 29, 2005, 2:48:05 PM6/29/05
to
Problem Description:
===============
I'd like to implement an IRDA print server, receiving printing requests from
mobile phones or notebooks via IRDA and redirecting them to a localport or
file on the PC / PDA, with Winsock-API (WIN32 and/or WinCE).
My problem is that I cannot find a way to set the device info (esp. printer
hint bit) via setsockopt, so that IR-connected devices will accept my server
as aprinter device.

Is there e.g. an undocumented OptionName for WSHSetSocketInformation() to
set the hint bits for the local device? Or is it a general limitation of
current irda.sys / wshirda.dll that device hint bits are always hard coded,

so the only way is a complete replacement of the IRDA protocol stack?

Answers:
=======
If the OS is some flavor of Win CE then the following answer will not apply.

If you are using Win 2000 and later OS then here is the answer:

Windows Desktop OS does not have an API to change the hint bits. Hints bits
are just that, hints, and don't really tell you if a service is available so
our recommended procedure is to query the IAS database for the service.

We do have an undocumented and unsupported way of setting the hint bits via
the registry.

HKLM\System\CurrentControlSet\Services\irda\pamameters\HINTCHARSET=x

where x is a DWORD with the low order byte equal to character set (0x00),
next byte is last hint byte.

This is the default:

#define IRLAP_DEFAULT_HINTCHARSET 0x842500 // computer, IrCOMM, Obex,
and telephony

So you will want to add HINTCHARSET=0x8C2500 for the printer.


Byte 1 Byte 2

Bit Function Bit Function

0 PnP Compatible 8 Telephony

1 PDA/Palmtop 9 File Server

2 Computer 10 rsvd

3 Printer 11 rsvd

4 Modem 12 rsvd

5 Fax 13 rsvd

6 LAN Access 14 rsvd

7 Extension 15 Extension


Please keep in mind that this registry key and the values are not supported
and may change from one OS to another or from one service pack to another.


thanks,
Mazahir Poonawala
Microsoft Developers Support

Reply all
Reply to author
Forward
0 new messages