Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
50
Issues
50
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
PPSi
Commits
ee45a0a6
Commit
ee45a0a6
authored
Jul 12, 2012
by
Aurelio Colosimo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
portState field correctly handled in DSPort Dataset
parent
c6de634d
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
20 additions
and
2 deletions
+20
-2
state-disabled.c
proto-ext-whiterabbit/state-disabled.c
+1
-0
state-faulty.c
proto-ext-whiterabbit/state-faulty.c
+1
-0
state-initializing.c
proto-ext-whiterabbit/state-initializing.c
+1
-0
state-listening.c
proto-ext-whiterabbit/state-listening.c
+3
-1
state-master.c
proto-ext-whiterabbit/state-master.c
+1
-0
state-passive.c
proto-ext-whiterabbit/state-passive.c
+1
-0
state-pre-master.c
proto-ext-whiterabbit/state-pre-master.c
+1
-0
state-slave.c
proto-ext-whiterabbit/state-slave.c
+1
-0
state-disabled.c
proto-standard/state-disabled.c
+1
-0
state-faulty.c
proto-standard/state-faulty.c
+1
-0
state-initializing.c
proto-standard/state-initializing.c
+1
-0
state-listening.c
proto-standard/state-listening.c
+3
-1
state-master.c
proto-standard/state-master.c
+1
-0
state-passive.c
proto-standard/state-passive.c
+1
-0
state-pre-master.c
proto-standard/state-pre-master.c
+1
-0
state-slave.c
proto-standard/state-slave.c
+1
-0
No files found.
proto-ext-whiterabbit/state-disabled.c
View file @
ee45a0a6
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
int
pp_disabled
(
struct
pp_instance
*
ppi
,
unsigned
char
*
pkt
,
int
plen
)
int
pp_disabled
(
struct
pp_instance
*
ppi
,
unsigned
char
*
pkt
,
int
plen
)
{
{
/* nothing to do */
/* nothing to do */
DSPOR
(
ppi
)
->
portState
=
PPS_DISABLED
;
ppi
->
next_delay
=
PP_DEFAULT_NEXT_DELAY_MS
;
ppi
->
next_delay
=
PP_DEFAULT_NEXT_DELAY_MS
;
return
0
;
return
0
;
}
}
proto-ext-whiterabbit/state-faulty.c
View file @
ee45a0a6
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
int
pp_faulty
(
struct
pp_instance
*
ppi
,
unsigned
char
*
pkt
,
int
plen
)
int
pp_faulty
(
struct
pp_instance
*
ppi
,
unsigned
char
*
pkt
,
int
plen
)
{
{
DSPOR
(
ppi
)
->
portState
=
PPS_FAULTY
;
pp_printf
(
"event FAULT_CLEARED
\n
"
);
pp_printf
(
"event FAULT_CLEARED
\n
"
);
ppi
->
next_state
=
PPS_INITIALIZING
;
ppi
->
next_state
=
PPS_INITIALIZING
;
ppi
->
next_delay
=
PP_DEFAULT_NEXT_DELAY_MS
*
4
;
ppi
->
next_delay
=
PP_DEFAULT_NEXT_DELAY_MS
*
4
;
...
...
proto-ext-whiterabbit/state-initializing.c
View file @
ee45a0a6
...
@@ -23,6 +23,7 @@ int pp_initializing(struct pp_instance *ppi, unsigned char *pkt, int plen)
...
@@ -23,6 +23,7 @@ int pp_initializing(struct pp_instance *ppi, unsigned char *pkt, int plen)
if
(
pp_net_init
(
ppi
)
<
0
)
if
(
pp_net_init
(
ppi
)
<
0
)
goto
failure
;
goto
failure
;
pp_did_init
=
1
;
pp_did_init
=
1
;
DSPOR
(
ppi
)
->
portState
=
PPS_INITIALIZING
;
/* Initialize default data set */
/* Initialize default data set */
DSDEF
(
ppi
)
->
twoStepFlag
=
PP_TWO_STEP_FLAG
;
DSDEF
(
ppi
)
->
twoStepFlag
=
PP_TWO_STEP_FLAG
;
...
...
proto-ext-whiterabbit/state-listening.c
View file @
ee45a0a6
...
@@ -11,8 +11,10 @@ int pp_listening(struct pp_instance *ppi, unsigned char *pkt, int plen)
...
@@ -11,8 +11,10 @@ int pp_listening(struct pp_instance *ppi, unsigned char *pkt, int plen)
{
{
int
e
=
0
;
/* error var, to check errors in msg handling */
int
e
=
0
;
/* error var, to check errors in msg handling */
if
(
ppi
->
is_new_state
)
if
(
ppi
->
is_new_state
)
{
DSPOR
(
ppi
)
->
portState
=
PPS_LISTENING
;
st_com_restart_annrec_timer
(
ppi
);
st_com_restart_annrec_timer
(
ppi
);
}
if
(
st_com_check_record_update
(
ppi
))
if
(
st_com_check_record_update
(
ppi
))
goto
state_updated
;
goto
state_updated
;
...
...
proto-ext-whiterabbit/state-master.c
View file @
ee45a0a6
...
@@ -21,6 +21,7 @@ int pp_master(struct pp_instance *ppi, unsigned char *pkt, int plen)
...
@@ -21,6 +21,7 @@ int pp_master(struct pp_instance *ppi, unsigned char *pkt, int plen)
time
=
&
ppi
->
last_rcv_time
;
time
=
&
ppi
->
last_rcv_time
;
if
(
ppi
->
is_new_state
)
{
if
(
ppi
->
is_new_state
)
{
DSPOR
(
ppi
)
->
portState
=
PPS_MASTER
;
pp_timer_start
(
1
<<
DSPOR
(
ppi
)
->
logSyncInterval
,
pp_timer_start
(
1
<<
DSPOR
(
ppi
)
->
logSyncInterval
,
ppi
->
timers
[
PP_TIMER_SYNC
]);
ppi
->
timers
[
PP_TIMER_SYNC
]);
...
...
proto-ext-whiterabbit/state-passive.c
View file @
ee45a0a6
...
@@ -11,6 +11,7 @@ int pp_passive(struct pp_instance *ppi, unsigned char *pkt, int plen)
...
@@ -11,6 +11,7 @@ int pp_passive(struct pp_instance *ppi, unsigned char *pkt, int plen)
int
e
=
0
;
/* error var, to check errors in msg handling */
int
e
=
0
;
/* error var, to check errors in msg handling */
if
(
ppi
->
is_new_state
)
{
if
(
ppi
->
is_new_state
)
{
DSPOR
(
ppi
)
->
portState
=
PPS_PASSIVE
;
pp_timer_start
(
1
<<
DSPOR
(
ppi
)
->
logMinPdelayReqInterval
,
pp_timer_start
(
1
<<
DSPOR
(
ppi
)
->
logMinPdelayReqInterval
,
ppi
->
timers
[
PP_TIMER_PDELAYREQ
]);
ppi
->
timers
[
PP_TIMER_PDELAYREQ
]);
...
...
proto-ext-whiterabbit/state-pre-master.c
View file @
ee45a0a6
...
@@ -11,5 +11,6 @@ int pp_pre_master(struct pp_instance *ppi, unsigned char *pkt, int plen)
...
@@ -11,5 +11,6 @@ int pp_pre_master(struct pp_instance *ppi, unsigned char *pkt, int plen)
* No need of PRE_MASTER state because of only ordinary clock
* No need of PRE_MASTER state because of only ordinary clock
* implementation.
* implementation.
*/
*/
DSPOR
(
ppi
)
->
portState
=
PPS_PRE_MASTER
;
return
0
;
return
0
;
}
}
proto-ext-whiterabbit/state-slave.c
View file @
ee45a0a6
...
@@ -19,6 +19,7 @@ int pp_slave(struct pp_instance *ppi, unsigned char *pkt, int plen)
...
@@ -19,6 +19,7 @@ int pp_slave(struct pp_instance *ppi, unsigned char *pkt, int plen)
time
=
&
ppi
->
last_rcv_time
;
time
=
&
ppi
->
last_rcv_time
;
if
(
ppi
->
is_new_state
)
{
if
(
ppi
->
is_new_state
)
{
DSPOR
(
ppi
)
->
portState
=
PPS_SLAVE
;
pp_init_clock
(
ppi
);
pp_init_clock
(
ppi
);
ppi
->
waiting_for_follow
=
FALSE
;
ppi
->
waiting_for_follow
=
FALSE
;
...
...
proto-standard/state-disabled.c
View file @
ee45a0a6
...
@@ -8,6 +8,7 @@
...
@@ -8,6 +8,7 @@
int
pp_disabled
(
struct
pp_instance
*
ppi
,
unsigned
char
*
pkt
,
int
plen
)
int
pp_disabled
(
struct
pp_instance
*
ppi
,
unsigned
char
*
pkt
,
int
plen
)
{
{
/* nothing to do */
/* nothing to do */
DSPOR
(
ppi
)
->
portState
=
PPS_DISABLED
;
ppi
->
next_delay
=
PP_DEFAULT_NEXT_DELAY_MS
;
ppi
->
next_delay
=
PP_DEFAULT_NEXT_DELAY_MS
;
return
0
;
return
0
;
}
}
proto-standard/state-faulty.c
View file @
ee45a0a6
...
@@ -13,6 +13,7 @@
...
@@ -13,6 +13,7 @@
int
pp_faulty
(
struct
pp_instance
*
ppi
,
unsigned
char
*
pkt
,
int
plen
)
int
pp_faulty
(
struct
pp_instance
*
ppi
,
unsigned
char
*
pkt
,
int
plen
)
{
{
DSPOR
(
ppi
)
->
portState
=
PPS_FAULTY
;
pp_printf
(
"event FAULT_CLEARED
\n
"
);
pp_printf
(
"event FAULT_CLEARED
\n
"
);
ppi
->
next_state
=
PPS_INITIALIZING
;
ppi
->
next_state
=
PPS_INITIALIZING
;
ppi
->
next_delay
=
PP_DEFAULT_NEXT_DELAY_MS
*
4
;
ppi
->
next_delay
=
PP_DEFAULT_NEXT_DELAY_MS
*
4
;
...
...
proto-standard/state-initializing.c
View file @
ee45a0a6
...
@@ -22,6 +22,7 @@ int pp_initializing(struct pp_instance *ppi, unsigned char *pkt, int plen)
...
@@ -22,6 +22,7 @@ int pp_initializing(struct pp_instance *ppi, unsigned char *pkt, int plen)
if
(
pp_net_init
(
ppi
)
<
0
)
if
(
pp_net_init
(
ppi
)
<
0
)
goto
failure
;
goto
failure
;
pp_did_init
=
1
;
pp_did_init
=
1
;
DSPOR
(
ppi
)
->
portState
=
PPS_INITIALIZING
;
/* Initialize default data set */
/* Initialize default data set */
DSDEF
(
ppi
)
->
twoStepFlag
=
PP_TWO_STEP_FLAG
;
DSDEF
(
ppi
)
->
twoStepFlag
=
PP_TWO_STEP_FLAG
;
...
...
proto-standard/state-listening.c
View file @
ee45a0a6
...
@@ -11,8 +11,10 @@ int pp_listening(struct pp_instance *ppi, unsigned char *pkt, int plen)
...
@@ -11,8 +11,10 @@ int pp_listening(struct pp_instance *ppi, unsigned char *pkt, int plen)
{
{
int
e
=
0
;
/* error var, to check errors in msg handling */
int
e
=
0
;
/* error var, to check errors in msg handling */
if
(
ppi
->
is_new_state
)
if
(
ppi
->
is_new_state
)
{
DSPOR
(
ppi
)
->
portState
=
PPS_LISTENING
;
st_com_restart_annrec_timer
(
ppi
);
st_com_restart_annrec_timer
(
ppi
);
}
if
(
st_com_check_record_update
(
ppi
))
if
(
st_com_check_record_update
(
ppi
))
goto
state_updated
;
goto
state_updated
;
...
...
proto-standard/state-master.c
View file @
ee45a0a6
...
@@ -21,6 +21,7 @@ int pp_master(struct pp_instance *ppi, unsigned char *pkt, int plen)
...
@@ -21,6 +21,7 @@ int pp_master(struct pp_instance *ppi, unsigned char *pkt, int plen)
time
=
&
ppi
->
last_rcv_time
;
time
=
&
ppi
->
last_rcv_time
;
if
(
ppi
->
is_new_state
)
{
if
(
ppi
->
is_new_state
)
{
DSPOR
(
ppi
)
->
portState
=
PPS_MASTER
;
pp_timer_start
(
1
<<
DSPOR
(
ppi
)
->
logSyncInterval
,
pp_timer_start
(
1
<<
DSPOR
(
ppi
)
->
logSyncInterval
,
ppi
->
timers
[
PP_TIMER_SYNC
]);
ppi
->
timers
[
PP_TIMER_SYNC
]);
...
...
proto-standard/state-passive.c
View file @
ee45a0a6
...
@@ -11,6 +11,7 @@ int pp_passive(struct pp_instance *ppi, unsigned char *pkt, int plen)
...
@@ -11,6 +11,7 @@ int pp_passive(struct pp_instance *ppi, unsigned char *pkt, int plen)
int
e
=
0
;
/* error var, to check errors in msg handling */
int
e
=
0
;
/* error var, to check errors in msg handling */
if
(
ppi
->
is_new_state
)
{
if
(
ppi
->
is_new_state
)
{
DSPOR
(
ppi
)
->
portState
=
PPS_PASSIVE
;
pp_timer_start
(
1
<<
DSPOR
(
ppi
)
->
logMinPdelayReqInterval
,
pp_timer_start
(
1
<<
DSPOR
(
ppi
)
->
logMinPdelayReqInterval
,
ppi
->
timers
[
PP_TIMER_PDELAYREQ
]);
ppi
->
timers
[
PP_TIMER_PDELAYREQ
]);
...
...
proto-standard/state-pre-master.c
View file @
ee45a0a6
...
@@ -11,5 +11,6 @@ int pp_pre_master(struct pp_instance *ppi, unsigned char *pkt, int plen)
...
@@ -11,5 +11,6 @@ int pp_pre_master(struct pp_instance *ppi, unsigned char *pkt, int plen)
* No need of PRE_MASTER state because of only ordinary clock
* No need of PRE_MASTER state because of only ordinary clock
* implementation.
* implementation.
*/
*/
DSPOR
(
ppi
)
->
portState
=
PPS_PRE_MASTER
;
return
0
;
return
0
;
}
}
proto-standard/state-slave.c
View file @
ee45a0a6
...
@@ -19,6 +19,7 @@ int pp_slave(struct pp_instance *ppi, unsigned char *pkt, int plen)
...
@@ -19,6 +19,7 @@ int pp_slave(struct pp_instance *ppi, unsigned char *pkt, int plen)
time
=
&
ppi
->
last_rcv_time
;
time
=
&
ppi
->
last_rcv_time
;
if
(
ppi
->
is_new_state
)
{
if
(
ppi
->
is_new_state
)
{
DSPOR
(
ppi
)
->
portState
=
PPS_SLAVE
;
pp_init_clock
(
ppi
);
pp_init_clock
(
ppi
);
ppi
->
waiting_for_follow
=
FALSE
;
ppi
->
waiting_for_follow
=
FALSE
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment