diff --git a/Target/Source/boot.c b/Target/Source/boot.c index 34df3bcb..77f85daa 100644 --- a/Target/Source/boot.c +++ b/Target/Source/boot.c @@ -54,6 +54,10 @@ void BootInit(void) #if (BOOT_COM_ENABLE > 0) /* initialize the communication module */ ComInit(); +#endif +#if (ADDON_GATEWAY_MOD_ENABLE > 0) + /* initialize the gateway module */ + GatewayInit(); #endif /* initialize the backdoor entry */ BackDoorInit(); @@ -78,6 +82,10 @@ void BootTask(void) #if (BOOT_COM_ENABLE > 0) /* process possibly pending communication data */ ComTask(); +#endif +#if (ADDON_GATEWAY_MOD_ENABLE > 0) + /* run the gateway */ + GatewayTask(); #endif /* control the backdoor */ BackDoorCheck(); diff --git a/Target/Source/boot.h b/Target/Source/boot.h index cd84f831..babaa492 100644 --- a/Target/Source/boot.h +++ b/Target/Source/boot.h @@ -63,6 +63,9 @@ #include "backdoor.h" /* backdoor entry module */ #include "file.h" /* file system module */ #include "com.h" /* communication interface */ +#if (ADDON_GATEWAY_MOD_ENABLE > 0) +#include "gateway.h" /* gateway add-on module */ +#endif /**************************************************************************************** diff --git a/Target/Source/com.c b/Target/Source/com.c index b5dc5ed7..84f89008 100644 --- a/Target/Source/com.c +++ b/Target/Source/com.c @@ -286,7 +286,24 @@ blt_int16u ComGetActiveInterfaceMaxTxLen(void) ****************************************************************************************/ blt_bool ComIsConnected(void) { - return XcpIsConnected(); + blt_bool result = BLT_FALSE; + + /* Is there an active XCP connection? This indicates that the communication interface + * is in the connection state. + */ + if (XcpIsConnected()) + { + result = BLT_TRUE; + } +#if (ADDON_GATEWAY_MOD_ENABLE > 0) + /* Is the gateway active? This indicates an XCP connection with a slave. */ + if (GatewayIsActive()) + { + result = BLT_TRUE; + } +#endif + /* give the result back to the caller. */ + return result; } /*** end of ComIsConnected ***/