11-20-2008 02:58 PM
I tried searching for a similar post but came up empty. Here is the scenario. There is an app on the Device and an app on the Desktop. They communicate through USB which works fine for the most part. I am using:
to register the channel from the Device so the Desktop can connect. Once the two are connected, I can read and write from the streams. The problem is in the time between opening the connection and the connection actually being established. The Device app may not be up to be listening for connections so it might be a while before the connection is made. I can't seem to be able to get notified of the connection being established.
Is there a listener that I can use, or call Connector.open in a way that would notify the device code that the connection has been established?
Thank you in advance,
Solved! Go to Solution.
03-16-2009 12:10 PM
I have been searching for days, and I can't establish any connection, could you help me with some advises?
Sorry if I can't be helpful, maybe when I arrived where you are I would....
03-16-2009 01:19 PM
The only advice I would give is make sure that the BlackBerry has opened a Channel to the desktop first. This should be a Connector created with a specific channel name. Once this is created, then the desktop can open a Channel to the device with the same name. The device has to register the Channel first before the desktop can open it.
Hope that helps,
03-20-2009 02:19 PM
04-08-2009 02:41 PM
Since you have worked on it, I can certainly use your expertise. Kindly suggest.
My code has following in sequence,
in try catch block, I register a channel. I guess I am assigning a name to the channel here.
xyz is the name of the channel.
regCh = USBPort("xyz", 100, 100); // This gives me 4
/*Checking connection status, I don't know if this is required to do. */
status = USBPort.getConnectionState(); // This gives me 3 sometimes 12
/*I thought this should connect*/
String url = "comm:USB;baudrate=9600;bitsperchar=8;parity=none;
StreamConnection _conn = null;
_conn = (StreamConnection)Connector.open(url); //In try block, this throws an exception.
You have said about "opened a Channel ", I tried _port = new USBPort(n);// n is a number. 8 throws channel state error, 12 throws illegal channel. I guess I am stuck here.
I hope you find the time to help me out here.
04-08-2009 10:47 PM
All you should need is:
You don't need:
regCh = USBPort("xyz", 100, 100);
Since that is what the underlying code in the Connector class is doing.
07-29-2010 05:22 PM
Please, does anybody knows how can i send sms, from an application in pc, through a blackberry using usb data cable.??
please i need some kind of help or sample code..