Documentation  |   Table of Contents   |  < Previous   |  Next >  

61    IrLib.h

Porting Applications to Palm OS® Cobalt

Exploring Palm OS®

Versions of Palm OS prior to 6.0 offered a separate library, called IRLib, for performing infrared communications. This library has been deprecated and should not be used when creating new applications. All functions, and essentially all macros, formerly declared in IrLib.h are not declared in Palm OS Cobalt.

Application developers using Palm OS Cobalt have three options for communicating over IR:

  • The Exchange Manager provides a high-level interface that handles all of the communication details transparently. See Chapter 4, "Object Exchange," of Exploring Palm OS: High-Level Communications for more information.
  • The Serial Manager provides a virtual driver that implements the IrComm protocol. To use IrComm, you specify sysFileCVirtIrComm as the port you want to open and use the Serial Manager APIs to send and receive data on that port. See Chapter 2, "The Serial Manager," of Exploring Palm OS: Low-Level Communications for information on how to use the Serial Manager APIs.
  • The Sockets API lets you use the same functions you would use for other communications methods to perform IR communications. IR communication using the sockets API is documented in Exploring Palm OS: Low-Level Communications; see Chapter 6, "Introduction to Infrared Communication (Beaming),".

NOTE: Early in the porting process you may want to #include IrLibCompatibility.h (after the #include for PalmOS.h). This header file defines a number of APIs and macros that allow applications calling certain deleted functions and functions with modified prototypes to compile and run. This compatibility header should not be counted on long-term, however, so later in the porting process you should remove the #include and fix any problems that result.

Deleted APIs ^TOP^

Table 61.1  Deleted functions

IrBind()

IrClose()

IrConnectIrLap()

IrConnectReq()

IrConnectRsp()

IrDataReq()

IrDisconnectIrLap()

IrDiscoverReq()

IrHandleEvent()

IrIAS_Add()

IrIAS_Next()

IrIAS_Query()

IrIAS_SetDeviceName()

IrIsIrLapConnected()

IrIsMediaBusy()

IrIsNoProgress()

IrIsRemoteBusy()

IrLocalBusy()

IrMaxRxSize()

IrMaxTxSize()

IrOpen()

IrSetDeviceInfo()

IrTestReq()

IrUnbind()

IrWaitForEvent()

Table 61.2  Deleted macros

IrAdvanceCredit()

IrIAS_GetInteger()

IrIAS_GetIntLsap()

IrIAS_GetObjectID()

IrIAS_GetOctetString()

IrIAS_GetOctetStringLen()

IrIAS_GetType()

IrIAS_GetUserString()

IrIAS_GetUserStringCharSet()

IrIAS_GetUserStringLen()

IrIAS_StartResult()

IrSetConTypeLMP()

IrSetConTypeTTP()

Table 61.3  Deleted structures

IrStatsType

ListEntry

_hconnect

Table 61.4  Deleted types

BOOL

Table 61.5  Deleted #defines

irGetScanningMode

irGetStatistics

irLibTrap...

irRestoreScanning

irSetBaudMask

irSetScanningMode

irSetSerialMode

irSetSupported

irSuppressScanning

LCON_FLAGS_TTP

Modified APIs ^TOP^

Table 61.6  Modified structures 

Modified API

Description of change

IrCallBackParms

The order of the fields in this structure has changed, and the reserved fields needed for alignment padding are no longer present.

IrConnect

The flags, reserved, callBack, packet, packets, and sendCredit fields are no longer present, and the structure now contains a data field that contains 32 unsigned bytes.

IrDeviceList

The nItems field is now 32 bits long, and the reserved field needed for alignment padding is no longer present.

IrIasAttribute

The len and valLen fields are now declared as size_t, and the reserved fields needed for alignment padding are no longer present.

IrIasObject

The len field is now declared as size_t, the nAttribs field is now 16 bits long, and an objectID field has been added.

IrPacket

This structure has changed radically; only the buff and len fields remain unchanged. All other fields are no longer present. New status and next fields (plus a reserved1 field) have been added.

