Part Number: MSP432E401Y
I have a project using the Ethernet interface on the MSP432E401Y. Now I am trying to add support for a PPP connection over a modem. I have done a lot of reading online and have most of it working.
I have ported the code from the TM4C129 example. I wrote routines to handle initializing the modem and establishing the connection. Then I pass the handle into the task that receives data and pushes packets into the stack. This starts the PPP negotiation, which is successful, and an IP address is assigned. Then the netIPAddrHook function is called with the IP address of the connection, just like the Ethernet interface. In the hook function, I initialize SlNet, and add the PPP interface using:
status = SlNetIf_add(SLNETIF_ID_3, "ppp0",(const SlNetIf_Config_t *)&SlNetIfConfigNDKSec,8);
At this point I see the stack periodically sending a small packet, the serial receive task receives and validates a valid packet and pushes it into the stack. I think this is an LCP status message that runs about once a second.
When I try to open a socket the stack uses the Ethernet interface because it is a higher priority. When I unplug the Ethernet cable, the sockets fail, the stack doesn't switch to the modem connection. I have also tried disabling the Ethernet interface using SlNetIf_setState, and swapped the priorities of the two interfaces. None of these changes causes any additional activity on the modem connection, I still see the LCP status messages moving periodically.
I found some information about sending a LINKUP message using STKEVENT_signal and implemented that in the receive task. It signals LINKUP after it sees a bunch of valid packets have been decoded.
I have noticed that a call to SlNetIf_getConnectionStatus never returns a connected status for the modem connection. I followed this into the code and found that the PPP driver doesn't implement an IOCTL function. SlNetIf_getConnectionStatus uses this to get the connection status of the interface, so it never gets reported as connected through this function. Does the stack use this function? Could this be the reason it doesn't switch?
I have also tried making a build that includes only the PPP interface and I get the same basic response. The PPP connection is established and the IP address is assigned, but I am unable to create any socket connections.
What am I missing?