Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

IrCOMM.Serial and parallel port emulation over IR (wire replacement).V1

.0.PDF
Скачиваний:
33
Добавлен:
23.08.2013
Размер:
353.6 Кб
Скачать

IrCOMM services

Version 1.0

 

traditionally connected to Computers via Serial and/or Parallel cables.

Client/Server

The participants in an IrCOMM communication session are divided into clients and

 

servers. Clients are the devices or applications that initiate the communication. In the

 

IrDA world they perform the discovery, query the IAS, and initiate the connection.

 

Servers are the devices and applications to which clients connect. Printers and

 

modems are typical servers. When talking to printers and modems, computers are

 

clients.

LPT/COM

LPT denotes a parallel port. COM denotes a serial port.

DTE

Data Terminal Equipment - in serial communications, DTE refers to a device at the

 

endpoint of the communications path; typically a computer or terminal of some kind.

DCE

Data Circuit-Terminating Equipment - in serial communications, DCE refers to a

 

device between the communication endpoints whose sole task is to facilitate the

 

communications process; typically a modem.

User data

It is convenient to have a term that refers to the data that in the serial case travels

 

over TD and RD, or in the parallel case travels over the 8 data lines. The term user

 

data is used for this purpose.

Control data (or

All the data other than the user data. For the most part, information that travels on the

control information)

non-data circuits of the serial and parallel ports.

1.4 Byte Ordering

This document represents frames as collections of bytes (octets) with each byte being composed of 8 bits numbered 0-7. Bit 0 is always the least significant bit (LSB) and bit 7 is always the most significant bit (MSB). Bytes are represented throughout this document in the following forms:

Diagrammatic - a byte is represented as a rectangle. In some cases bit fields have special meaning and are indicated for clarity. The most significant bit is the bit on the left and the least significant bit is the bit on the right. An example is given below

7

6

5

4

3

2

1

0

CDLSAP-SEL

Hexadecimal - a byte is represented with two hex digits with the least signification nibble on the right, the most significant nibble on the left, and both digits preceded by 0x. An example is the value 5 which is written as 0x05.

Tabular - a byte is represented by a table with each row of the table corresponding to a bit. The least significant bit occupies the first row of the table and the most significant bit occupies the last row of the table. An example is given below.

3

IrCOMM services

 

 

 

 

 

Version 1.0

 

 

 

 

 

 

 

 

 

 

 

Byte 2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Bit

Function

 

 

 

 

 

 

 

 

8

Telephony

 

 

 

 

9

File Server

 

 

 

 

10

IrCOMM

 

 

 

 

11

reserved

 

 

 

 

12

reserved

 

 

 

 

13

reserved

 

 

 

 

14

reserved

 

 

 

 

15

Extension

 

1.5 References

 

 

 

 

 

 

[IRDAIRLAP]

Infrared Data Association, “Serial Infrared Link Access Protocol (IrLAP)”, Version

 

1.0

 

 

 

 

 

[IRDAIRLMP]

Infrared Data Association, “Serial Infrared Link Management Protocol (IrLMP)”,

 

Version 1.0

 

 

 

[IRDATINYTP]

Infrared Data Association, “‘Tiny TP’: A Flow-Control Mechanism for use with

 

IrLMP”, Version 1.0

 

 

 

[TIA232]

EIA/TIA-232-E (July 1991), “Interface between Data Terminal Equipment and Data

 

Circuit-Terminating Equipment Employing Serial Binary Data Interchange”.

[ITU-TV24]

ITU-T V.24 (BB 8.1, 1988), “List of Definitions for Interchange Circuits between

 

Data Terminal Equipment (DTE) and Data Circuit-Terminating Equipment (DCE)”

[IEEE1284]

IEEE Std 1284-1994, “IEEE Standard Signaling Method for a Bi-directional Parallel

 

Peripheral Interface for Personal Computers”.

[ITU-TV.110]

ITU-T Recommendation V.110 "Support of data terminal equipment (DTEs) with V-

 

series type interfaces by an integrated services digital network (ISDN) "

[ITU-TV.42]

ITU-T Recommendation V.42 "Error-Correcting Procedures for DCEs Using

 

Asynchronous-to-synchronous Conversion"

4

IrCOMM services

Version 1.0

2.IrCOMM Service Type Overview

