×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Dec 2009
    Posts
    77

    Infrared connection

    Using IR Port i have to print the data through printer from nokia devices.

    I used commconnection and used IR0 as port but i am unable to print the data

    public void commConnection()
    {
    //using commconnection since midp2.0

    try{
    CommConnection commConn = (CommConnection)Connector.open("comm:IR0;baudrate=115200", Connector.READ_WRITE,
    true);
    InputStream iStream = commConn.openInputStream();
    OutputStream oStream = commConn.openOutputStream();
    String sMessage = "Hello I m mobile";
    oStream.write(sMessage.getBytes());
    // oStream.write(sMessage.getBytes());
    // Thread tRead = new Thread() {
    // public void run()
    // {
    while (true)
    {
    StringBuffer sb = new StringBuffer();
    while(true)
    {
    int c = iStream.read();
    if(c != '\r')
    {
    sb.append((char)c);
    }
    else
    break;
    }
    }
    }catch(Exception e){e.printStackTrace();}
    // try {
    // sleep(1000);
    // }
    // catch (InterruptedException e) {}
    // }
    // }
    // };
    // tRead.start();
    }
    }

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2003
    Posts
    4,104

    Re: Infrared connection

    Which protocol does your printer use? It is very uncommon for a printer to use IrCOMM.

Similar Threads

  1. Infrared Connection
    By WillyAvM in forum General Development Questions
    Replies: 2
    Last Post: 2004-03-02, 17:41
  2. infrared connection problem
    By lineagotica73 in forum General Development Questions
    Replies: 0
    Last Post: 2003-10-21, 14:52
  3. Infrared Connection
    By ehodson in forum General Development Questions
    Replies: 0
    Last Post: 2003-07-29, 09:11
  4. infrared connection
    By dbw826 in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2003-05-09, 22:35
  5. infrared connection
    By rashid1964 in forum General Messaging
    Replies: 0
    Last Post: 2002-09-16, 00:33

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •