src/nmtMaster.c
changeset 215 f49e5a6b7804
parent 208 05d95c45b388
child 365 9b76e0881beb
equal deleted inserted replaced
214:003cc3c63855 215:f49e5a6b7804
    46 {
    46 {
    47   Message m;
    47   Message m;
    48 
    48 
    49   MSG_WAR(0x3501, "Send_NMT cs : ", cs);
    49   MSG_WAR(0x3501, "Send_NMT cs : ", cs);
    50   MSG_WAR(0x3502, "    to node : ", Node_ID);
    50   MSG_WAR(0x3502, "    to node : ", Node_ID);
    51   /*! message configuration */
    51   /* message configuration */
    52   m.cob_id.w = 0x0000; /*(NMT) << 7*/
    52   m.cob_id.w = 0x0000; /*(NMT) << 7*/
    53   m.rtr = NOT_A_REQUEST;
    53   m.rtr = NOT_A_REQUEST;
    54   m.len = 2;
    54   m.len = 2;
    55   m.data[0] = cs;
    55   m.data[0] = cs;
    56   m.data[1] = Node_ID;
    56   m.data[1] = Node_ID;
    87 ** @param d
    87 ** @param d
    88 ** @param nodeId
    88 ** @param nodeId
    89 **/
    89 **/
    90 void masterRequestNodeState(CO_Data* d, UNS8 nodeId)
    90 void masterRequestNodeState(CO_Data* d, UNS8 nodeId)
    91 {
    91 {
    92   /*! FIXME: should warn for bad toggle bit. */
    92   /* FIXME: should warn for bad toggle bit. */
    93 
    93 
    94   /*! NMTable configuration to indicate that the master is waiting
    94   /* NMTable configuration to indicate that the master is waiting
    95     for a Node_Guard frame from the slave whose node_id is ID
    95     for a Node_Guard frame from the slave whose node_id is ID
    96   */
    96   */
    97   d->NMTable[nodeId] = Unknown_state; /*! A state that does not exist
    97   d->NMTable[nodeId] = Unknown_state; /* A state that does not exist
    98                                        */
    98                                        */
    99 
    99 
   100   if (nodeId == 0) { /*! NMT broadcast */
   100   if (nodeId == 0) { /* NMT broadcast */
   101     UNS8 i = 0;
   101     UNS8 i = 0;
   102     for (i = 0 ; i < NMT_MAX_NODE_ID ; i++) {
   102     for (i = 0 ; i < NMT_MAX_NODE_ID ; i++) {
   103       d->NMTable[i] = Unknown_state;
   103       d->NMTable[i] = Unknown_state;
   104     }
   104     }
   105   }
   105   }