Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Apr 2011

    Java ME USB Connection buffer

    Hi everyone,

    I'm developing an application for a nokia C1 that has s40. i'm using the CommConnection to open a connection to the USB comm = (CommConnection) Connector.open("comm:USB1) and it works alright with the input and output stream. The problem is that data sent to the port gets buffered in the cellphone, so when the device in which i connect it loses power and restarts the data sent by the USB is not the new data it needs to send, its the past that. I use flush and close for the input stream, but it doesn't seem to erase the buffer from the port. Is there a way to clean the buffer from the phone so that the new data sent is accurate??
    thanks in advance

  2. #2
    Nokia Developer Champion
    Join Date
    Feb 2009
    Noida, India

    Re: Java ME USB Connection buffer

    Create a new connection everytime and try.
    (Champion of the Month -Aug'13)
    Follow me on my blog for Innovative Mobile Apps

  3. #3
    Registered User
    Join Date
    Apr 2011

    Re: Java ME USB Connection buffer

    hi im2amit,

    Thanks for your advice, but it still saves the data in some kind of buffer. I have 2 midlets that use the USB port. When i write in one of them, turn off the power of the usb device i'm connecting it, send data and then close the midlet the data gets buffered. Open the second midlet and send data, the data received by the device is the one sent from the first midlet. I'm inferring it gets buffered in the output port of the phone. I try opening a new connection on each time but has the same effect. So i still need to find a way to clear the phone's port buffer. I haven't find a way using java me to clear that buffer.

Similar Threads

  1. Please who can give me a code for encrypting data in Java ME
    By mohamed2011 in forum Mobile Java General
    Replies: 2
    Last Post: 2011-03-09, 12:55
  2. Replies: 3
    Last Post: 2009-11-10, 08:33
  3. Replies: 3
    Last Post: 2008-08-31, 13:01
  4. Cleaning Socket Connection Buffer
    By kimi007 in forum Mobile Java Networking & Messaging & Security
    Replies: 0
    Last Post: 2006-01-16, 18:57
  5. nokia 30 connection via USB using USB - 232 converter
    By fireblade900 in forum Nokia M2M
    Replies: 1
    Last Post: 2002-11-29, 08:42

Posting Permissions

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