BREW Debug Key Sequence [brewforums]
The BREW debug key sequence for enabling the BREW Debug which can be used to debug the memory, network state etc. The initial ### sequence before the debug type is OEM-configurable. For example, LGE has opted to use ********** (10 * keys) rather than ###. Most OEMs use the default sequence.
Information on Debug Sequences:
Please note that all the Debug key sequences noted below are the default key sequences. These key sequences may be modified by the OEM.
###0: Turn Debugging off
This debug key sequence resets/toggles off all debug states.
###1: Memory Validation
On every heap access, BREW walks the heap to determine if the pointer is in valid range and will not over-write/over-read a heap node. An exception will be thrown if the heap access will cause corruption of a heap node.
###2: Net Debug Tool
The Net Debug Tool can be used to view the device’s network (socket and PPP) states while your application is running. When the Net Debug Tool is turned on, a box will appear in the right hand corner and will display a series of codes that can be used to determine the state of your application’s data call. The codes vary per BREW version and are shown below.
Network State Codes:
BREW 1.0:
‘c’ Socket Connecting
‘C’ Socket Connected
‘x’ Socket Closing
‘ ‘ Socket Closed
‘I’ Socket Idle
‘R’ Socket Read
‘W’ Socket Write
‘d’ PPP Opening
‘D’ PPP Open
‘-’ PPP Closing
‘O’ PPP Closed
BREW 1.1:
‘c’ Socket Connecting
‘C’ Socket Connected
‘x’ Socket Closing
‘X’ Socket Closed
‘I’ Socket Idle
‘R’ Socket Read
‘W’ Socket Write
‘r’ Socket RecvFrom
‘w’ Socket SendTo
‘d’ PPP Opening
‘D’ PPP Open
‘z’ PPP Closing
‘Z’ PPP Closed
BREW 2.0:
‘c’ Socket Connecting
‘C’ Socket Connected
‘x’ Socket Closing
‘X’ Socket Closed
‘I’ Socket Idle
‘b’ Socket Bind
‘B’ Socket Bound
‘R’ Socket Read
‘W’ Socket Write
‘r’ Socket RecvFrom
‘w’ Socket SendTo
‘^’ PPP Opening
‘=’ PPP Open
‘v’ PPP Closing
‘#’ PPP Closed
‘<’ PPP Sleeping
‘~’ PPP Asleep
‘>’ PPP Waking
###3: Largest Available Heap Block
Displays the maximum size block that can be allocated on the heap in the upper left corner of the screen.
###4: Debug Privileges
This debug sequence is not yet implemented.
###5: Debug Malloc – throws exception on MALLOC failure
Throws an exception on malloc failure.
###6: Debug Null – Every Nth MALLOC is failed
When this debug sequence is turned on, every Nth MALLOC will fail, even if RAM is available. Currently, N is set to 100.
###7: Sync/Async DBGPRINTF
This debug sequence toggles between two modes: synchronous DBGPRINTF and asynchronous DBFPRINTF. In synchronous DBGPRINTF mode, BREW waits for certain duration before returning from a DBGPRINTF statement in order to allow time for the DBGPRINTF message to be sent on the serial port. In the default, asynchronous mode, the DBGPRINTF returns immediately.
###8: Debug Dump Modules
This debug sequence is not yet implemented.
###9: Debug Dump Heap
Every time this sequence is pressed, heap and resource usage information is dumped on the emulator debug window or onto the Serial port.
The heap info consists of the number of bytes, the system that allocates it, an internally used index, the file name and line number, and whether the memory is locked (L) or unlocked(U).
Additional information is displayed on Allocated and Free RAM, and resource usage.
what are the main reasons for failing to write in socket.