IrCOMM emulates serial and parallel ports. However, printing and communications applications use communication ports in a variety of ways. To address this need, IrCOMM provides four service types or classes: 3-Wire raw, 3-Wire, 9-Wire, and Centronics. The service types fall into 2 camps, which are called raw and cooked; the differences hinge on whether a control channel is supplied and the type of flow control used. 3-Wire raw provides a data channel only, and uses IrLAP flow control. The “cooked” service types (3-Wire, 9-Wire, and Centronics) support a control channel, and employ Tiny TP flow control as described in [IRDATINYTP]. The meaning, format, and use of the control channel is explained in a later chapter.

2.1 3-Wire Raw

The 3-Wire raw service type can be used for serial or parallel emulation when a single exclusive connection is acceptable, and only the data circuits need to be emulated (no non-data circuits in a corresponding wired setting carry any information). The name of this service comes from the notion of emulating the minimum three RS-232 circuits (see Ref. [ITU-TV24]) required for full duplex communications. The circuits are shown below.

102

Signal Common

This circuit is not needed for IR but is shown because it is one of

 

 

the circuits that drove the definition of the name.

103

Transmitted Data (TD)

This circuit carries data transmitted by the DTE

104

Received Data (RD)

This circuit carries data received by the DTE

Here are the main attributes of the 3-Wire Raw service class:

Only one non-IAS IrLMP connection can be open if 3-Wire raw is used - all other connections must be closed before it can be established, and others must wait until the raw connection is closed before they can connect. This is because 3-Wire raw uses the flow control features of IrLAP, which can result in a deadlock condition if more than one non-IAS connection is open.

Minimal Implementation. All the IrCOMM data is sent directly over IrLMP in IrLMP packets. All data that follows the IrLMP Mux bytes in an IrLMP packet is IrCOMM data, (i.e. it is the information that would travel over the data line(s) of a wired interface). No control channel is available to communicate information about the state of other leads (e.g. RTS/CTS), software flow control settings, and the like. A service which employs 3-Wire raw must be able to do without that information. The link is merely a raw channel for the movement of data.

This service can be used to emulate both serial and parallel ports. This may seem counter-intuitive (who has ever heard of a 3-Wire parallel port?), but if you remove the non-data circuits (which 3-Wire raw does not emulate), serial and parallel are equivalent - just streams of data.

2.1.1IrLPT

IrLPT is an IrDA service in use on commercially available printing devices. It is equivalent to 3-Wire raw in functionality, but is slightly different in how it uses the IAS. See the chapter called “3-Wire Raw and IrLPT in Detail” for more information.

5

IrCOMM services

Version 1.0

2.2 3-Wire

Like 3-Wire raw, the name of this service comes from the minimum three RS-232 circuits required for full duplex communications. Like 3-Wire raw, it is intended for both serial and parallel ports. However, there are the following important differences:

3-Wire service class makes use of Tiny TP flow control, so that it may coexist with other connections that employ higher level (not IrLAP) flow control (including other cooked IrCOMM connections). It is not limited like 3-Wire raw to a single IrLMP connection.

3-Wire service class supports a control channel for sending information like data format. The control channel mechanism is described in the chapter titled Frame Formats and the Control Channel.

Because of the need for flow control and the use of the control channel, the 3-Wire service type uses a more elaborate frame format.

2.3 9-Wire

The name of this service class comes from the notion of emulating the 9 circuits of an RS-232 interface which are part of a standard IBM compatible PC. Unlike the previous services it is true to its name; 9-Wire emulates serial ports only. Three of the circuits are the same as described in the 3-Wire service classes. The other six are listed below

105Request to Send (RTS)

106Clear to Send (CTS)

107Data Set Ready (DSR)

108/2

Data Terminal Ready (DTR)

109

Data Channel Received line signal detector (RLSD), aka Carrier Detect (CD)

125

Calling indicator, aka Ring Indicator (RI)

Some attributes of this service are list below.

Like 3-Wire, it uses the Tiny TP flow control mechanism. It also uses the same control channel mechanism for sending information like data format.

The control channel is used to send the states of the other RS-232 leads as they change.

2.4 Centronics

This service is intended to emulate the function of a standard Centronics interface. This service is for parallel ports only. Some attributes of this service are listed below.

It uses the Tiny TP flow control mechanism.

It uses the same control channel mechanism used in 3-Wire to send the status/changes of the additional circuits.

See the chapter Centronics in Detail for information on the circuits emulated by Centronics.

