/* timer have been notified and is now free (non periodic)*/
/* -> avoid deleting re-assigned timer if message is received too late*/
d->ConsumerHeartBeatTimers[id]=TIMER_NONE;
/* set node state */
d->NMTable[nodeId] = Disconnected;
/*! call heartbeat error with NodeId */
(*d->heartbeatError)(d, nodeId);
}
这个是主机心跳计时溢出回调,这个nodeId一直是0,如果发生错误,根本就不知道是哪个节点心跳出错了呀,刚刚接触,有说错的地方,希望包涵,欢迎纠正,需要源码的可以留言,到时候我再上传一下。
还有,下面这段代码是检测到上线报文的处理
/* Boot-Up frame reception */
if ( d->NMTable[nodeId] == Initialisation)
{
/*
** The device send the boot-up message (Initialisation)
** to indicate the master that it is entered in
** pre_operational mode
*/
MSG_WAR(0x3100, "The NMT is a bootup from node : ", nodeId);
/* call post SlaveBootup with NodeId */
(*d->post_SlaveBootup)(d, nodeId);
}