Bluetooth QuickStart Kit Version 1.0 - User’s Guide Page 58
Copyright 2004-2005 © Embedded Artists AB
B.5 PPP API
B.5.1 Link Layer (with script engine)
The link layer is used between PPP and the harware device driver (e.g. a UART). This layer
includes a script engine that can be used to control the link. Command strings (init, start and
close) are assigned to the link. These strings are then parsed and executated at different times
in the PPP state machine.
A command in a command string always begins with the character '@' followed by a
command character. The following commands can be used in a command string:
• @r TIME STRING@ - wait maximum TIME milliseconds for the string STRING. If
TIME is omitted or set to 0 this is the same as wait forever. This command ends with
the character '@'.
• @w TIME - wait TIME milliseconds
• @@ - send the character '@'
To send control characters in a string the character '^' is used before the character
representing the control character. ^A is the same as 0x01, ^B is the same as 0x02 and so on.
A CR is ^M and a LF is ^J.
Examples:
1. @rCLIENT@CLIENTSERVER
2. @w1000CLIENTw300CLIENT@r1000CLIENTSERVER
3. @w5000atdt020123456^M^J@rCONNECT@
1) Wait forever for the string CLIENT and when it is received send CLIENTSERVER
2) Wait 1 second (1000 ms) and then send the string CLIENT. Wait another 300 ms and then
send CLIENT again. Wait maximum 1 second to receive the string CLIENSERVER. If the
the string CLIENTSERVER is not received within 1 second the command string will be re-
executed.
3) Wait 5 seconds and then send atdt020123456CRLF and then wait forever for the string
CONNECT.
B.5.2 linkSetInit
void linkSetInit( tPppDev* pDev, tU8* pInitStr )
Assign the init command string to the device. This command string is executed only
when the 'linkInit' function is called. The linkInit function is never called directly by
PPP, it must be called from the application code if the init command string must be
executed.
Parameters:
[in] pDev - device structure
[in] pInitStr - init command string
B.5.3 linkSetStart