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

Developer

Forums

Forums:

I've managed to simulate Jsr256 for Brew (sensor:accelerometer), and the code works fine, however on the UX700 I set the mif dependencies to include the IPORT1 (AEECLSID_SENSORPORT = 0x0104192D) and it gives a AEE_EPRIVLEVEL error (privileges are insufficient for this operation) when running, although it does work fine on LG9600. By setting the mif to system privileges it will run on the UX700, but you are not allowed to release software with system setting. Has anyone else had this problem? Also it doesn't work in the simulator, I get an error when trying to write the command with IPort1_Write (it returns 1, which is AEE_FAILED)

Neil Harding (javaground.com - J2ME to Brew, IPhone, Android, Windows Mobile)

Neil,
We are having trouble just getting the VX9600 to instantiate the device. We get '14' as the return value for our ISHELL_CreateInstance. That is 'Bad / Invalid Parameter'. Does that make any sense to you?
How did you create the instance? Do you pass an IPort1* ?
Thanks,

Neil,
We are having trouble just getting the VX9600 to instantiate the device. We get '14' as the return value for our ISHELL_CreateInstance. That is 'Bad / Invalid Parameter'. Does that make any sense to you?
How did you create the instance? Do you pass an IPort1* ?
Thanks,

We found a typo and have the VX9600 working nicely now.
As for the UX700, what makes you think this phone has an accelerometer? The device pack does not indicate its presence or use of the ISensor module.

We found a typo and have the VX9600 working nicely now.
As for the UX700, what makes you think this phone has an accelerometer? The device pack does not indicate its presence or use of the ISensor module.

can you verify this app on the device.
check the logs in BREWlogger.
thanks,
Shivendra

can you verify this app on the device.
check the logs in BREWlogger.
thanks,
Shivendra

I'm sorry to ask this but are you guys able to see installed app on vx9600?
I installed app via cable on vx9600 and rebooted but I couldn't find the app nowhere on vx9600
Thanks

I'm sorry to ask this but are you guys able to see installed app on vx9600?
I installed app via cable on vx9600 and rebooted but I couldn't find the app nowhere on vx9600
Thanks

Yes, our apps show up fine on the VX9600. YOu may need to change the MIF file to indicate 'Game' instead of other types. THis was an old trick on LG devices that still may apply. NOt sure if we did this or not when we loaded it initially, but we might have.
If I remember though, the newer LG phones, including the VX9600, worked fine on cable load.
Have you tried other phones? Do you have the mif, mod and sig all loaded properly?

Yes, our apps show up fine on the VX9600. YOu may need to change the MIF file to indicate 'Game' instead of other types. THis was an old trick on LG devices that still may apply. NOt sure if we did this or not when we loaded it initially, but we might have.
If I remember though, the newer LG phones, including the VX9600, worked fine on cable load.
Have you tried other phones? Do you have the mif, mod and sig all loaded properly?

the app that I loaded was for vx9700. I also checked mif setting and everything is just fine. No problem at all with other devices. I tried other 5 app but I can not see all them.
BTW, can you see your app on Browse&Download ?
Thanks,

the app that I loaded was for vx9700. I also checked mif setting and everything is just fine. No problem at all with other devices. I tried other 5 app but I can not see all them.
BTW, can you see your app on Browse&Download ?
Thanks,

All of our applications show up fine on the VX9600 and the VX9700.
They appear in the Browse & Download category.
Not sure what else to have you try... sorry.

All of our applications show up fine on the VX9600 and the VX9700.
They appear in the Browse & Download category.
Not sure what else to have you try... sorry.

I even installed above sample example that Shivendra posted.
It doesn't show up in Browse & Download.
I might return the device and get new one.
Thanks,

I even installed above sample example that Shivendra posted.
It doesn't show up in Browse & Download.
I might return the device and get new one.
Thanks,

Sample application loaded fine on my lg9700. not sure how to tell if it is reading the accelerometer or not.
did you load as brew 3x? or 2x? loading brew 2x wouldn't show application on the handset.

Sample application loaded fine on my lg9700. not sure how to tell if it is reading the accelerometer or not.
did you load as brew 3x? or 2x? loading brew 2x wouldn't show application on the handset.

I am facing a similar problem. I am not able to create an instance of ISensorUtil on the Samsung Reality (Returns me a ECLASSNOTSUPPORTED error). I tested the Sample Application shared by Shivendra and it seems to be working and reacting to accelerometer events.
It would be of great help if I can get the source code of the sample application (mysms app).
cheers,
Rajith

I am facing a similar problem. I am not able to create an instance of ISensorUtil on the Samsung Reality (Returns me a ECLASSNOTSUPPORTED error). I tested the Sample Application shared by Shivendra and it seems to be working and reacting to accelerometer events.
It would be of great help if I can get the source code of the sample application (mysms app).
cheers,
Rajith

