2 * Copyright 2003-2006, Waldemar Kornewald <wkornew@gmx.net>
3 * Distributed under the terms of the MIT License.
6 #ifndef MODEM_DEVICE__H
7 #define MODEM_DEVICE__H
11 #include <KPPPDevice.h>
16 // the same as IsDown() == true
20 // the same as IsUp() == true
26 class ModemDevice
: public KPPPDevice
{
28 ModemDevice(KPPPInterface
& interface
, driver_parameter
*settings
);
29 virtual ~ModemDevice();
31 const char *PortName() const
35 // returns file handle for modem driver
37 const char *InitString() const
38 { return fInitString
; }
39 const char *DialString() const
40 { return fDialString
; }
42 virtual status_t
InitCheck() const;
47 void SetSpeed(uint32 bps
);
48 virtual uint32
InputTransferRate() const;
49 virtual uint32
OutputTransferRate() const;
50 // this is around 60% of the input transfer rate
52 virtual uint32
CountOutputBytes() const;
58 void FinishedDialing();
60 void ConnectionLost();
62 virtual status_t
Send(struct mbuf
*packet
, uint16 protocolNumber
= 0);
63 status_t
DataReceived(uint8
*buffer
, uint32 length
);
64 // this will put the data into an mbuf and call Receive()
65 virtual status_t
Receive(struct mbuf
*packet
, uint16 protocolNumber
= 0);
68 const char *fPortName
, *fInitString
, *fDialString
;
70 // file handle for modem driver
72 thread_id fWorkerThread
;
74 uint32 fInputTransferRate
, fOutputTransferRate
;