#ff0000 14  2006 . - #000655   J2ME  (Com),  (IrDA)  USB 
#def           ,   GPS ,   . 

  ,   USB   J2ME    CommConnection ( MIDP 2.0)  StreamConnection (MIDP 1.0).     GCF API. (    GCF         J2ME - Generic Connection Framework (GCF) API. , , HTTP ).        GCF,     : 

Connection<-InputConnection, OutputConnection<-StreamConnection<-CommConnection 

,      ,   .      

Connection .open(String url, int mode, boolean timeouts). 

           : ,    .      url : 

comm:< >[;< >=<>] 

      (#-  ,  0): 
COM# -   RS-232/USB 
IR# -  IrDA IRCOMM  
USB# - USB  

    : 	  	 	
baudrate	  	   .
bitsperchar	8	7, 8	 ,  .
stopbits	1	1, 2	 -  .
parity	none	odd, even, none 	.
blocking	on	on, off	 on,    .
autocts	on	on, off	 on,    CTS. 
autorts	on	on, off	 on,  RTS    .  off,   RTS.
            : READ, WRITE  READ_WRITE. 
  ,         . 
      : 
(CommConnection)Connector.open("comm:COM0;baudrate=19200", Connector.READ_WRITE, false); 
  ,       : 
String port; 
 String ports = System.getProperty("microedition.commports"); 
  int comma = ports.indexOf(','); 
 if (comma > 0) { 
     //     . 
     port = ports.substring(0, comma); 
 } else { 
     //   . 
     port =ports; 
 }
 ,        /: 
//Aey midp2.0 
CommConnection commConn = 
(CommConnection)Connector.open("comm:COM0;baudrate=115200", Connector.READ_WRITE, 
true); 
    InputStream iStream = commConn.openInputStream(); 
    OutputStream oStream = commConn.openOutputStream(); 
    String sMessage = "send";      //
oStream.write(sMessage.getBytes());      // 

Thread tRead = new Thread() {      //Nicaaai     
    public void run() {                //     sb
            while (true) { 
                StringBuffer sb = new StringBuffer(); 
                while(true) { 
                    int c = iStream.read(); 
                    if(c != '\r') { 
                        sb.append((char)c); 
                    } 
                    else 
                        break; 
                } 
                try { 
                    sleep(1000); 
                } 
                catch (InterruptedException e) {} 
            } 
        } 
    }; 
tRead.start();

 ,      CommConnection,      StreamConnection: 
StreamConnection commConn = (StreamConnection)Connector.open("comm:COM0";baudrate=115200"); 
         .       / . 
       ,   ,   . 
   ,     ,      Data .   (  ) ,          (  Connector.open()). 
  (, Motorola T720i)   API    .            Hayes AT Modem Commands . 
           . 
CommConnection      . 
         .          ,   java.lang.SecurityException. 
         System.getProperty.      , : System.getProperty("serialport.name") System.getProperty("serial.maxbaudrate") System.getProperty("microedition.commports")  
     Using Serial on Motorola J2ME handsets by Motocoder staff .
MID Profile Specification - WTK2.0\docs\api\midp\javax\microedition\io\CommConnection.html .
#ff0000 : aRix