//*******************************************/
//**************INCLUDE HEADERS**************/
//*******************************************/
#include "AEEPort.h"
#include "../../inc/AEEPort1Sensor.bid"
#include "../../inc/AEEIPort1.h"
#include "../../inc/AEEISignalCBFactory.h"
#include "../../inc/AEESignalCBFactory.bid"
//*******************************************/
//****************MAIN STRUCT****************/
//*******************************************/
IPort1 *pIPort1; // IPort1 object pointer.
ISignalCBFactory *writeData_SignalCBFactory;
ISignal *writeData_Signal;
ISignalCtl *writeData_SignalCtl;
ISignalCBFactory *getData_SignalCBFactory;
ISignal *getData_Signal;
ISignalCtl *getData_SignalCtl;
char sendBuf[ MAX_SIZE_BUFFER ];
char receiveBuf[ MAX_SIZE_BUFFER ];
int len;
int count;
//********************************************************************//
void GetData( mySms* pMe )
{
char * strgetdata = "get,accelx,accely,accelz,dirangle";
int ret;
ret = ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_Port1Sensor, (void **)&pMe->pIPort1 );
DBGPRINTF("***ERROR : ** %d", ret);
if(ret != SUCCESS)
{
DBGPRINTF("Port instance Instance failed");
return;
}
if ( SUCCESS != ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_Port1Sensor, (void **)&pMe->pIPort1 ) )
{
DBGPRINTF("Error creating Instance");
}
pMe->len = STRLEN(strgetdata);
STRLCPY( pMe->sendBuf, strgetdata, (pMe->len+1) );
if ( SUCCESS != ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_SignalCBFactory, (void**)&pMe->getData_SignalCBFactory ) )
{
return;
}
ISignalCBFactory_CreateSignal( pMe->getData_SignalCBFactory,
GetDataCB,
pMe,
&pMe->getData_Signal,
&pMe->getData_SignalCtl );
pMe->count = 0;
IPort1_Readable( pMe->pIPort1, pMe->getData_Signal );
WriteData( pMe );

void WriteData( void *pUserData )
{
int nRet = SUCCESS;
mySms* pMe = (mySms*)pUserData;
int numBytesWritten;
nRet = IPort1_Write( pMe->pIPort1, (byte*)pMe->sendBuf, pMe->len+1, &numBytesWritten );
if ( AEE_EWOULDBLOCK == nRet )
{
DBGPRINTF("Writable Woudblock");
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_SignalCBFactory, (void**)&pMe->writeData_SignalCBFactory );
ISignalCBFactory_CreateSignal( pMe->writeData_SignalCBFactory,
WriteData,
pMe,
&pMe->writeData_Signal,
&pMe->writeData_SignalCtl );
if(IPort1_Writeable( pMe->pIPort1, pMe->writeData_Signal ) == SUCCESS)
DBGPRINTF("Writable Success");
else
DBGPRINTF("Writable Failed");
return;
}
else if ( SUCCESS == nRet )
{
pMe->count++;
DBGPRINTF("IPort1_Write Success");
}
else if ( EFAILED == nRet )
{
DBGPRINTF("IPort1_Write failed");
}

void GetDataCB( void* pUserData )
{
mySms* pMe = (mySms*)pUserData;
int nRet = SUCCESS;
int numBytesRead;
DBGPRINTF("In GetData");
nRet = IPort1_Read( pMe->pIPort1, (byte*)pMe->receiveBuf, MAX_SIZE_BUFFER, &numBytesRead );
if ( AEE_EWOULDBLOCK == nRet && numBytesRead == 0)
{
//No Data available yet...re-schedule callback
ISignal_Set(pMe->getData_Signal);
if(IPort1_Readable( pMe->pIPort1, pMe->getData_Signal) == SUCCESS)
{
DBGPRINTF("WB Readable Success");
}
}
else if ( AEE_SUCCESS == nRet || numBytesRead > 0)
{
ISignal_Set(pMe->getData_Signal);
DBGPRINTF("IPort1_Read Success");
DBGPRINTF("R: %s", pMe->receiveBuf);
// writeToLog(pMe, pMe->receiveBuf);
/*
if(IPort1_Readable( pMe->pIPort1, pMe->getData_Signal) == SUCCESS)
{
DBGPRINTF("Readable Success");
}
if(pMe->count == 1)
{
SPRINTF(pMe->sendBuf, "get,roll,pitch,yaw");
pMe->len = STRLEN(pMe->sendBuf);
WriteData(pMe);
}
*/
}
else if ( EFAILED == nRet )
{
DBGPRINTF("IPort1_Read Failed");
}
ISignalCtl_Enable( pMe->getData_SignalCtl );

you may find quite some help here:
- Go to BREW API ref CHM file - go to search tab-> search for "accelerometer".
- come sample code also at BREW API ref CHM -> Use case Scenarios -> 'Sensor - IPort1 '
also u would need external dependency on AEEPort1Sensor.bid. see the MIF in the previous sample attached.
thanks.

//*******************************************/
//**************INCLUDE HEADERS**************/
//*******************************************/
#include "AEEPort.h"
#include "../../inc/AEEPort1Sensor.bid"
#include "../../inc/AEEIPort1.h"
#include "../../inc/AEEISignalCBFactory.h"
#include "../../inc/AEESignalCBFactory.bid"
//*******************************************/
//****************MAIN STRUCT****************/
//*******************************************/
IPort1 *pIPort1; // IPort1 object pointer.
ISignalCBFactory *writeData_SignalCBFactory;
ISignal *writeData_Signal;
ISignalCtl *writeData_SignalCtl;
ISignalCBFactory *getData_SignalCBFactory;
ISignal *getData_Signal;
ISignalCtl *getData_SignalCtl;
char sendBuf[ MAX_SIZE_BUFFER ];
char receiveBuf[ MAX_SIZE_BUFFER ];
int len;
int count;
//********************************************************************//
void GetData( mySms* pMe )
{
char * strgetdata = "get,accelx,accely,accelz,dirangle";
int ret;
ret = ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_Port1Sensor, (void **)&pMe->pIPort1 );
DBGPRINTF("***ERROR : ** %d", ret);
if(ret != SUCCESS)
{
DBGPRINTF("Port instance Instance failed");
return;
}
if ( SUCCESS != ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_Port1Sensor, (void **)&pMe->pIPort1 ) )
{
DBGPRINTF("Error creating Instance");
}
pMe->len = STRLEN(strgetdata);
STRLCPY( pMe->sendBuf, strgetdata, (pMe->len+1) );
if ( SUCCESS != ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_SignalCBFactory, (void**)&pMe->getData_SignalCBFactory ) )
{
return;
}
ISignalCBFactory_CreateSignal( pMe->getData_SignalCBFactory,
GetDataCB,
pMe,
&pMe->getData_Signal,
&pMe->getData_SignalCtl );
pMe->count = 0;
IPort1_Readable( pMe->pIPort1, pMe->getData_Signal );
WriteData( pMe );

