108 d->nodeState = Initialisation; |
108 d->nodeState = Initialisation; |
109 newState = Pre_operational; |
109 newState = Pre_operational; |
110 switchCommunicationState(d, &newCommunicationState); |
110 switchCommunicationState(d, &newCommunicationState); |
111 /* call user app related state func. */ |
111 /* call user app related state func. */ |
112 (*d->initialisation)(); |
112 (*d->initialisation)(); |
|
113 |
113 } |
114 } |
114 break; |
115 break; |
115 |
116 |
116 case Pre_operational: |
117 case Pre_operational: |
117 { |
118 { |
|
119 |
118 s_state_communication newCommunicationState = {0, 1, 1, 1, 1, 0}; |
120 s_state_communication newCommunicationState = {0, 1, 1, 1, 1, 0}; |
119 d->nodeState = Pre_operational; |
121 d->nodeState = Pre_operational; |
120 newState = Pre_operational; |
122 newState = Pre_operational; |
121 switchCommunicationState(d, &newCommunicationState); |
123 switchCommunicationState(d, &newCommunicationState); |
122 (*d->preOperational)(); |
124 if (!(*(d->iam_a_slave))) |
|
125 { |
|
126 UNS32 res; |
|
127 res = decompo_dcf(d,0x01); |
|
128 } |
|
129 else |
|
130 { |
|
131 (*d->preOperational)(); |
|
132 } |
123 } |
133 } |
124 break; |
134 break; |
125 |
135 |
126 case Operational: |
136 case Operational: |
127 if(d->nodeState == Initialisation) return 0xFF; |
137 if(d->nodeState == Initialisation) return 0xFF; |