6

IrCOMM services

Version 1.0

2.5 Summary

3-Wire raw, 3-Wire, 9-Wire, and Centronics make up the four service types defined by IrCOMM. In theory 9- Wire and Centronics service types would cover all the connections anyone needs, but the combination of historical offerings and the desire for minimal implementations has driven the specification of four service types. The next few chapters discuss the issues of service interface, flow control, control channel parameters, and discovery/IAS services. The document concludes with a detailed specification of each service type.

7

IrCOMM services

Version 1.0

3.Service Interface Definition

IrCOMM is intended to define a protocol that can be used to emulate serial and parallel ports. In most systems IrCOMM will be part of a port driver which includes a port emulation entity that must support an existing communication API. The communication APIs vary from operating system to operating system and device to device. This document does not specify how IrCOMM is used by the port driver to emulate an existing API but instead focuses on a set of services that can be used by all port drivers. Port drivers are not required to utilize all the services of IrCOMM. In fact it is the job of the port driver implementor to properly map the services of IrCOMM to the particular system.

3.1 Service Definition Model

The figure below shows a model of how IrCOMM fits into a typical system. This figure represents the IrCOMM reference model.

Legacy Application

 

 

 

 

 

 

 

port interface

 

 

 

 

 

 

 

(e.g. VCOMM)

 

 

read/write

 

control

 

 

 

 

 

 

 

 

 

 

 

 

Port Emulation Entity

 

 

 

 

 

 

 

 

 

hinting IAS

data(TX, RX)

 

general control parameters

 

 

 

 

port parameter settings

 

 

FixedPortName

 

 

 

 

 

 

 

 

 

IrCOMM

 

 

 

 

 

 

 

service interface

 

 

 

 

 

 

 

 

 

 

 

 

 

IrCOMM

Tiny TP

IrLMP

IrLAP

SIR

Infrared

8

IrCOMM services

Version 1.0

The figure below shows the wired version that is being emulated by the IrCOMM reference model

Legacy Application

port interface (e.g. VCOMM)

read/write

control

Driver (for V.24)

 

 

data(TX, RX)

hard-wired signals

V.24

RS-232

The elements for the IrCOMM reference model are described below

Legacy Application Applications which utilize conventional serial/parallel port communication interface.

Port Emulation Entity The port emulation entity maps a system specific communication interface (API) to the IrCOMM services. It is also responsible for device discovery and LM_IAS queries. The port emulation entity plus IrCOMM make up a port driver.

IrCOMM Provides a transparent data stream channel and control channel over an IrLMP link or Tiny TP link.

TinyTP Provides a data stream channel to IrCOMM along with a flow control mechanism.

IrLMP, IrLAP, SIR Link protocols defined by IrDA

Port interface (e.g. VCOMM) Application programmer's interface (API) for communication. This interface varies from system to system. An example is the VCOMM interface of Windows95.

IrCOMM service interface The IrCOMM interface provides the following services.

Connect

Disconnect

Data

Control

3.2 Connect services

IrCOMM_Connect.req(CalledLsap, ServiceType, InitialControlParameters, QoS)

IrCOMM_Connect.ind(CallingLsap, ServiceType, InitialControlParameters, QoS)

IrCOMM_Connect.rsp(InitialControlParameters)

IrCOMM_Connect.cnf(InitialControlParameters)

9

IrCOMM services

Version 1.0

The Connect services are used to establish an IR link with a peer IrCOMM system. The connection services are a confirmation type service. Upon receipt of an IrCOMM_Connect.ind primitive the responding Port Emulation Entity (IrCOMM user) must either accept or reject the incoming connection. Connections are accepted by an invocation of IrCOMM_Connect.rsp or are rejected by an invocation of IrCOMM_Disconnect.req with a reason of ‘User Disconnect’.

Parameters used in this definition are as follows.

CallingLsap, CalledLsap Caller and callee Lsap address respectively. 'CalledLsap' is discovered by the Port Emulation Entity using IrLMP discovery and IAS facilities, however, the exact algorithms used are out of scope of this document.

ServiceType Service type of IrCOMM emulation. It should be one of '3-Wire raw', '3-Wire', '9-Wire', or 'Centronics'. The value 'Default' is also permitted. Usually the initiating entity will query the IAS of the responding entity for the service types supported by the responder and use one of those.

