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

Developer

Forums

Forums:

I download PosDetSample Sample Code form : https://developer.brewmp.com/resources/attach/samplecode.

After I start this sample code in simulater, device auto power off after seconds. Would someone tell me how to solve this problem? Thanks.

It looks everything is OK, and I don't change any defult settings. Code compile success, and other sample code work fine.

IDE:Visual Studio 2010

Environment:

      Active Toolsets 7.11.2.0.1638681

      Platforms 1.0.3.800

 

Output:

2011-5-8 22:53:08 SendDeviceEvent eventCode=257, value=57397

 

2011-5-8 22:53:08 SendDeviceEvent eventCode=258, value=57397

2011-5-8 22:53:08 Event - 0x2 Size 8 { 00 00 00 00 01 06 10 19 }

 

2011-5-8 22:53:08 Event - 0x1 Size 8 { 00 00 00 00 01 06 10 19 }

 

2011-5-8 22:53:08 debugmsgactor.c:627 - AppMgr (0x0106d4dd): WindowMgrActor Event

 

2011-5-8 22:53:08 debugmsgactor.c:627 - AppMgr (0x0106d4dd): Appframe: element state old:  Visible

2011-5-8 22:53:08 debugmsgactor.c:627 - AppMgr (0x0106d4dd): Appframe: element state new:  Obscured

 

2011-5-8 22:53:08 debugmsgactor.c:627 - AppMgr (0x0106d4dd):    AppFrame UI element:

2011-5-8 22:53:08 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       type = Softkey

2011-5-8 22:53:09 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       has focus = false

2011-5-8 22:53:09 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       closing = false

2011-5-8 22:53:09 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       state = Obscured

2011-5-8 22:53:09 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       internal winId =  5

2011-5-8 22:53:09 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       internal parentWinId =  0

2011-5-8 22:53:09 debugmsgactor.c:627 - HomeCanvas (0x01061019): WindowMgrActor Event

2011-5-8 22:53:09 debugmsgactor.c:627 - AppMgr (0x0106d4dd): AppFrame received event

2011-5-8 22:53:09 debugmsgactor.c:627 - AppMgr (0x0106d4dd): WindowMgrActor Event

2011-5-8 22:53:09 debugmsgactor.c:627 - AppMgr (0x0106d4dd): Appframe: element state old:  Visible

2011-5-8 22:53:09 debugmsgactor.c:627 - AppMgr (0x0106d4dd): Appframe: element state new:  Obscured

2011-5-8 22:53:09 debugmsgactor.c:627 - AppMgr (0x0106d4dd):    AppFrame UI element:

2011-5-8 22:53:09 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       type = Page

2011-5-8 22:53:09 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       idPage = pgAppList

2011-5-8 22:53:09 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       has focus = true

2011-5-8 22:53:09 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       closing = false

2011-5-8 22:53:09 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       state = Obscured

2011-5-8 22:53:09 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       internal winId =  6

2011-5-8 22:53:09 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       internal parentWinId =  0

2011-5-8 22:53:09 debugmsgactor.c:627 - AppMgr (0x0106d4dd): WindowMgrActor Event

2011-5-8 22:53:09 debugmsgactor.c:627 - AppMgr (0x0106d4dd): Appframe: element focus change:

2011-5-8 22:53:09 debugmsgactor.c:627 - AppMgr (0x0106d4dd):    AppFrame UI element:

2011-5-8 22:53:09 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       type = Page

2011-5-8 22:53:09 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       idPage = pgAppList

2011-5-8 22:53:09 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       has focus = false

2011-5-8 22:53:09 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       closing = false

2011-5-8 22:53:09 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       state = Obscured

2011-5-8 22:53:09 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       internal winId =  6

2011-5-8 22:53:09 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       internal parentWinId =  0

 

 

Sim powers OFF means the code must be crashing. In such a case if you put a breakpoint & start the App in debug mode, you should be able to root cause an issue. 
 
i see a small bug in the file "SP_ConfigMenu.c", line 896.
 
IFilePort1_Close() is called without checking pIConfigFile NULL.
 
