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;
// }