Hi shib.
You are 100% correct, thanks for the pointer.
So what happens is when the network signal gets restored, a new IP address is issued by network (Im not using a private APN for the testing phase just yet). The route and gateway is never updated by dataConnectionServices and therefore the device routing table is not configured correctly with the new information (uses old IP and gw), therefore the data connection won’t work.
Looking at the Service code I found that the default route is set by the ChannelEventHandler. I found that dcsServer.c ChannelEventHandler never gets called at any point during transition to UP state, and therefore SetDefaultRouteAndDns never get called once the connection is restored, and this ties up with what you and I are seeing. At some point there should be an LE_DCS_EVENT_UP to the channel handler, but this never happens, so the route does not get set up properly
In my humble opinion this is a bug in DataConnectionServices. What I can’t understand is how this basic problem is still around, surely there would have been thousands of tickets.
I think that on transition change, the should be a notification to ChannelEventHandler that the interface is up instead of a channel retry so I added this function in dcs_db.c
static void DcsApplyTechSystemUpEventAction
(
le_dcs_channelDb_t *channelDb
)
{
le_dls_Link_t *evtHdlrPtr;
le_dcs_channelDbEventHdlr_t *channelAppEvt;
le_dcs_channelDbEventReport_t evtReport;LE_INFO("FMP: DcsApplyTechSystemUpAction"); evtHdlrPtr = le_dls_Peek(&channelDb->evtHdlrs); while (evtHdlrPtr) { // traverse all event handlers to trigger an event notification channelAppEvt = CONTAINER_OF(evtHdlrPtr, le_dcs_channelDbEventHdlr_t, hdlrLink); LE_DEBUG("Send Up event notice for channel %s to app with session reference %p", channelDb->channelName, dcs_GetSessionRef(channelAppEvt->appSessionRefKey)); evtReport.channelDb = channelDb; evtReport.event = LE_DCS_EVENT_UP; le_event_Report(channelAppEvt->channelEventId, &evtReport, sizeof(evtReport)); evtHdlrPtr = le_dls_PeekNext(&channelDb->evtHdlrs, evtHdlrPtr); }
}
and modified dcs_EventNotifierTechStateTransition to call this function instead of dcsTech_RetryChannel.
LE_INFO(“Notify all channels of technology %d of system state transition to %s”,
tech, techState ? “up” : “down”);
if (!techState)
{
func = &DcsApplyTechSystemDownEventAction;
}
else
{
LE_INFO(“FMP: Added DcsApplyTechSystemUpEventAction, removed Channel Retry”);
func = &DcsApplyTechSystemUpEventAction;
//func = &dcsTech_RetryChannel;
}
This corrects the particular problem I’m facing, but not sure what other issues it will introduce as don’t know if retry channel function belongs here, and hence I don’t recommend this to anyone with my 2 weeks super knowledge. Would be nice if someone from Legato Development can comment, particularly if I’ve lost the plot.