© 2000 Ubicom, Inc. All rights reserved. - 12 - www.ubicom.com AN16 SX IrDA Virtual Peripheral Implementation For a XID command frame with a slot number of $FF a
XID frame will be sent with the XID discovery information
field,  otherwise  the  discovery  information  field  will  be
omitted.
A request to send an UI command frame will be followed
by requests for data using pl2lapTxUIData until there is
no more data to be sent (indicated by the last flag being
set by the LAP layer).
A lap2plSNRMAccept will cause the connection address
to  be  applied  and  a  UA  connection  acknowledgment
frame to be sent with appropriate negotiation parameters.
This routine can only be called directly following a valid
received SNRM frame as information from the received
frame is used to transmit the UA reply frame.
The transmit I response routine differs from the I frame
receive  routine  in  that  the  payload  layer  will  internally
send  the  DSLAP  and  SLSAP  bytes  of  the  LMP  layer
rather than the two bytes being passed as data (refer to
the LMP section of this document). These two bytes will
be  the  first  two  data  bytes  sent  in  the  information  field
and so they must have been correctly set prior to calling
lap2plTxIRsp. Once the DLSAP and SLSAP bytes have
been  sent  further  data  will  be  requested  by  use  of  the
pl2lapTxIData call until the last flag is set indicating that
there is no more data to send. Note that the DLSAP and
SLSAP bytes are part of the LMP layer data and as such
are of no interest to the LAP or payload layers. They are
sent by the payload layer in this manner to simplify the
LMP layer.
An XID response frame can only be send directly follow-
ing a valid received XID command frame as information
from  the  received  frame  is  used  to  transmit  the  XID
response frame.
3.3.9  Implementation - LAP Layer API The   DisconnectionRequest   will   result   in   the   link
being   disconnected   following   the   IrDA   specifications.
When the SX has control of the link it will request discon-
nection from the primary station and the link will be for-
mally  disconnected  when  the  primary  station  returns  a
disconnect frame. During this time no further data frames
will be accepted and so no further data will be passed to
the  LMP  layer.  When  the  disconnect  frame  is  received
any outstanding non-validated data will be rejected and
then the DisconnectIndication will be called.
lap2plTxXIDCmd (w=slot) Send an XID command frame with the given slot number. lap2plTxUICmd () Send an UI command frame. lap2plSNRMAccept () Apply connection address and send UA connection accept frame with appropriate
negotiation parameters.
lap2plTxSimpleRsp (w=cmd) Send a frame with the given command and with no information field. lap2plTxIRsp () Send an I response frame. lap2plTxXIDRsp () Send an XID response frame pl2lapTxIData (ret w=data, z=last) Request for the next I data byte. pl2lapTxUIData (ret w=data, z=last) Request for the next UI data byte. pl2lapTxComplete () The frame has been completely sent. Figure 3-6. Payload Layer Transmit API lap2lmpConnectIndication () A LAP connection has been established. lap2lmpDisconnectIndication () The LAP connection has been terminated. lmp2lapDisconnectRequest () The LMP layer wishes to terminate the LAP connection. Figure 3-7. LAP Layer Connect API