refactor(vd960DBN): replace compile-time NET_SSC/NET_JSON/NET_IOT macros with runtime g_sub_code_enable.iot_enable
- Remove NET_SSC_ENABLE, NET_JSON_ENABLE, NET_IOT_ENABLE from net_config.h - Socket config always allocates max: 1 UDP + 2 TCP + 1 TCP_LISTEN - All #if guards in net_srv.c/h and peripheral_main.c replaced with runtime g_sub_code_enable.iot_enable checks - iot_enable=0 -> SSC mode (UDP + TCP client + JSON server) - iot_enable=1 -> IoT MQTT mode (MQTT client via iot_mqtt_srv)
This commit is contained in:
@@ -249,10 +249,8 @@ void write_net_config(Local_Net_Cfg *local, NET_CENTER_INFO *center, IOT_NET_INF
|
||||
extern uint8_t g_flag_timestamp;
|
||||
extern uint8_t RemoteIP[4];
|
||||
|
||||
#if NET_SSC_ENABLE
|
||||
extern uint8_t SocketId_TCP;
|
||||
extern uint8_t SocketId_UDP;
|
||||
#endif
|
||||
|
||||
|
||||
void manage_udp_message(uint8_t socket, uint8_t *ip, uint16_t port, uint8_t *buf, uint32_t len);
|
||||
@@ -283,10 +281,8 @@ void GetMacAddr(unsigned char *pMAC);
|
||||
void mStopIfError(u8 iError);
|
||||
|
||||
void net_srv_init(void);
|
||||
#if NET_SSC_ENABLE
|
||||
void WCHNET_CreateTcpMqttSocket(void);
|
||||
void WCHNET_CreateTcpSocket(void);
|
||||
#endif
|
||||
void WCHNET_HandleSockInt(uint8_t socketid, uint8_t intstat);
|
||||
int get_ipstr_to_array(char *src, uint8_t *dst);
|
||||
void WCHNET_HandleGlobalInt(void);
|
||||
|
||||
Reference in New Issue
Block a user