Refs #459. Added easy integration support for the master/slave gateway add-on module.

git-svn-id: https://svn.code.sf.net/p/openblt/code/trunk@627 5dc33758-31d5-4daf-9ae8-b24bf3d40d73
This commit is contained in:
Frank Voorburg 2018-10-04 05:46:21 +00:00
parent 0c03b1f9d1
commit 6345a5433d
3 changed files with 29 additions and 1 deletions

View File

@ -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();

View File

@ -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
/****************************************************************************************

View File

@ -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 ***/