Commit Graph

11 Commits (1403dfc086b406650d4b3b38b38835b415cc55c9)

Author SHA1 Message Date
Kevin Bracey 284843fdb3 Restore mbed OS 5.4 mbed_lwip_ function prototypes
External EMAC drivers are currently directly attaching to lwip_stack.c
via mbed_lwip_bringup et al. Restore the original prototypes to avoid
compatibility breakage.
2017-06-02 14:30:25 +03:00
Hasnain Virk 658ddf7c30 ARMCC link errors fixed, nsapi_ppp glue layer changed
GCC have not been capable enough to catch some linker errors which arose when
ethernet support for LWIP was disabled. Checks have been added to make sure that
unrefrenced code is not linked in.

nsapi_ppp glue layer is made more transparent to public cellular API. Storage of IP
addresses is removed. PPP layer already stores the addresses, so we pass the pointer back
to the upper layers.

If PPP is not used, we provide dummy functions.
2017-05-31 15:02:11 +03:00
Hasnain Virk 01088647b9 Finalizing the public API for Cellular
* state machine corrections
* adding various standard API methods
* Addition/revision/enhancement of the nsapi_ppp glue layer
* Turning off debug by default
2017-05-31 15:02:11 +03:00
Hasnain Virk f602c936ff Redirecting LWIP debug trace to mbed-trace
This piece of code redirects LWIP debug trace to mbed-trace if configured.
This enables us to have universal traces.
2017-05-31 15:02:11 +03:00
Hasnain Virk 3b44f4758d Adding support for APN lookup
Mainly reutilizing code from ublox C027 support lib.
As we are using external PDP context, i.e., an external IP stack,
we will pass username and password to underlying stack running PPP.
We only support CHAP as the authentication protocol.
2017-05-31 15:02:11 +03:00
Hasnain Virk 93f436ebe0 Using DCD line to invoke poll() HUP
POSIX poll() provides a mechanism to attach a POLL_HUP event
if the modem or device hangs up on you. POLL_HUP and POLL_OUT are
mutually exclusive. We poll in the PPP_input() routine if the modem
hung up. If it did we stop the data consumption, close PPP and go back
to the driver for reserruction of AT parser and subsequent retries or
application specific actions.
This is achieved by attaching an interrupt to the DCD line of the modem.
When DCD line goes high (off), we have lost the carrier. So we record an
POLLHUP event using _poll_change().
2017-05-31 15:02:11 +03:00
Hasnain Virk 87a4580e5f Bug fixes & state machine corrections
In case of carrier lost, we would like to inform PPP data pump.
That involved setting up link status flag down semaphores.
mbed_lwip_bringup() and mbed_lwip_bringdown() had been Ethernet specific only.
We extend these routines to support PPP as well. Currently we support only one interface
at a time. However, future enhancement to multi interface support should be trivial.
2017-05-31 15:02:11 +03:00
Kevin Bracey 7e3c529d21 Unify LWIP Ethernet and PPP initialisation 2017-05-31 15:02:11 +03:00
Hasnain Virk 2abb078f27 Adding PPP link status callback
mbed_ppp_init() is extended to take a function ptr.
ppp_lwip will call this callback upon a change in ppp link status.
in the beginning, the Ublox driver waits until the PPP link is established properly.
2017-05-31 15:02:11 +03:00
Hasnain Virk 091396defe Adding mbed_trace to ppp_lwip
We introduce here mbed_trace to ppp_lwip shim layer.
If for some reason, FEATURE_COMMON_PAL is not included in the build,
dummies for trace functions are provided.
2017-05-31 15:02:11 +03:00
Kevin Bracey 7f136d5a35 PPP Interface for LWIP using FileHandle stream
This is a glue layer between LWIP PPP implementation and a device type FileHandle
stream. This enables an external interface which has a FileHandle, utilize LWIP network
stack via PPP, e.g., Cellular device, WiFi chips etc.
Its totally transparent to external device. Only thing this layer is interested in, is a
FileHandle. Similar is true for for the external device, it just hands over its stream to this
PPP layer and rest of the magic is done by this layer.
2017-05-31 15:02:11 +03:00