plz add a check there as below & then the code should run fine:-

 
if
(pIConfigFile) {
    IFilePort1_Close( pIConfigFile );
}

Sim powers OFF means the code must be crashing. In such a case if you put a breakpoint & start the App in debug mode, you should be able to root cause an issue. 
 
i see a small bug in the file "SP_ConfigMenu.c", line 896.
 
IFilePort1_Close() is called without checking pIConfigFile NULL.
 
plz add a check there as below & then the code should run fine:-

 
if
(pIConfigFile) {
    IFilePort1_Close( pIConfigFile );
}

Thanks  shivendra.
The simulator did not auto power off again after I add a check follow your suggest. But unfortunately, the screen of simulator keep gray,  and not any more output in output window(See appendix).  So I cann't select any menu, cann't go further.
I debugged this sample code, I found it maybe a error in SP_MainMenu.c. The screen of simulator is not refrshed as expected after call SamplePosDet_DrawScreen() in function SamplePosDet_MainMenu_HandleEvent() .
My computer has installed windows server 2003 with Simplified Chinese Language.
I'm a newbie, so it's some difficulty to me.  Look forward for more help. Thanks!
Output:
2011-5-9 22:06:49 Event - 0x2 Size 8 { 00 00 00 00 01 06 10 19 }
2011-5-9 22:06:49 Event - 0x1 Size 8 { 00 00 00 00 01 06 10 19 }
2011-5-9 22:06:49 debugmsgactor.c:627 - AppMgr (0x0106d4dd): WindowMgrActor Event

2011-5-9 22:06:49 debugmsgactor.c:627 - AppMgr (0x0106d4dd): Appframe: element state old:  Visible

2011-5-9 22:06:49 debugmsgactor.c:627 - AppMgr (0x0106d4dd): Appframe: element state new:  Obscured
2011-5-9 22:06:49 debugmsgactor.c:627 - AppMgr (0x0106d4dd):    AppFrame UI element:
2011-5-9 22:06:49 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       type = Softkey
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       has focus = false
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       closing = false
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       state = Obscured
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       internal winId =  5
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       internal parentWinId =  0
2011-5-9 22:06:50 debugmsgactor.c:627 - HomeCanvas (0x01061019): WindowMgrActor Event
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd): AppFrame received event
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd): WindowMgrActor Event
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd): Appframe: element state old:  Visible
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd): Appframe: element state new:  Obscured
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):    AppFrame UI element:
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       type = Page
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       idPage = pgAppList
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       has focus = true
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       closing = false
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       state = Obscured
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       internal winId =  6
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       internal parentWinId =  0
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd): WindowMgrActor Event
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd): Appframe: element focus change:
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):    AppFrame UI element:
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       type = Page
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       idPage = pgAppList
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       has focus = false
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       closing = false
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       state = Obscured
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       internal winId =  6
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       internal parentWinId =  0
2011-5-9 22:06:50 Event - 0x0 Size 8 { 00 00 00 00 01 01 2E F1 }
 
2011-5-9 22:06:50 LuaIdleGC.c:73 - >> LuaVM is STILL busy.  Forcing a GC cycle!

2011-5-9 22:06:50 LuaIdleGC.c:88 - >> LuaVM idle GC cycle ran in 1ms

2011-5-9 22:06:52 LuaIdleGC.c:88 - >> LuaVM idle GC cycle ran in 1ms
 

Thanks  shivendra.
The simulator did not auto power off again after I add a check follow your suggest. But unfortunately, the screen of simulator keep gray,  and not any more output in output window(See appendix).  So I cann't select any menu, cann't go further.
I debugged this sample code, I found it maybe a error in SP_MainMenu.c. The screen of simulator is not refrshed as expected after call SamplePosDet_DrawScreen() in function SamplePosDet_MainMenu_HandleEvent() .
My computer has installed windows server 2003 with Simplified Chinese Language.
I'm a newbie, so it's some difficulty to me.  Look forward for more help. Thanks!
Output:
2011-5-9 22:06:49 Event - 0x2 Size 8 { 00 00 00 00 01 06 10 19 }
2011-5-9 22:06:49 Event - 0x1 Size 8 { 00 00 00 00 01 06 10 19 }
2011-5-9 22:06:49 debugmsgactor.c:627 - AppMgr (0x0106d4dd): WindowMgrActor Event

