© 2000 Ubicom, Inc. All rights reserved. - 13 - www.ubicom.com SX IrDA Virtual Peripheral Implementation AN16 The LMP layer uses reliable I frames for data transmis-
sion  and  reception.  Received  data  will  confirmed  by  a
RxValid  message  once  both  the  FCS  and  the  frame
numbering have been checked. Transmitted data will be
confirmed by a TxValid message once the remote sta-
tion has correctly acknowledged the receipt of the trans-
mitted frame.
Because  the  acknowledge  of  transmitted  data  can  be
part  of  a  received  data  frame  the  LMP  layer  may  be
passed  received  data  before  the  transmitted  data  has
been confirmed. This means that the LMP layer must be
capable  of  re-transmitting  a  frame  after  more  incoming
data has been received.
For solid bi-directional data flow the events will occur in
the following order:
lap2lmp Tx  Start lap2lmp Tx  Data * n lap2lmp Rx Data * n lap2lmp Tx  Valid/Error lap2lmp Rx Valid/Error lap2lmp Tx  Start etc. The application layer can request the discovery process
be  initiated  by  calling  DiscoveryRequest.  If  there  has
been no IR detected in the past 500 ms (as required by
the IrLAP specifications) then the discovery process will
be initiated and z will be returned clear. If there has been
IR detected in the past 500 ms then the request will be
refused and z will be returned true. Any attempt to initiate
the  discovery  process  during  a  connection  or  during  a
discovery process will be rejected.
The application layer can request that a unreliable broad-
cast data (UI) frame be sent outside of a connection by
calling TxUIStart. If there has been no IR detected in the
past  500  ms  (as  required  by  the  IrLAP  specifications)
then the frame will be transmitted and z will be returned
clear. If there has been IR detected in the past 500 ms or
there   is   a   connection   open   then   the   request   will   be
refused. The data will be requested from the application
layer as it can be sent by use of the TxUIData event. The
LAP layer does not enforce the 64 byte limit on the length
of the data within a UI frame and so it is up to the applica-
tion layer to limit the data to 64 bytes if it wants to main-
tain IrDA compliance.
All broadcast UI data frames received during the discon-
nected  (NDM)  state  will  be  passed  to  the  application
layer. Figure  3-9 shows the LAP Layer Application 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. lap2lmpRxData (w=Data) I frame data has been received. lap2lmpRxValid () The I frame data received since last Valid/Error message has been validated. lap2lmpRxError () The I frame data received since last Valid/Error message is invalid. Figure 3-8.  LAP Layer LMP Receive API app2lapDiscoveryRequest (ret z=busy) Request that the discovery process be initiated. lap2appRxUIData (w=data) Incoming UI data frame. lap2appRxUIValid () Frame was validated. lap2appRxUIError () Frame was invalid. app2lapTxUIStart (ret z=busy) Request that a frame be sent. lap2appTxUIData (ret w=data, z=last) A request for UI data to be transmitted. lap2appTxUIComplete () The UI frame has been completely transmitted. Figure 3-9.  LAP Layer Application API