void WriteData( void *pUserData )
{
int nRet = SUCCESS;
mySms* pMe = (mySms*)pUserData;
int numBytesWritten;
nRet = IPort1_Write( pMe->pIPort1, (byte*)pMe->sendBuf, pMe->len+1, &numBytesWritten );
if ( AEE_EWOULDBLOCK == nRet )
{
DBGPRINTF("Writable Woudblock");
ISHELL_CreateInstance( pMe->a.m_pIShell, AEECLSID_SignalCBFactory, (void**)&pMe->writeData_SignalCBFactory );
ISignalCBFactory_CreateSignal( pMe->writeData_SignalCBFactory,
WriteData,
pMe,
&pMe->writeData_Signal,
&pMe->writeData_SignalCtl );
if(IPort1_Writeable( pMe->pIPort1, pMe->writeData_Signal ) == SUCCESS)
DBGPRINTF("Writable Success");
else
DBGPRINTF("Writable Failed");
return;
}
else if ( SUCCESS == nRet )
{
pMe->count++;
DBGPRINTF("IPort1_Write Success");
}
else if ( EFAILED == nRet )
{
DBGPRINTF("IPort1_Write failed");
}

void GetDataCB( void* pUserData )
{
mySms* pMe = (mySms*)pUserData;
int nRet = SUCCESS;
int numBytesRead;
DBGPRINTF("In GetData");
nRet = IPort1_Read( pMe->pIPort1, (byte*)pMe->receiveBuf, MAX_SIZE_BUFFER, &numBytesRead );
if ( AEE_EWOULDBLOCK == nRet && numBytesRead == 0)
{
//No Data available yet...re-schedule callback
ISignal_Set(pMe->getData_Signal);
if(IPort1_Readable( pMe->pIPort1, pMe->getData_Signal) == SUCCESS)
{
DBGPRINTF("WB Readable Success");
}
}
else if ( AEE_SUCCESS == nRet || numBytesRead > 0)
{
ISignal_Set(pMe->getData_Signal);
DBGPRINTF("IPort1_Read Success");
DBGPRINTF("R: %s", pMe->receiveBuf);
// writeToLog(pMe, pMe->receiveBuf);
/*
if(IPort1_Readable( pMe->pIPort1, pMe->getData_Signal) == SUCCESS)
{
DBGPRINTF("Readable Success");
}
if(pMe->count == 1)
{
SPRINTF(pMe->sendBuf, "get,roll,pitch,yaw");
pMe->len = STRLEN(pMe->sendBuf);
WriteData(pMe);
}
*/
}
else if ( EFAILED == nRet )
{
DBGPRINTF("IPort1_Read Failed");
}
ISignalCtl_Enable( pMe->getData_SignalCtl );

you may find quite some help here:
- Go to BREW API ref CHM file - go to search tab-> search for "accelerometer".
- come sample code also at BREW API ref CHM -> Use case Scenarios -> 'Sensor - IPort1 '
also u would need external dependency on AEEPort1Sensor.bid. see the MIF in the previous sample attached.
thanks.

Thanks you Shivendra. That was very helpful.. Its working now :)

Thanks you Shivendra. That was very helpful.. Its working now :)