Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Having trouble sending BREW event commands to an application using Perl scripts via the Grinder/Shaker.

Currently am running my test scripts on an Audiovox 8900.
I've no trouble conencting to the handset via usb cable, nor initializing the grinder and shaker, nor with using the shaker to load the AUT.

However I cannot correctly send BREW events. Very possible my syntax is incorrect. The Shaker shows that the commands are being sent, however there is no response from the handset (the sent commands do not even register at a level to bring the handset out of hybernate mode). An example of how to send an AVK_SELECT keypress and release successfully would be much appreciated. Hopefully I will be able to take it from there. Here's a sample of my small test script:

-------------------------------------------------------------------------------------------------------
use GrinderPl;
use enum qw( AVK_ASTERISK=1000 AVK_NUMBER_SIGN AVK_SELECT AVK_UP AVK_DOWN AVK_LEFT AVK_RIGHT AVK_SEND AVK_CLR AVK_END);

#Initialize the perl module. This should be the first function to be called.
GrinderPl::InitPerlModule();

#Load the default settings.
GrinderPl::LoadSettings(0);

#load handset configuration
$keymapfile = "C:\\Scripts\\CuritelCDM8900Key.ini";
GrinderPl::LoadDeviceConfigFile($keymapfile);

# Prompt user for com port # of handset
print "Handset Comm Port #: ";
chop ($usercom=);

