Adjusted ifdef for MS/TP datalink layer build.
This commit is contained in:
@@ -38,10 +38,10 @@
|
|||||||
|
|
||||||
/** @file dlenv.c Initialize the DataLink configuration. */
|
/** @file dlenv.c Initialize the DataLink configuration. */
|
||||||
|
|
||||||
|
#if defined(BACDL_BIP) && BBMD_ENABLED
|
||||||
/* timer used to renew Foreign Device Registration */
|
/* timer used to renew Foreign Device Registration */
|
||||||
static uint16_t BBMD_Timer_Seconds;
|
static uint16_t BBMD_Timer_Seconds;
|
||||||
|
/* BBMD variables */
|
||||||
#if defined(BACDL_BIP) && BBMD_ENABLED
|
|
||||||
static long bbmd_timetolive_seconds = 60000;
|
static long bbmd_timetolive_seconds = 60000;
|
||||||
static long bbmd_port = 0xBAC0;
|
static long bbmd_port = 0xBAC0;
|
||||||
static long bbmd_address = 0;
|
static long bbmd_address = 0;
|
||||||
@@ -77,7 +77,6 @@ void set_bbmd_ttl( int ttl_secs )
|
|||||||
{
|
{
|
||||||
bbmd_timetolive_seconds = ttl_secs;
|
bbmd_timetolive_seconds = ttl_secs;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
/** Get the result of the last attempt to register with the indicated BBMD.
|
/** Get the result of the last attempt to register with the indicated BBMD.
|
||||||
* @return Positive number (of bytes sent) if registration was successful,
|
* @return Positive number (of bytes sent) if registration was successful,
|
||||||
@@ -88,6 +87,7 @@ int get_bbmd_result( void )
|
|||||||
{
|
{
|
||||||
return bbmd_result;
|
return bbmd_result;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/** Register as a Foreign Device with the designated BBMD.
|
/** Register as a Foreign Device with the designated BBMD.
|
||||||
* @ingroup DataLink
|
* @ingroup DataLink
|
||||||
@@ -157,13 +157,13 @@ int dlenv_register_as_foreign_device(
|
|||||||
void dlenv_maintenance_timer(
|
void dlenv_maintenance_timer(
|
||||||
uint16_t elapsed_seconds)
|
uint16_t elapsed_seconds)
|
||||||
{
|
{
|
||||||
|
#if defined(BACDL_BIP) && BBMD_ENABLED
|
||||||
if (BBMD_Timer_Seconds) {
|
if (BBMD_Timer_Seconds) {
|
||||||
if (BBMD_Timer_Seconds <= elapsed_seconds) {
|
if (BBMD_Timer_Seconds <= elapsed_seconds) {
|
||||||
BBMD_Timer_Seconds = 0;
|
BBMD_Timer_Seconds = 0;
|
||||||
} else {
|
} else {
|
||||||
BBMD_Timer_Seconds -= elapsed_seconds;
|
BBMD_Timer_Seconds -= elapsed_seconds;
|
||||||
}
|
}
|
||||||
#if defined(BACDL_BIP) && BBMD_ENABLED
|
|
||||||
if (BBMD_Timer_Seconds == 0) {
|
if (BBMD_Timer_Seconds == 0) {
|
||||||
int retval;
|
int retval;
|
||||||
retval = dlenv_register_as_foreign_device();
|
retval = dlenv_register_as_foreign_device();
|
||||||
@@ -172,8 +172,8 @@ void dlenv_maintenance_timer(
|
|||||||
if ( retval < 0 )
|
if ( retval < 0 )
|
||||||
BBMD_Timer_Seconds = bbmd_timetolive_seconds;
|
BBMD_Timer_Seconds = bbmd_timetolive_seconds;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Initialize the DataLink configuration from Environment variables,
|
/** Initialize the DataLink configuration from Environment variables,
|
||||||
|
|||||||
Reference in New Issue
Block a user