Function Prototypes:ttPppCallbackUserFunc
Table of Contents >> Optional Protocols >> PPP Interface >> tfPppCallbackRegister
| void ttPppCallbackUserFunct | ( |
| ttUserInterface interfaceHandle, | |
| int type, | |
| char * dataPtr, | |
| int dataLength | |
| ); |
Function Description
The application will likely need to supply a function that Treck PPP can call to request an external action or notify of an internal event. Treck PPP will need assistance from the application, for example, to dial a phone number, answer an incoming call or disconnect from the network (hang up).
Use caution when calling Treck or kernel API calls from your action/notification function, as the function is called from deep within the Treck PPP state machine for the interface. Avoid calls that could block the current thread or calls that could directly affect the interface. Processing of the action/event should be deferred until after you record the event and return from the functionâperhaps, in a worker thread.
Parameters
- interfaceHandle
- The interface that is generating the action/event.
- type
- Action/event type (described below).
- dataPtr
- Pointer to data associated with the action/event.
- dataLength
- Length of data at dataPtr.
Action/Event List
| Name | Description |
|---|---|
| TM_PPP_USER_ACTION_CONNECT | Connect to the network address provided in dataPtr (i.e. dial the phone number). The address is a formatted, binary value that takes the form described in the CBCP draft:
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- | Address Type | ASCIIZ address +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+- Address Type is a byte value. The only supported type is TM_CBCP_ATYPE_PSTN (1), which means the address that follows is a null terminated PSTN/ISDN ASCII value. Valid characters are 0-9, *, #, T, P, W, @, comma, space, dash, and parentheses. |
| TM_PPP_USER_ACTION_DISCONNECT | Disconnect from the network (i.e. hang up the phone). dataPtr and dataLength are not used. |
Table of Contents >> Optional Protocols >> PPP Interface >> tfPppCallbackRegister