# Initializing handset on user defined com port #
if(GrinderPl::InitDevice("COM$usercom")) {

# Start configuring shaker
if (GrinderPl::StartShaker()) {

# Start BREW applet
GrinderPl::StartApplet(0x01016ECA);

# wait for user input simply to have user controlled pause in script as
# AUT loads
chop ($input=);

# sending test commands to AUT main menu

# Key Press Select
GrinderPl::SendBrewEvent(0x101, AVK_SELECT, 0);

# Key Release Select
GrinderPl::SendBrewEvent(0x102, AVK_SELECT, 0);

#End Shaker configuration
GrinderPl::ReleaseShaker();

#Stop Shaker
GrinderPl::CloseShaker();
}

GrinderPl::StopGrinder();
GrinderPl::ReleasePerlModule();
--------------------------------------------------------------------------------------------------------

Any assistance would be greatly appreciated, thanks.

- Fex

around 5/18/2004 i got this answer from brew support for properly sendind
AVK_SELECT to CDM8900 :
The CDM8900 requires a special Grinder keymap file (attached) to properly receive the AVK_SELECT event on the phone. These are typically posted to the Device Details page when the datasheet is uploaded; for some reason this handset was overlooked. I have put in a request to have it added.
check the web site , for any update or ask brew support to send it to you ,
stefano

around 5/18/2004 i got this answer from brew support for properly sendind
AVK_SELECT to CDM8900 :
The CDM8900 requires a special Grinder keymap file (attached) to properly receive the AVK_SELECT event on the phone. These are typically posted to the Device Details page when the datasheet is uploaded; for some reason this handset was overlooked. I have put in a request to have it added.
check the web site , for any update or ask brew support to send it to you ,
stefano

Hrm. I don't see an attachment. Also in the above script a keymap file for the 8900 which I downloaded from Qualcomm's site is loaded, as follows:
#load handset configuration
$keymapfile = "C:\\Scripts\\CuritelCDM8900Key.ini";
GrinderPl::LoadDeviceConfigFile($keymapfile);
Unless for some reason the keymap file is defective, I'm wondering if there are other problems in the aforementioned code of my original post. I'm new to Perl and not a BREW developer- thus new to BREW as well (though with some C experience). Writing scripts for use as a QE. My main thought on the matter is that I'm passing incorrect values or using a flawed syntax in the Grinder APIs. If I've used the correct syntax, that would be useful to know as well- anything to help hunt down why this script is failing and fixing my methods. What would be great is sample lines of script sending any ol' keypress to a handset, then I'll figure out the rest from there hopefully.

Hrm. I don't see an attachment. Also in the above script a keymap file for the 8900 which I downloaded from Qualcomm's site is loaded, as follows:
#load handset configuration
$keymapfile = "C:\\Scripts\\CuritelCDM8900Key.ini";
GrinderPl::LoadDeviceConfigFile($keymapfile);
Unless for some reason the keymap file is defective, I'm wondering if there are other problems in the aforementioned code of my original post. I'm new to Perl and not a BREW developer- thus new to BREW as well (though with some C experience). Writing scripts for use as a QE. My main thought on the matter is that I'm passing incorrect values or using a flawed syntax in the Grinder APIs. If I've used the correct syntax, that would be useful to know as well- anything to help hunt down why this script is failing and fixing my methods. What would be great is sample lines of script sending any ol' keypress to a handset, then I'll figure out the rest from there hopefully.

Checked the device section of Qualcomm's site again just now and yep is same keymap file I downloaded previously, verified their contents match as well. Wouldn't seem that is the problemn but thanks for the reply.

Checked the device section of Qualcomm's site again just now and yep is same keymap file I downloaded previously, verified their contents match as well. Wouldn't seem that is the problemn but thanks for the reply.

i checked qualcomm site , the file is the same they send to me by email ,
so no problem there ,
btw why don't you use GrinderPl::SendKey()
instead of GrinderPl::SendBrewEvent() ?
stefano

i checked qualcomm site , the file is the same they send to me by email ,
so no problem there ,
btw why don't you use GrinderPl::SendKey()
instead of GrinderPl::SendBrewEvent() ?
stefano

I use SendBrewEvent because SendKey works fine for sending commands to a handset's OEM, however key presses during a BREW application's runtime need to be sent as specific BREW events, thus I use SendBrewEvent. Tried SendKey first off figuring it may work anyway, it does not. Which also leads into why I load the Shaker application, SendBrewEvents cannot be sent unless the Shaker is running. Somewhat annoying since means have to have the Shaker loaded onto and running on any handset I wish to do this for, even more annoying I can't seem to get SendEvent to work properly ;)

I use SendBrewEvent because SendKey works fine for sending commands to a handset's OEM, however key presses during a BREW application's runtime need to be sent as specific BREW events, thus I use SendBrewEvent. Tried SendKey first off figuring it may work anyway, it does not. Which also leads into why I load the Shaker application, SendBrewEvents cannot be sent unless the Shaker is running. Somewhat annoying since means have to have the Shaker loaded onto and running on any handset I wish to do this for, even more annoying I can't seem to get SendEvent to work properly ;)

Sorry, you CAN use GrinderPl::SendKey, however a problem with this is for use during BREW applications, the SendKey is too quick. Also the GrinderPl::PressKey seems to have issues as well. BREW apps from my understanding have a variety of ways of detecting key presses and length of time a key is pressed. On testing GrinderPl::PressKey on a variety of BREW apps, they don't recognize that a key is being pressed even if i specify with PressKey to have a key press of 10000 milliseconds (10 seconds)!?!? Actually these same apps respond if a key press is specified as being real short (ie: 5 - 20 milliseconds) and mass sending the key press to the handset- this is not in anyway close to simply holding a key on the handset itself.
IE: I load up a BREW game, I use sent events from the grinder to move my game character to the left, with a PressKey(AVK_LEFT, 10000) the game responds not at all, with PressKey(AVK_LEFT, 10) sent 50 times in quick succession the game character moves SLOWLY and choppily leftward, with SendKey there's no response at all no matter how quickly/often the command is sent, and pressing keys on the handset itself everything runs smoooooooothly.
I do not know the methodology the Grinder is using for generating key presses. Therefore I'd prefer to send brew events of a key press, delay, and key release. Actually overall I'd prefer sending BREW events for most everything, since i do not know how the Grinder generates the events it sends to a handset and I would like to have more control/options in how to get tasks done.
So which leads again into asking: anyone know the proper syntax for SendBrewEvent() ?

Sorry, you CAN use GrinderPl::SendKey, however a problem with this is for use during BREW applications, the SendKey is too quick. Also the GrinderPl::PressKey seems to have issues as well. BREW apps from my understanding have a variety of ways of detecting key presses and length of time a key is pressed. On testing GrinderPl::PressKey on a variety of BREW apps, they don't recognize that a key is being pressed even if i specify with PressKey to have a key press of 10000 milliseconds (10 seconds)!?!? Actually these same apps respond if a key press is specified as being real short (ie: 5 - 20 milliseconds) and mass sending the key press to the handset- this is not in anyway close to simply holding a key on the handset itself.
IE: I load up a BREW game, I use sent events from the grinder to move my game character to the left, with a PressKey(AVK_LEFT, 10000) the game responds not at all, with PressKey(AVK_LEFT, 10) sent 50 times in quick succession the game character moves SLOWLY and choppily leftward, with SendKey there's no response at all no matter how quickly/often the command is sent, and pressing keys on the handset itself everything runs smoooooooothly.
I do not know the methodology the Grinder is using for generating key presses. Therefore I'd prefer to send brew events of a key press, delay, and key release. Actually overall I'd prefer sending BREW events for most everything, since i do not know how the Grinder generates the events it sends to a handset and I would like to have more control/options in how to get tasks done.
So which leads again into asking: anyone know the proper syntax for SendBrewEvent() ?

Hrm, guess cannot perform keypresses with SendBrewEvent(), so the original question for this thread is pointless, NM ;)

Hrm, guess cannot perform keypresses with SendBrewEvent(), so the original question for this thread is pointless, NM ;)