BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 05-26-2005, 03:09 AM   #1 (permalink)
New Member
 
Join Date: May 2005
Model: 7780
Posts: 3
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default USB emulation

Please Login to Remove!

Is there any way to emulate a USB connection between the device simulator provided in the BlackBerry Java Development Environment (4.0) and a program running in the same PC? (or something simmilar...)

I have run the Usbdemo sample in the device simulator... but it is not enough to establish a USB "emulated" connection to other "point" (other program in the PC).

I thought the C++ "usbclient" sample would implement this other point, but I think that it is for communicate through USB to a REAL device, not the device simulator.

So, is ther anything I can "put" to communicate through emulated USB with the blacberry device simulator?

Thank you,
Javier.
Offline  
Old 05-26-2005, 04:56 AM   #2 (permalink)
Knows Where the Search Button Is
 
Join Date: Jan 2005
Location: MAH
Posts: 38
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Javier,

Nothing to worry. You can run the USBDemo application on simulator itself.
The only thing is that you must have BlackBerry Desktop Manager 4.0. You can download it from blackberry.com site.

First run the device app & then dekstop application.

Wish you best luck.

RImZim.
Offline  
Old 05-26-2005, 05:13 AM   #3 (permalink)
New Member
 
Join Date: May 2005
Model: 7780
Posts: 3
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you very much for putting me in the way

Once the device app & desktop application are started, how I configurate them and what possibilities I have to communicate them through "emulated USB"? I am not able to make them talk between them

In this way... can I communicate the usbdemo in the device with another program in the PC? must I do this "over" the desktop manager?
Offline  
Old 05-26-2005, 07:49 AM   #4 (permalink)
Knows Where the Search Button Is
 
Join Date: Jan 2005
Location: MAH
Posts: 38
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi javicc,

01. Configuration:
Edit->Preference
Select "Ports" tabsheet,
Here, set as:
Communication Port Type: Default
Serial Port: <just do try and error fot this number> (in my case it's 4.)
Check the "Serial/USB cable connected at startup".

02. You can embed the USBClient.cpp code in your own desktop application. Do the required changes & it'll work just fine.

03. The thing is that BBDevMgr.exe is the COM component which has been used while communicating through the USB port. And, it comes with the BlackBerry Desktop Manager 4.0.

RimZim.
Offline  
Old 05-30-2005, 08:35 AM   #5 (permalink)
Thumbs Must Hurt
 
Join Date: Aug 2004
Location: Metro NYC
Posts: 175
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I can confirm it works well. Just be sure to, at a minimum, have the BlackBerry Handheld Manager loaded.
__________________
-- Aric Rosenbaum
BlackBerry consulting, BlackBerry development
www.arconsultinginc.com
BlackBerry consulting and development (RIM SI Partner)
Offline  
Old 08-10-2005, 12:37 PM   #6 (permalink)
New Member
 
Join Date: Aug 2005
Location: Buford, GA
Model: 7250
Posts: 7
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

I am a newbie but very interested in getting the simulator to work in conjunction with the desktop manager, but I don't see where to set the communication and serial ports. I don't know if I am using a different verion of the software or what? I have installed the latest version of the desktop manager and JDE. Any help would be aprpeciated.

Last edited by mcompton : 08-10-2005 at 12:41 PM.
Offline  
Old 09-18-2006, 03:04 PM   #7 (permalink)
Knows Where the Search Button Is
 
Join Date: Aug 2006
Model: 8300
Carrier: Cingular
Posts: 35
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you guys for the info about getting it to run on the simulator. It worked well for me.


Incase others are having problems with running the demo on the simulator, here's what I did to get it running:

1) Install the BlackBerry Desktop Manager
2) Open up the BlackBerry JDE,

Quote:
Originally Posted by rimzim
01. Configuration:
Edit->Preference
Select "Ports" tabsheet,
Here, set as:
Communication Port Type: Default
Serial Port: <just do try and error fot this number> (in my case it's 4.)
Check the "Serial/USB cable connected at startup".
3) Run the simulator and then the usbdemo program. Select "Connect (Low Level)" or "Connect (GCF)".

