Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Kallin
Posts: 151
Registered: ‎03-27-2009
My Device: Not Specified

USB demo doesn't seem to work

I'm running the USB demo included in the latest JDE, and it doesn't seem to send data across the line in both the GCF and low_level modes. I'm using a blackberry bold, and am just trying to output serial data to a microcontroller. The microcontroller has no problem reading data from hyperterminal, but when i switch the cable and plug the blackberry into it,  it doesn't see any data no matter what I try on the blackberry. The code to send data seems very simple so I can't imagine what I'm doing wrong. The two approaches I've tried are:

 

private DataInputStream _dis; private OutputStream _dos; private StreamConnection _sc; // Using the connector interface. _sc = (StreamConnection)Connector.open("comm:USB;baudrate=9600"); _dos = _sc.openOutputStream();

String s = "yadda"

_dos.write(s.getBytes());
_dos.flush();

 

 

 

That doesn't work. The other approach is:

 

 

private int _channel; private USBPort _port; // Register the channel. _channel = USBPort.registerChannel(CHANNEL, 1024, 1024); synchronized(this) { try { // Wait for a channel. if ( _port == null ) { this.wait(); } } catch (InterruptedException e) { } } _port.write(s.getBytes());

 

 That also doesn't work :smileyfrustrated:

 

I really need some help on this. Any support would be greatly appreciated!

 

 

 

 

Please use plain text.
Developer
jmace
Posts: 482
Registered: ‎10-24-2008
My Device: 9300
My Carrier: AT&T

Re: USB demo doesn't seem to work

I would love to know how to get this to work. Anyone?
_________________________________________
www.jasonmace.com/blackberry
Please use plain text.
Administrator
MSohm
Posts: 14,362
Registered: ‎07-09-2008
My Device: BlackBerry Z30, BlackBerry PlayBook
My Carrier: Bell

Re: USB demo doesn't seem to work

There are 2 parts to the USBDemo included with the BlackBerry JDE.  There is a BlackBerry handheld side Java application and a PC side C++ application.  The PC side application relies on the BlackBerry USB driver that is installed with BlackBerry Desktop Manager. 
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
Please use plain text.
New Contributor
tapansarkar
Posts: 3
Registered: ‎11-12-2008
My Device: Not Specified

Re: USB demo doesn't seem to work

Can you please tell me the name of the PC side prog? Is it BBDevMgr.exe. But it seems to be doing nothing when I double-clicking to run it. Please help. I was trying to send SMS using the Blackberry from a PC application. So I  understand there will be two parts

 

1. SMS part from blackberry - This is working in BB - No problem. I have used the smsdemo

2. Sending data from PC to BB. For this I was trying usbdemo in samples

 

Is my appproach correct? Howevr, I cannot get the usbdemo to work.

 

Please help

 

Thanks

 

Please use plain text.