J2me and Irda Sockets ?

  • Thread starter philippe.barthelemy
  • Start date
P

philippe.barthelemy

Hi,

My apps ( http://heartbit.sourceforge.net ) is targeted at small
devices ( palm, pocketPC and smartphone ).
Its needs access to socket-based IRda communication.

I know SuperWaba, altough it does not support natively irda-socket,
allows to write JNI-style native libs. which is fine for me.

Which other JVM will allow to irda sockets ( natively or through JNI )
?
will J2ME include this ?
I googled for the answer, without success...

TIA,
--Philippe
 
J

JScoobyCed

Hi,

My apps ( http://heartbit.sourceforge.net ) is targeted at small
devices ( palm, pocketPC and smartphone ).
Its needs access to socket-based IRda communication.

I know SuperWaba, altough it does not support natively irda-socket,
allows to write JNI-style native libs. which is fine for me.

Which other JVM will allow to irda sockets ( natively or through JNI )
?
will J2ME include this ?
I googled for the answer, without success...

TIA,
--Philippe

Hi,

As long as your device supports MIDP2.x, I would say yes, you can
access the IrDa through a Serial Emulation.
In the Connection URL, use "comm:ir0"

<javadoc-of-CommConnection>

Recommended Port Naming Convention

Logical port names can be defined to match platform naming conventions
using any combination of alphanumeric characters. However, it is
recommended that ports be named consistently among the implementations
of this class according to a proposed convention. VM implementations
should follow the following convention:
Port names contain a text abbreviation indicating port capabilities
followed by a sequential number for the port. The following device name
types should be used:

* COM#, where COM is for RS-232 ports and # is a number assigned to
the port
* IR#, where IR is for IrDA IRCOMM ports and # is a number assigned
to the port

This naming scheme allows API users to generally determine the type of
port that they would like to use. For instance, if a application desires
to "beam" a piece of data, the app could look for "IR#" ports for
opening the connection. The alternative is a trial and error approach
with all available ports.

Since:
MIDP 2.0
</javadoc-of-CommConnection>

<another-one>
The following example shows how a CommConnection would be used to
discover available comm ports.

String port1;
String ports = System.getProperty("microedition.commports");
int comma = ports.indexOf(',');
if (comma > 0) {
// Parse the first port from the available ports list.
port1 = ports.substring(0, comma);
} else {
// Only one serial port available.
port1 =ports;
}

</another-one>
 
D

Darryl Pierce

Which other JVM will allow to irda sockets ( natively or through JNI )
?
will J2ME include this ?
I googled for the answer, without success...

Only if the OEM has provided a type of javax.microedition.io.Connection
that uses the irDA port on the handset. For example, Nokia phones have
the irDA but don't all give access to it from Java. You would need to
check with the manufacturer for the phone(s) you're targeting.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top