Добавлены команды чтения и записи портов по Ethernet.
This commit is contained in:
@@ -25,7 +25,6 @@
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include <stdint.h>
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "stm32f4xx_hal.h"
|
||||
|
||||
@@ -33,16 +32,13 @@ extern "C" {
|
||||
/* USER CODE BEGIN Includes */
|
||||
|
||||
#include <string.h>
|
||||
#include "lwip.h"
|
||||
#include "lwip/udp.h"
|
||||
#include "lwip/debug.h"
|
||||
|
||||
/* USER CODE END Includes */
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/* USER CODE BEGIN ET */
|
||||
typedef struct rcv_msg
|
||||
{
|
||||
uint32_t rcv_addr;
|
||||
uint16_t port;
|
||||
uint16_t cmd_num;
|
||||
uint16_t cmd_code;
|
||||
@@ -52,6 +48,15 @@ typedef struct rcv_msg
|
||||
uint16_t con_timeout;
|
||||
}_rcv_msg;
|
||||
|
||||
|
||||
typedef struct tsm_msg
|
||||
{
|
||||
unsigned char tx_buf[1400];
|
||||
uint16_t status_len;
|
||||
uint16_t length;
|
||||
uint16_t cmd_len;
|
||||
}_tsm_msg;
|
||||
|
||||
/* USER CODE END ET */
|
||||
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
|
||||
@@ -56,6 +56,15 @@ uint32_t get_ip(void);
|
||||
uint16_t get_port(void);
|
||||
uint16_t set_status(unsigned char *buf);
|
||||
|
||||
enum
|
||||
{
|
||||
IN_PROGRESS = 0,
|
||||
NO_ERROR,
|
||||
ERR_SIZE,
|
||||
|
||||
ERR_UNKNOW_COMMAND = 255
|
||||
};
|
||||
|
||||
#endif /* INC_PRIBORS_H_ */
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user