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
f42b267c
Commit
f42b267c
authored
Mar 13, 2023
by
Tristan Gingold
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
l1e-state-machine.c: minor rewrite
parent
1dda5f2d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
24 deletions
+26
-24
l1e-state-machine.c
proto-ext-l1sync/l1e-state-machine.c
+26
-24
No files found.
proto-ext-l1sync/l1e-state-machine.c
View file @
f42b267c
...
...
@@ -208,30 +208,32 @@ static __inline__ int measure_last_time(struct pp_instance *ppi, int fmeas) {
return
ms
;
}
static
void
l1e_send_sync_msg
(
struct
pp_instance
*
ppi
,
Boolean
immediatSend
)
{
if
(
immediatSend
||
pp_timeout
(
ppi
,
PP_TO_L1E_TX_SYNC
)
)
{
int
len
;
int
fmeas
,
lmeas
;
int
diff
;
int
tmo_ms
;
fmeas
=
measure_first_time
(
ppi
);
pp_diag
(
ppi
,
ext
,
1
,
"Sending L1SYNC_TLV signaling msg
\n
"
);
len
=
l1e_pack_signal
(
ppi
);
__send_and_log
(
ppi
,
len
,
PP_NP_GEN
,
PPM_SIGNALING_NO_FWD_FMT
);
lmeas
=
measure_last_time
(
ppi
,
fmeas
);
diff
=
lmeas
-
fmeas
;
/* Calculate when the next message should be sent */
/* A "diff" value is subtracted from the timer to take into account
* the execution time of this function. With small time-out like 64ms,
* the error become not negligible.
*/
tmo_ms
=
pp_timeout_log_to_ms
(
L1E_DSPOR_BS
(
ppi
)
->
logL1SyncInterval
);
if
(
tmo_ms
>=
diff
)
/* to be sure to have a positive value */
tmo_ms
-=
diff
;
pp_timeout_set
(
ppi
,
PP_TO_L1E_TX_SYNC
,
tmo_ms
);
/* loop ever since */
}
static
void
l1e_send_sync_msg
(
struct
pp_instance
*
ppi
,
Boolean
immediatSend
)
{
int
len
;
int
fmeas
,
lmeas
;
int
diff
;
int
tmo_ms
;
if
(
!
immediatSend
&&
!
pp_timeout
(
ppi
,
PP_TO_L1E_TX_SYNC
))
return
;
fmeas
=
measure_first_time
(
ppi
);
pp_diag
(
ppi
,
ext
,
1
,
"Sending L1SYNC_TLV signaling msg
\n
"
);
len
=
l1e_pack_signal
(
ppi
);
__send_and_log
(
ppi
,
len
,
PP_NP_GEN
,
PPM_SIGNALING_NO_FWD_FMT
);
lmeas
=
measure_last_time
(
ppi
,
fmeas
);
/* Calculate when the next message should be sent */
/* A "diff" value is subtracted from the timer to take into account
* the execution time of this function. With small time-out like 64ms,
* the error become not negligible.
*/
tmo_ms
=
pp_timeout_log_to_ms
(
L1E_DSPOR_BS
(
ppi
)
->
logL1SyncInterval
);
diff
=
lmeas
-
fmeas
;
if
(
tmo_ms
>=
diff
)
/* to be sure to have a positive value */
tmo_ms
-=
diff
;
pp_timeout_set
(
ppi
,
PP_TO_L1E_TX_SYNC
,
tmo_ms
);
/* loop ever since */
}
/* DISABLED state */
...
...
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