2011-5-9 22:06:49 debugmsgactor.c:627 - AppMgr (0x0106d4dd): Appframe: element state old:  Visible

2011-5-9 22:06:49 debugmsgactor.c:627 - AppMgr (0x0106d4dd): Appframe: element state new:  Obscured
2011-5-9 22:06:49 debugmsgactor.c:627 - AppMgr (0x0106d4dd):    AppFrame UI element:
2011-5-9 22:06:49 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       type = Softkey
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       has focus = false
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       closing = false
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       state = Obscured
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       internal winId =  5
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       internal parentWinId =  0
2011-5-9 22:06:50 debugmsgactor.c:627 - HomeCanvas (0x01061019): WindowMgrActor Event
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd): AppFrame received event
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd): WindowMgrActor Event
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd): Appframe: element state old:  Visible
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd): Appframe: element state new:  Obscured
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):    AppFrame UI element:
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       type = Page
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       idPage = pgAppList
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       has focus = true
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       closing = false
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       state = Obscured
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       internal winId =  6
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       internal parentWinId =  0
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd): WindowMgrActor Event
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd): Appframe: element focus change:
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):    AppFrame UI element:
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       type = Page
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       idPage = pgAppList
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       has focus = false
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       closing = false
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       state = Obscured
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       internal winId =  6
2011-5-9 22:06:50 debugmsgactor.c:627 - AppMgr (0x0106d4dd):       internal parentWinId =  0
2011-5-9 22:06:50 Event - 0x0 Size 8 { 00 00 00 00 01 01 2E F1 }
 
2011-5-9 22:06:50 LuaIdleGC.c:73 - >> LuaVM is STILL busy.  Forcing a GC cycle!

2011-5-9 22:06:50 LuaIdleGC.c:88 - >> LuaVM idle GC cycle ran in 1ms

2011-5-9 22:06:52 LuaIdleGC.c:88 - >> LuaVM idle GC cycle ran in 1ms
 

this may happen in case an empty menu is drawn, i.e. no menu items are added to IMenuCtl.
 
check if there is a c_sampleposdet.bar file in the folder where App gets installed on target.
 
it is working for me though.

this may happen in case an empty menu is drawn, i.e. no menu items are added to IMenuCtl.
 
check if there is a c_sampleposdet.bar file in the folder where App gets installed on target.
 
it is working for me though.

Thanks shivendra again.
Maybe I have solved this problem. The sample code can run in Windows XP English Version + Visual Studio 2008 English Version + MP 1.0.2.
It’s not very easy to make sample code run correctly. I found this sample code would throw error in platform 1.0.3, and the screen of simulator would keep in gray without any character displayed in Windows server 2003 Chinese edition + Visual Studio 2010 Chinese Version.
But I still have some questions:
1: I can’t find any method to specify GPS source file in simulator of MP 1.0.2, although I can do it through ‘GPS Settings’ in tools menu of simulator MP 1.0.3;
2: Is interface IPosDet are deprecated? How can I get sector information through interface pd_IPosition in MP1.0.3(I can call IPOSDETGetSectorInfo() of IPosDet in MP1.0.2)?
3: Is there sample code for new Interface of pd_IPosition?
4: It seems few handsets are shipped with Brew MP. Local telecom operators suggest me to use other handset operation systems. Could someone give me a handset list with Brew MP and GPS enabled?
5: Does Android or Windows Mobile support GPSOne? Can I call interface IPosDet and function IPOSDETGetSectorInfo() or similar functions ?
My goal is to develop a small program which will be installed in handset and record position and sector information using GPSOne and function IPOSDETGetSectorInfo()(or similar function else).
Any suggest or feedback is appreciated.