You should see a display that says
"using low level usb interface
Registering channel: RIM_USBClient"

or nothing displayed if you chose "Connect (GCF)".

4) open up your "\Research In Motion\BlackBerry JDE 4.2.0\samples\usbclient\" folder and run the application there. (You may need to compile it first to obtain the exe file)

5) You should see
"Hello from PC"
and a couple of other messages




When trying to run the same setup on an actual device (8700g), I received a "IllegalChannel" exception message. To fix this, I changed the channel names from "RIM_USBClient" to simply "R". Then,

1) Make sure programs (Desktop Manager, JDE) using USB ports are closed (may not be necessary but just incase)
2) Start the USBdemo on the BlackBerry device, select "Connect (GCF)" or "Connect (Low Level)"
3) Start the USBclient

Last edited by Californium : 09-19-2006 at 04:19 PM.
Offline  
Old 12-14-2006, 08:33 AM   #8 (permalink)
New Member
 
Join Date: Dec 2006
Model: 7290
Posts: 3
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default USB Client Problem

Hi,

I exactly followed the same steps that are mentioned in this thread.

But when I try to run the VC++ USB client application, it opens the DOS windows, displays some messages (not 'Hello World').

It tries to open the channel ("R").

and displays an error message "Invalid advise flag" and aborts /closes the dos window.

I have no clue on how to solve this issue.

Are there are any issues with OS, JDE version, etc.

Please help. Thanks.

Regards,
Bala.

I am running JDE 4.2, Windows XP, Desktop Manager 4.0
Offline  
Old 12-14-2006, 04:12 PM   #9 (permalink)
Knows Where the Search Button Is
 
Join Date: Aug 2006
Model: 8300
Carrier: Cingular
Posts: 35
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Are both the VC++ USB client application and usbdemo blackberry program set to channel "R"? Also make sure that no other programs are using the USB port such as the desktop manager since that will exit the VC++ program.

I've attached a zip file with the programs that I"m using. It should work with BlackBerry OS 4.1 on the BlackBerry 8700 devices.
Attached Files
File Type: zip usbdemo.zip (70.5 KB, 35 views)
Offline  
Old 12-15-2006, 07:02 AM   #10 (permalink)
New Member
 
Join Date: Dec 2006
Model: 7290
Posts: 3
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default USB demo working

Hi Californium,

thanks a lot for the help!.

I managed to get it working.

Basically, the problem was version mismatch. I was using JDE version 4.2 and trying to interface with BB desktop manager 4.0,

Lately, I came to know that apps developed in latest versions are not backward compatible.

I installed version 4.0 and used the USB client 4.0 and it worked. Thanks again.

I have another query.

Is it possible to send data from the PC to the device programmatically?

In other words, is it possible to develop a Java client that replicates the functionality of VC++ USB client?.

I understand the VC++ client uses the BB desktop manager. Am not sure a Java client can work.

Pls let me know if you have any inputs in this regard. Thanks.

Regards,
Bala.
Offline  
Old 12-15-2006, 10:31 AM   #11 (permalink)
Knows Where the Search Button Is
 
Join Date: Aug 2006
Model: 8300
Carrier: Cingular
Posts: 35
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Glad that it worked out!

The problem with creating a custom application from scratch for sending data from the PC to the device is that the USB protocol is not known. I'm also not sure if it's possible or easy to access the desktop manager through a java client.

However, if you want to send data, it is possible to extend the VC++ program and add a loop so the program does not exit immediately but can wait for input and send the data to the device.

The Desktop Manager API may have some useful info also.

Link:
Desktop Manager API

Last edited by Californium : 12-15-2006 at 10:50 AM.
Offline  
Old 12-15-2006, 12:56 PM   #12 (permalink)
New Member
 
Join Date: Dec 2006
Model: 7290
Posts: 3
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default USB client

Looked at the Desktop API.

It looks like the easiest option would be to develop COM components in C/C++ or VB.

Java would not be a good idea.

I will explore this desktop API ...

Thanks a ton for the directions!.

Regards,
Bala.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.