InitialControlParameters is an optional parameter and is the initial set of values assignments for the port communication settings and line settings. The InitialControlParameters are limited to a total encoded size of 60 octets.

QoS Quality of service parameter used for IrLAP link. 'QoS' includes data rate, maximum turn around time, data size, and disconnection threshold. It is implementation specific whether this parameter is really reflected.

 

 

IrCOMM

IrCOMM

 

 

 

 

 

 

 

 

 

IrCOMM_Connect.req

 

 

 

IrCOMM_Connect.ind

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

IrCOMM_Connect.cnf

 

 

 

IrCOMM_Connect.rsp

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3.3 Disconnect service

IrCOMM_Disconnect.req(UserData)

IrCOMM_Disconnect.ind(Reason, UserData)

The Disconnect service is used to end the connection between IrCOMM entities. The user of IrCOMM is always permitted to use this service whenever it wishes to release the connection. The Disconnect service is used in these cases.

If a Port Emulation Entity (IrCOMM user) wishes to release or abort an IrCOMM connection with a peer IrCOMM entity, it will use this service.

If the underlying IR connection is disconnected, IrCOMM will notify the Port Emulation Entity via an IrCOMM_Disconnect.ind.

A Port Emulation Entity uses Disconnect service to refuse an incoming connection.

10

IrCOMM services

Version 1.0

• A Disconnect.ind is issued if the underlying layer failed to establish a connection.

Parameter used in the Disconnect services are as follows.

UserData UserData is any octet string up to 60 octets and is optional.

Reason This parameter indicates the reason why a link is disconnected or why a connection is refused. This parameter is optional. If used, 'Reason' should be one of the following:

User Disconnect

This value is used when the responder refuse to make a IrCOMM connection,

 

and when IrCOMM user wishes to disconnect the existing connection.

Provider Disconnect

This value is used when the provider of IrCOMM connection (IrCOMM or

 

underlying protocol stack) causes a disconnection.

UnSpecified Reason

This value is used when the reason is unspecified in this document.

 

IrCOMM

IrCOMM

IrCOMM_Disconnect.req

 

 

 

 

IrCOMM_Disconnect.ind

 

 

 

 

 

 

 

 

 

 

User Disconnect

 

 

 

 

 

 

 

 

 

 

User Disconnect

or Unspecified Reason

 

 

 

 

 

 

 

 

 

 

 

 

 

or Unspecified Reason

 

 

 

 

 

 

 

 

 

IrCOMM

IrCOMM

 

 

 

 

 

IrCOMM_Disconnect.ind

 

 

IrCOMM_Disconnect.ind

 

 

 

 

 

 

Provider Disconnect

 

 

Provider Disconnect

or Unspecified Reason

 

 

or Unspecified Reason

 

 

 

 

 

 

3.4 Data service

IrCOMM_Data.req(Data)

IrCOMM_Data.ind(Data)

The Data service is used to convey data between Port Emulation Entities (IrCOMM users). Each item of data (single octet or multiple octets) is regarded as part of a contiguous stream of data. IrCOMM_Data service is for a reliable data transfer. The Parameter used in this definition is as follows.

11

IrCOMM services

Version 1.0

Data Data of Port Emulation Entity to be sent.

 

IrCOMM

IrCOMM

 

 

 

 

 

IrCOMM_Data.req

 

 

IrCOMM_Data.ind

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3.5 Control service

IrCOMM_Control.req(ControlParameters)

IrCOMM_Control.ind(ControlParameters)

The Control service is used to convey control parameters between Port Emulation Entities (IrCOMM users). Default values should be assumed if no control parameters has been designated since the connection has been made. The parameter used in this service is as follows.

ControlParameters Sequence of Control Parameters. Control parameters are described in detail later in this document. Below is a list of parameters based on service type.

(1)General control parameters

-Service Type

(2)Control parameters for 3-Wire and 9-Wire service type

-Data rate

-Data Format

-Flow control

-XON/XOFF flow control characters

-ENQ/ACK flow control characters

-Line status

-Break

(3)Control parameters for 9-Wire service type

-DTE Line Settings and Changes

-DCE Line Settings and Changes

-Poll for Line Settings

(4)Control parameters for Centronics service type

-Status query

-Set Busy Timeout

-Request IEEE 1284 Mode Support

-Request IEEE 1284 Device ID

-Select IEEE 1284 Mode

12