_IrIasQuery

The queryLen, resultBufSize, and resultLen fields are now declared as size_t. The reserved field needed for alignment padding is no longer present. The listLen and offset fields have traded places, and offset is now 32 bits long. Finally, overFlow is now a Boolean.

Unchanged APIs ^TOP^

Table 61.7  Unchanged macros

IasGetU16()

IasGetU32()

Table 61.8  Unchanged structures

IrDeviceAddr

IrDeviceInfo

IrIasQuery

Table 61.9  Unchanged types

IrCharSet

IrEvent

IrStatus

Table 61.10  Unchanged #defines 

exgIrObexScheme

IAS_ATTRIB_INTEGER

IAS_ATTRIB_MISSING

IAS_ATTRIB_OCTET_STRING

IAS_ATTRIB_UNDEFINED

IAS_ATTRIB_USER_STRING

IAS_GET_VALUE_BY_CLASS

IAS_RET_NO_SUCH_ATTRIB

IAS_RET_NO_SUCH_CLASS

IAS_RET_SUCCESS

IAS_RET_UNSUPPORTED

irFtrCreator

irFtrNumVersion

irLibName

irOpenOptBackground

irOpenOptDisconnect12

irOpenOptDisconnect16

irOpenOptDisconnect20

irOpenOptDisconnect25

irOpenOptDisconnect3

irOpenOptDisconnect30

irOpenOptDisconnect40

irOpenOptDisconnect8

irOpenOptSpeed115200

irOpenOptSpeed19200

irOpenOptSpeed38400

irOpenOptSpeed57600

irOpenOptSpeed9600

IR_CHAR_ASCII

IR_CHAR_ISO_8859_1

IR_CHAR_ISO_8859_2

IR_CHAR_ISO_8859_3

IR_CHAR_ISO_8859_4

IR_CHAR_ISO_8859_5

IR_CHAR_ISO_8859_6

IR_CHAR_ISO_8859_7

IR_CHAR_ISO_8859_8

IR_CHAR_ISO_8859_9

IR_CHAR_UNICODE

IR_DEVICE_LIST_SIZE

IR_HINT_COMPUTER

IR_HINT_EXT

IR_HINT_FAX

IR_HINT_FILE

IR_HINT_HTTP

IR_HINT_IRCOMM

IR_HINT_LAN

IR_HINT_MESSAGE

IR_HINT_MODEM

IR_HINT_OBEX

IR_HINT_PDA

IR_HINT_PNP

IR_HINT_PRINTER

IR_HINT_TELEPHONY

IR_MAX_ATTRIBUTES

IR_MAX_CON_PACKET

IR_MAX_DEVICE_INFO

IR_MAX_IAS_ATTR_SIZE

IR_MAX_IAS_NAME

IR_MAX_LSAP

IR_MAX_QUERY_LEN

IR_MAX_TEST_PACKET

IR_MAX_TTP_CON_PACKET

IR_MAX_XID_LEN

IR_STATUS_DISCONNECT

IR_STATUS_FAILED

IR_STATUS_LINK_OK

IR_STATUS_MEDIA_BUSY

IR_STATUS_MEDIA_NOT_BUSY

IR_STATUS_NO_IRLAP

IR_STATUS_NO_PROGRESS

IR_STATUS_PENDING

IR_STATUS_SUCCESS

LEVENT_DATA_IND

LEVENT_DISCOVERY_CNF

LEVENT_LAP_CON_CNF

LEVENT_LAP_CON_IND

LEVENT_LAP_DISCON_IND

LEVENT_LM_CON_CNF

LEVENT_LM_CON_IND

LEVENT_LM_DISCON_IND

LEVENT_LM_SEND_IND

LEVENT_PACKET_HANDLED

LEVENT_STATUS_IND

LEVENT_TEST_CNF

LEVENT_TEST_IND

Table 61.11  Unchanged application-defined functions

IrCallBack()

IrIasQueryCallBack()