#include <linux/irda.h>
stream_s = socket(PF_INET, SOCK_STREAM, 0);
seqpkt_s = socket(PF_INET, SOCK_SEQPACKET, 0);
dgram_s = socket(PF_INET, SOCK_DGRAM, IRDAPROTO_UNITDATA);
ultra_s = socket(PF_INET, SOCK_DGRAM, IRDAPROTO_ULTRA);
Linux-IrDA is a complete implementation of the various IrDA protocols and IrDA drivers for Linux.
The configuration of the low level of the IrDA stack (IrDA ports) and the various IrDA drivers are described in irattach(8).
The usage of the higher layers of the IrDA stack (IrCOMM, IrLPT, IrNET, IrLAN, OBEX...) are described in their respective man pages.
The core of the Linux-IrDA protocol stack is composed of the IrLAP, IrLMP, IrTTP and IrIAS protocols and is implemented as a kernel module. The programmer's interface for the IrDA stack is socket based. For more information on sockets, see socket(7).
Note that higher level IrDA protocols may offer a different programmer's interface. For example IrCOMM offers a TTY based interface and OBEX is available through a user space library.
The Linux-IrDA socket interface offers 4 types of sockets:
An IrDA socket address is defined as a combination of an IrDA interface address and a service name. Service names are automatically resolved to lsap through the IrIAP protocol.
struct sockaddr_irda {
sa_family_t sir_family; /* AF_IRDA */
__u8 sir_lsap_sel; /* LSAP selector */
__u32 sir_addr; /* Device address */
char sir_name[25]; /* Usually <service>:IrDA:TinyTP */
};
sin_family is always set to AF_IRDA. sir_lsap_sel is usually not used. sir_addr is the address of the peer and optional (and that case the first peer discoverd will be used). sir_name is the service name of the socket.
IrDA sockets supports some protocol specific socket options that can be set with setsockopt(2) and read with getsockopt(2). The socket option level for IrDA is SOL_IRLMP.
Options that can be set:
Options that can be get:
Jean Tourrilhes - jt@hpl.hp.com