move modbus slave test app to app_Framework

This commit is contained in:
Wien.b 2023-11-29 00:54:15 -08:00
parent d3c7d7ce9f
commit ffe83b869a
5 changed files with 15 additions and 41 deletions

View File

@ -15,6 +15,10 @@ ifeq ($(CONFIG_ADD_XIZI_FEATURES),y)
SRC_DIR += socket_demo
endif
ifeq ($(CONFIG_CONNECTION_ADAPTER_FREEMODBUSTCP),y)
SRC_DIR += freemodbus_tcp_slave
endif
include $(KERNEL_ROOT)/compiler.mk
endif

View File

@ -0,0 +1,3 @@
SRC_FILES := tcpserver_sample.c
include $(KERNEL_ROOT)/compiler.mk

View File

@ -70,7 +70,7 @@ static void* pvPollingThread( void *pvParameter );
int LWIPConnectSocket(uint16_t port);
/* ----------------------- Start implementation -----------------------------*/
int MBServer()
int MBSlave()
{
int iExitCode;
CHAR cCh;
@ -115,7 +115,7 @@ int MBServer()
return iExitCode;
}
PRIV_SHELL_CMD_FUNCTION(MBServer, a Mtcp server Demo, PRIV_SHELL_CMD_MAIN_ATTR);
PRIV_SHELL_CMD_FUNCTION(MBSlave, a Mtcp server Demo, PRIV_SHELL_CMD_MAIN_ATTR);
BOOL bCreatePollingThread( void )
@ -257,42 +257,3 @@ eMBErrorCode eMBRegDiscreteCB( UCHAR * pucRegBuffer, USHORT usAddress, USHORT us
{
return MB_ENOREG;
}
/**
* @description: Modbus Tcp Server Open
* @param control_protocol - control protocol pointer
* @return success : 0 error
*/
// int FreeModbusTcpOpen(struct ControlProtocol *control_protocol)
// {
// ControlProtocolOpenDef(control_protocol);
// return 0;
// }
// static struct ControlDone FreeModbusTcp_protocol_done =
// {
// ._open = FreeModbusTcpOpen,
// ._close = NULL,
// ._read = NULL,
// ._write = NULL,
// ._ioctl = NULL,
// };
// void *ReceivePlcDataTask(void *parameter)
// {
// MBServer();
// }
/**
* @description: Modbus Tcp Server Init
* @param p_recipe - recipe pointer
* @return success : 0 error : -1
*/
// int FreeModbusTcpServerInit(struct ControlRecipe *p_recipe)
// {
// p_recipe->done = &FreeModbusTcp_protocol_done;
// return 0;
// }

View File

@ -20,6 +20,7 @@ endif
ifeq ($(CONFIG_SUPPORT_CONNECTION_FRAMEWORK), y)
APPPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/connection #
APPPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/connection/industrial_network/freemodbus_tcp #
endif
ifeq ($(CONFIG_SUPPORT_KNOWING_FRAMEWORK), y)
@ -35,6 +36,7 @@ APPPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/control #
APPPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/control/plc/interoperability/opcua #
endif
ifeq ($(CONFIG_CRYPTO), y)
APPPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/security/crypto/include #
endif

View File

@ -488,6 +488,7 @@ endif
ifeq ($(CONFIG_SUPPORT_CONNECTION_FRAMEWORK), y)
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/connection #
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/connection/zigbee #
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/connection/industrial_network/freemodbus_tcp #
endif
ifeq ($(CONFIG_ADAPTER_HFA21_ETHERCAT), y)
@ -529,6 +530,9 @@ KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/control/ipc_protoc
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/control/ipc_protocol/include #
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/control/ipc_protocol/modbus_tcp #
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/control/ipc_protocol/modbus_uart #
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/control/ipc_protocol/ethercat #
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/control/ipc_protocol/ethercat/comm #
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/control/ipc_protocol/ethercat/soem #
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/control/plc_protocol #
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/control/plc_protocol/include #
KERNELPATHS += -I$(KERNEL_ROOT)/../../APP_Framework/Framework/control/plc_protocol/fins #