BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 07-20-2005, 12:29 PM   #1 (permalink)
New Member
 
Join Date: Jul 2005
Model: 7100t
Posts: 6
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Device Code

Please Login to Remove!

Does anyone know how to obtain the device code for a Blackberry handheld? I do not mean the PIN returned by DeviceInfo.getDeviceId().

The device code I am referring to is used in the EventInjector.Event constructor (a protected constructor, not covered in the API docs).
Offline  
Old 07-20-2005, 03:57 PM   #2 (permalink)
BlackBerry Extraordinaire
 
Join Date: Dec 2004
Location: in a house...
Model: lots
Carrier: Rogers
Posts: 1,148
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Wow... I don't quite understand what "device code" is... would DeviceInfo.getDeviceName be what you want? ie. what model is the device?

I don't know what isn't documented... EventInjector is extended from Object, which is fully documented, and then the additional properties for EventInjector are documented as well...

Maybe you can explain a little more about what you want to do...

cd.
Offline  
Old 07-20-2005, 04:25 PM   #3 (permalink)
New Member
 
Join Date: Jul 2005
Model: 7100t
Posts: 6
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default More info on device code

OK, here is a brief explanation of what I am trying to do. I want to inject an event into the system with EventInjector.invokeEvent(). That call needs an object that is derived from EventInjector.Event. I do not, however, want this to be a Trackwheel or Key event.

So, I have a class that derives from EventInjector.Event. On my first compile after deriving, I got the message that I had not called the superclass constructor which looks like this: super(int, int, int, int, int, Object, Object).
After making the debugger stop at various points and passing arguments in different orders, I determined that the superclass constructor would look like this (if it were documented):

EventInjector.Event(int deviceCode, int eventId, int submessage, int data0, int data1, Object object0, Object object1);

This looked familiar to me as the last four parameters are what ApplicationManager.postGlobalEvent() uses in certain of its forms. After playing with the debugger some more, I was able to determine that the simulator seems to pass 0x23 as the device code all the time. I do not think I can count on this on a real device, however, and thus the question as to where to get the device code for the handheld.

I suspect I might be able to get ApplicationManager.postGlobalEvent() to do this for me, but I cannot seem to find the right GUID value to pass.
Offline  
Old 07-30-2005, 01:00 PM   #4 (permalink)
New Member
 
Join Date: Jul 2005
Model: 7100t
Posts: 6
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Does anybody have anything to offer on this issue? I would really appreciate the help.
Offline  
Old 08-17-2005, 02:34 PM   #5 (permalink)
New Member
 
Join Date: Jul 2005
Model: 7100t
Posts: 6
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Device Code

OK, I think I have it figured out. RIM seems to have code names for their platforms/devices. The code I found (35 in decimal, 23 in hex) corresponds to RIMPOLARBEAR2. I still do not know how this code maps to actual devices, though. Any help on this would be appreciated.
Offline  




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