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
0cae0cc0
Commit
0cae0cc0
authored
Jul 12, 2012
by
Aurelio Colosimo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
White Rabbit: wr_present status implemented
parent
61b2062e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
40 additions
and
4 deletions
+40
-4
common-fun.c
proto-ext-whiterabbit/common-fun.c
+7
-0
state-listening.c
proto-ext-whiterabbit/state-listening.c
+3
-0
state-master.c
proto-ext-whiterabbit/state-master.c
+3
-0
state-wr-locked.c
proto-ext-whiterabbit/state-wr-locked.c
+1
-1
state-wr-present.c
proto-ext-whiterabbit/state-wr-present.c
+26
-3
No files found.
proto-ext-whiterabbit/common-fun.c
View file @
0cae0cc0
...
...
@@ -6,6 +6,7 @@
#include <ppsi/ppsi.h>
#include <ppsi/diag.h>
#include "common-fun.h"
#include "wr-api.h"
int
st_com_execute_slave
(
struct
pp_instance
*
ppi
,
int
check_delayreq
)
{
...
...
@@ -170,6 +171,12 @@ int st_com_slave_handle_announce(struct pp_instance *ppi, unsigned char *buf,
st_com_add_foreign
(
ppi
,
buf
);
}
if
((
DSPOR
(
ppi
)
->
wrConfig
&
WR_S_ONLY
)
&&
(
1
/* FIXME: Recommended State, see page 33*/
)
&&
(
DSPOR
(
ppi
)
->
parentWrConfig
&
WR_M_ONLY
)
&&
(
!
DSPOR
(
ppi
)
->
wrMode
||
!
DSPOR
(
ppi
)
->
parentWrModeOn
))
ppi
->
next_state
=
WRS_PRESENT
;
/*Reset Timer handling Announce receipt timeout*/
st_com_restart_annrec_timer
(
ppi
);
...
...
proto-ext-whiterabbit/state-listening.c
View file @
0cae0cc0
...
...
@@ -6,6 +6,7 @@
#include <ppsi/ppsi.h>
#include <ppsi/diag.h>
#include "common-fun.h"
#include "wr-api.h"
int
pp_listening
(
struct
pp_instance
*
ppi
,
unsigned
char
*
pkt
,
int
plen
)
{
...
...
@@ -13,6 +14,8 @@ int pp_listening(struct pp_instance *ppi, unsigned char *pkt, int plen)
if
(
ppi
->
is_new_state
)
{
DSPOR
(
ppi
)
->
portState
=
PPS_LISTENING
;
DSPOR
(
ppi
)
->
wrMode
=
NON_WR
;
DSPOR
(
ppi
)
->
wrPortState
=
WRS_IDLE
;
st_com_restart_annrec_timer
(
ppi
);
}
...
...
proto-ext-whiterabbit/state-master.c
View file @
0cae0cc0
...
...
@@ -30,6 +30,9 @@ int pp_master(struct pp_instance *ppi, unsigned char *pkt, int plen)
pp_timer_start
(
1
<<
DSPOR
(
ppi
)
->
logMinPdelayReqInterval
,
ppi
->
timers
[
PP_TIMER_PDELAYREQ
]);
/* Send an announce immediately, when becomes master */
if
(
msg_issue_announce
(
ppi
)
<
0
)
goto
failure
;
}
if
(
st_com_check_record_update
(
ppi
))
...
...
proto-ext-whiterabbit/state-wr-locked.c
View file @
0cae0cc0
...
...
@@ -10,7 +10,7 @@ int wr_locked(struct pp_instance *ppi, unsigned char *pkt, int plen)
{
/* FIXME implementation */
if
(
ppi
->
is_new_state
)
{
DSPOR
(
ppi
)
->
portState
=
PPS_
SLAVE
;
DSPOR
(
ppi
)
->
portState
=
PPS_
UNCALIBRATED
;
DSPOR
(
ppi
)
->
wrPortState
=
WRS_LOCKED
;
ppi
->
next_delay
=
PP_DEFAULT_NEXT_DELAY_MS
;
}
...
...
proto-ext-whiterabbit/state-wr-present.c
View file @
0cae0cc0
...
...
@@ -8,11 +8,34 @@
int
wr_present
(
struct
pp_instance
*
ppi
,
unsigned
char
*
pkt
,
int
plen
)
{
/* FIXME implementation */
int
e
=
0
;
if
(
ppi
->
is_new_state
)
{
DSPOR
(
ppi
)
->
portState
=
PPS_
SLAVE
;
DSPOR
(
ppi
)
->
portState
=
PPS_
UNCALIBRATED
;
DSPOR
(
ppi
)
->
wrPortState
=
WRS_PRESENT
;
DSPOR
(
ppi
)
->
wrMode
=
WR_SLAVE
;
ppi
->
next_delay
=
PP_DEFAULT_NEXT_DELAY_MS
;
pp_timer_start
(
DSPOR
(
ppi
)
->
wrStateTimeout
/
1000
,
ppi
->
timers
[
PP_TIMER_WRS_PRESENT
]);
st_com_restart_annrec_timer
(
ppi
);
e
=
msg_issue_wrsig
(
ppi
,
SLAVE_PRESENT
);
}
if
(
pp_timer_expired
(
ppi
->
timers
[
PP_TIMER_WRS_PRESENT
]))
{
ppi
->
next_state
=
PPS_LISTENING
;
goto
state_updated
;
}
return
0
;
if
(
e
==
0
)
st_com_execute_slave
(
ppi
,
0
);
else
ppi
->
next_state
=
PPS_FAULTY
;
state_updated:
if
(
ppi
->
next_state
!=
ppi
->
state
)
{
pp_timer_stop
(
ppi
->
timers
[
PP_TIMER_WRS_PRESENT
]);
pp_timer_stop
(
ppi
->
timers
[
PP_TIMER_ANN_RECEIPT
]);
}
return
e
;
}
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