Thanks shivendra again.
Maybe I have solved this problem. The sample code can run in Windows XP English Version + Visual Studio 2008 English Version + MP 1.0.2.
It’s not very easy to make sample code run correctly. I found this sample code would throw error in platform 1.0.3, and the screen of simulator would keep in gray without any character displayed in Windows server 2003 Chinese edition + Visual Studio 2010 Chinese Version.
But I still have some questions:
1: I can’t find any method to specify GPS source file in simulator of MP 1.0.2, although I can do it through ‘GPS Settings’ in tools menu of simulator MP 1.0.3;
2: Is interface IPosDet are deprecated? How can I get sector information through interface pd_IPosition in MP1.0.3(I can call IPOSDETGetSectorInfo() of IPosDet in MP1.0.2)?
3: Is there sample code for new Interface of pd_IPosition?
4: It seems few handsets are shipped with Brew MP. Local telecom operators suggest me to use other handset operation systems. Could someone give me a handset list with Brew MP and GPS enabled?
5: Does Android or Windows Mobile support GPSOne? Can I call interface IPosDet and function IPOSDETGetSectorInfo() or similar functions ?
My goal is to develop a small program which will be installed in handset and record position and sector information using GPSOne and function IPOSDETGetSectorInfo()(or similar function else).
Any suggest or feedback is appreciated.

1.  GPS Settings on Simulator is not available via UI on Brew MP Sim 6 till now. The documentation is under "Simulator Help"
__________________________
The Simulator can be used to simulate GPS.
Brew MP currently does not support GPS Emulation Settings in UI menu. To edit GPS settings, edit the pd.dat file under the folder. The pd.dat file contains the settings information to activate and setup GPS simulation.
For instance, if the NMEA file "todowntown.bgp" is to be used as file input for GPS simulation, the file name could be mentioned in the pd.dat file, as shown below.
[GPS Emulation]
Type=1
File=.\todowntown.bgp
Delay=0
Cycle=0 Port= Similarly, if port is to be used to read data for GPS simulation, the port name could be mentioned.
[GPS Emulation]
Type=2
File=
Delay=0
Cycle=0
Port=COM1

_______________________
 
 
2. IPosdet is not depricated.
3. you may use the IPosdet interface to get the Sector information
4. There is a bit of it available in the api ref under documentation of pd_IPosition
5. You may find the list of GPS enabled devices under the DEVICES tab on this page. - On Devices Page - Under REFINE RESULTS, tik GPS under "Features" & the tik all Brew MP versions under "Brew Releases". you will get the list.
6. not very sure about Android/Win Mobile & GPS One. use google.
 

1.  GPS Settings on Simulator is not available via UI on Brew MP Sim 6 till now. The documentation is under "Simulator Help"
__________________________
The Simulator can be used to simulate GPS.
Brew MP currently does not support GPS Emulation Settings in UI menu. To edit GPS settings, edit the pd.dat file under the folder. The pd.dat file contains the settings information to activate and setup GPS simulation.
For instance, if the NMEA file "todowntown.bgp" is to be used as file input for GPS simulation, the file name could be mentioned in the pd.dat file, as shown below.
[GPS Emulation]
Type=1
File=.\todowntown.bgp
Delay=0
Cycle=0 Port= Similarly, if port is to be used to read data for GPS simulation, the port name could be mentioned.
[GPS Emulation]
Type=2
File=
Delay=0
Cycle=0
Port=COM1

_______________________
 
 
2. IPosdet is not depricated.
3. you may use the IPosdet interface to get the Sector information
4. There is a bit of it available in the api ref under documentation of pd_IPosition
5. You may find the list of GPS enabled devices under the DEVICES tab on this page. - On Devices Page - Under REFINE RESULTS, tik GPS under "Features" & the tik all Brew MP versions under "Brew Releases". you will get the list.
6. not very sure about Android/Win Mobile & GPS One. use google.
 

Thanks! I found a handset of CoolPad E600, in which I have uploaded this sample code successfully.

Thanks! I found a handset of CoolPad E600, in which I have uploaded this sample code successfully.