tfUseDialer

Jump to: navigation, search

Table of Contents >> Optional Protocols >> Dialer


#include <trsocket.h>


int tfUseDialer (
ttUserInterface interfaceId,
ttUserLnkNotifyFuncPtr notifyFuncPtr
);


Function Description

Enables and initializes the dialer. This does not start the dialer, but simply initializes it - the dialing will occur when tfOpenInterface() is called. This should only be enabled on a serial interface running PPP/SLIP, and should be called before any calls to tfDialerAddSendExpect() or tfDialerAddExpectSend() are made.


The notification function is used to monitor the status of the dialer. The prototype of the notification function is:

myDialerNotify(ttUserInterface interfaceHandle, int flags);

The notification function will only be called when the dialer has finished (either successfully or unsuccessfully).


Possible 'flags' values

  • TM_DIALER_OPEN_COMPLETE
    The dialer has completed the dialing session successfully.
  • TM_DIALER_OPEN_FAILED
    The dialer encountered an error and aborted the session.


Parameters

  • interfaceId
    The interface to enable the dialer on.
  • notifyFuncPtr
    The user-supplied notification function to be called to notify the user of the dialer's status.


Returns

  • TM_ENOERROR
    Success.
  • TM_EINVAL
    Invalid 'interfaceId'.
  • TM_EALREADY
    The dialer has already been initialized.
  • TM_ENOMEM
    Insufficient memory to complete the operation.


Table of Contents >> Optional Protocols >> Dialer