Pour communiquer à travers le port Infrarouge d'un PPC, il y a deux
possibilités :
-
Utilisez le port infrarouge comme un port COM ou LPT -> fonctions s* de
WinDev
-
Utiliser le port infrarouge via le protocole IrDA (Infrared Data Association)
-> fonctions SocketInfraRouge
1- Utilisation des fonctions s* sur le port InfraRouge
:
Ce mode est à utiliser pour communiquer avec des périphériques qui
ne proposent pas de communication IrDA, c'est en faite une "émulation" COM/LPT
via IrDA.
Ce mode peut-être utiliser pour envoyer des informations sans
attendre de réponse (télécommande par exemple).
Pas de difficulté majeure, mais quelques "pièges" à
éviter:
-
l'option "Recevoir tous les envois entrants" doit être décochée sur le
PDA.
-
Pour les fonctions s* utilisées après sOuvre, il faut utiliser le résultat de
sOuvre et pas le nom du port
-
Ambiguïté sur sFixeParametre pour le bit de stop.
2- Utilisation des fonctions SocketInfraRouge (IrDa)
:
Ce mode est un standard de communication InfraRouge pour faciliter
les échanges de données par infrarouge. Ce protocole effectue automatiquement
les synchronisations de vitesse, de bits de données... Ce protocole permet
également d'identifier les machines.
Pour
communiquer via IrDA, il faut en plus préciser un service (option "Service" des
sockets infra rouge de WDPPC), ce service correspond un peu au numéro de port
pour le protocole TCP. Sans le service il est donc impossible de se connecter
via IrDA. Le service utilisé implique le format de communication.
Liste des services IrDA standard :
* IAS
(Information Access Service): A mandatory protocol defined by the IrDA to be
used as a set along with IrLMP and IrLAP protocols. Each device maintains a
mini-database of the services it provides, and their attributes. A required
service attribute is the LSAP-SEL. Unlike TCP/IP where service ( well known )
port numbers are known in advance, each primary device must ask the secondary
device what its port (LSAP-SEL) is for the service it want to connect to. IAS
uses the Information Access Protocol (IAP) to resolve query's and responses
between an IAS client and server. A secondary stack will generally contain an
IAS server.
* IrLMP (Link
Management Protocol): A mandatory protocol defined by the IrDA to be
used as a set along with IrLAP and IR device PHY protocols. Provides fundamental
discovery, multiplexing, and link control operations between stations. It
supports multiplexing of multiple applications over a single IrLAP link. It also
provides protocol and service discovery via the IAS (Information Access
Service).
* IrLAP (Link
Access Protocol): A
mandatory protocol defined by the IrDA to be used as a set along with IrLMP and
IR device PHY protocols. Provides a device to device connection for the
reliable, ordered transfer of data; and device discovery
procedures.
* PHY
(Physical Signaling Layer): A mandatory protocol defined by the IrDA to be
used as a set along with IrLAP and IrLMP protocols. PHY is managed by and
contained in the physical IR device hardware. PHY does the following: Allows
Bidirectional communication for a range of at least 1 meter. Allows data
transmissions from 9600 bps to a maximum speed of up to 4Mbps. Data packets are
protected using a CRC. CRC-16 is used for speeds up to 1.152Mbps and CRC-32 at
4Mbps.
* Tiny
TP: Provides flow
control on IrLMP connections with an optional Segmentation and Reassembly
service.
* OBEX:
Provides object exchange services similar to HTTP, but is more flexible, compact
and efficient for embedded devices. It supports the basic need for devices to
send arbitrary data objects to each other in a logically straight forward
manner. OBEX consists of a model for representing objects and a protocol to
support communication between devices.
* IrTranP
: Provides image
exchange protocol used in Digital Image capturing devices, i.e. digital cameras,
etc.
* IrMC
: Specifications on
how mobile telephony and communication devices can exchange information. This
includes phonebook, calendar, and message data. Also specifies how call control
and real-time voice (RTCON) are handled.
* IrDA :IrCOMM ou IrCOMM: Provides COM (serial and parallel)
port emulation for legacy COM applications, printing, and modem
devices.
Plus
d'info...