Vodafone K3770/K3772-Z modems driver & networking library
Dependencies: Socket USBHostWANDongle lwip-sys lwip
Dependents: VodafoneUSBModemHTTPClientTest VodafoneUSBModemNTPClientTest VodafoneUSBModemSMSTest VodafoneUSBModemUSSDTest ... more
Fork of VodafoneUSBModem_bleedingedge by
This is the driver for the Vodafone K3700 & K3772-Z Dongles:
More details and instructions can be found here.
ip/PPPIPInterface.h@32:157dd8ce4e55, 2012-09-13 (annotated)
- Committer:
- donatien
- Date:
- Thu Sep 13 13:52:42 2012 +0000
- Revision:
- 32:157dd8ce4e55
- Parent:
- 22:06fb2a93a1f6
- Child:
- 79:a6ac8206a58d
Updated HTTPClient lib
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
donatien | 8:04b6a042595f | 1 | /* PPPIPInterface.h */ |
donatien | 22:06fb2a93a1f6 | 2 | /* Copyright (C) 2012 mbed.org, MIT License |
donatien | 22:06fb2a93a1f6 | 3 | * |
donatien | 22:06fb2a93a1f6 | 4 | * Permission is hereby granted, free of charge, to any person obtaining a copy of this software |
donatien | 22:06fb2a93a1f6 | 5 | * and associated documentation files (the "Software"), to deal in the Software without restriction, |
donatien | 22:06fb2a93a1f6 | 6 | * including without limitation the rights to use, copy, modify, merge, publish, distribute, |
donatien | 22:06fb2a93a1f6 | 7 | * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is |
donatien | 22:06fb2a93a1f6 | 8 | * furnished to do so, subject to the following conditions: |
donatien | 22:06fb2a93a1f6 | 9 | * |
donatien | 22:06fb2a93a1f6 | 10 | * The above copyright notice and this permission notice shall be included in all copies or |
donatien | 22:06fb2a93a1f6 | 11 | * substantial portions of the Software. |
donatien | 22:06fb2a93a1f6 | 12 | * |
donatien | 22:06fb2a93a1f6 | 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING |
donatien | 22:06fb2a93a1f6 | 14 | * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
donatien | 22:06fb2a93a1f6 | 15 | * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, |
donatien | 22:06fb2a93a1f6 | 16 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
donatien | 22:06fb2a93a1f6 | 17 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
donatien | 22:06fb2a93a1f6 | 18 | */ |
donatien | 8:04b6a042595f | 19 | |
donatien | 8:04b6a042595f | 20 | #ifndef PPPIPINTERFACE_H_ |
donatien | 8:04b6a042595f | 21 | #define PPPIPINTERFACE_H_ |
donatien | 8:04b6a042595f | 22 | |
donatien | 8:04b6a042595f | 23 | #include "core/fwk.h" |
donatien | 8:04b6a042595f | 24 | |
donatien | 8:04b6a042595f | 25 | #include "LwIPInterface.h" |
donatien | 8:04b6a042595f | 26 | |
donatien | 8:04b6a042595f | 27 | #include "lwip/sio.h" |
donatien | 8:04b6a042595f | 28 | |
donatien | 8:04b6a042595f | 29 | namespace rtos { |
donatien | 8:04b6a042595f | 30 | class Semaphore; |
donatien | 8:04b6a042595f | 31 | } |
donatien | 8:04b6a042595f | 32 | using namespace rtos; |
donatien | 8:04b6a042595f | 33 | |
donatien | 8:04b6a042595f | 34 | /** Interface using PPP to connect to an IP-based network |
donatien | 8:04b6a042595f | 35 | * |
donatien | 8:04b6a042595f | 36 | */ |
donatien | 8:04b6a042595f | 37 | class PPPIPInterface : public LwIPInterface |
donatien | 8:04b6a042595f | 38 | { |
donatien | 8:04b6a042595f | 39 | public: |
donatien | 8:04b6a042595f | 40 | PPPIPInterface(IOStream* pStream); |
donatien | 8:04b6a042595f | 41 | virtual ~PPPIPInterface(); |
donatien | 8:04b6a042595f | 42 | |
donatien | 8:04b6a042595f | 43 | int init(); //Init PPP-specific stuff, create the right bindings, etc |
donatien | 8:04b6a042595f | 44 | int setup(const char* user, const char* pw); //Setup authentication |
donatien | 12:66dc2c8eba2d | 45 | virtual int connect(); |
donatien | 8:04b6a042595f | 46 | virtual int disconnect(); |
donatien | 8:04b6a042595f | 47 | |
donatien | 8:04b6a042595f | 48 | private: |
donatien | 18:1789a11d1892 | 49 | int cleanupLink(); |
donatien | 18:1789a11d1892 | 50 | |
donatien | 8:04b6a042595f | 51 | static void linkStatusCb(void *ctx, int errCode, void *arg); //PPP link status |
donatien | 8:04b6a042595f | 52 | Semaphore m_linkStatusSphre; |
donatien | 8:04b6a042595f | 53 | int m_pppErrCode; |
donatien | 8:04b6a042595f | 54 | |
donatien | 8:04b6a042595f | 55 | IOStream* m_pStream; //Serial stream |
donatien | 8:04b6a042595f | 56 | bool m_streamAvail; |
donatien | 8:04b6a042595f | 57 | |
donatien | 8:04b6a042595f | 58 | int m_pppd; |
donatien | 8:04b6a042595f | 59 | |
donatien | 8:04b6a042595f | 60 | friend u32_t sio_write(sio_fd_t fd, u8_t *data, u32_t len); |
donatien | 8:04b6a042595f | 61 | friend u32_t sio_read(sio_fd_t fd, u8_t *data, u32_t len); |
donatien | 8:04b6a042595f | 62 | friend void sio_read_abort(sio_fd_t fd); |
donatien | 8:04b6a042595f | 63 | }; |
donatien | 8:04b6a042595f | 64 | |
donatien | 8:04b6a042595f | 65 | #endif /* PPPIPINTERFACE_H_ */ |