The content generator must ultimately return one or more WML-encoded WAP cards. These must be returned without the WML headers since the headers will be added automatically by VTS’s built-in WAP session handler.
Every WAP content generator must be declared with two parameters: pStrm and Parms.
pStrm is used for the returning WML code. It must be a pointer to a stream containing the WML cards.
Parms is an array of any parameters that may have been passed from the preceding WML card.
The task list for the module is as follows:
• Collect the data to be displayed.
• Process that data if required (calculate totals, averages, etc.)
• Generate WML code to display the data as well as titles, text and links.
• Write that WML code to a text stream buffer
• Return a pointer to the stream buffer via the parameter, pStrm.
The code for a WAP card may look similar to the following example. Note the use of %s for string replacement. String replacement is not suitable for floating point numbers – use numeric formatting codes such as %.5f instead.
<!-- Params: "Realm/GUID", VTS name, Copyright dates, Application name -->
<card newcontext="true" ontimer="%smenu.wml" title="Welcome to %s" >
<timer value="25" />
<p align='center'><img src='/resources/Tel700.jpg' width='175' height='29' alt='Trihedral' /></p>
<p align='center'><img src='/resources/vts125.jpg' width='62' height='62' alt='VTS logo' /></p>
<p align='center'>©<small> %s<br />Trihedral Engineering Ltd</small></p>
<p align='center'><b>%s</b></p>
</card>