mirror of
https://github.com/espressif/ESP8266_RTOS_SDK.git
synced 2025-05-24 10:38:01 +08:00
feat(lwip): Add socket UDP sync function
This commit is contained in:
@ -52,6 +52,10 @@
|
||||
|
||||
#define ESP_LWIP 1
|
||||
|
||||
#ifdef CONFIG_ESP_UDP_SYNC_SEND
|
||||
#define ESP_UDP 1
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_LWIP_SOCKET_MULTITHREAD
|
||||
#define SOCKETS_MT
|
||||
#endif
|
||||
@ -2213,4 +2217,12 @@ void *memp_malloc_ll(size_t type);
|
||||
* @}
|
||||
*/
|
||||
|
||||
#if ESP_UDP
|
||||
#if !LWIP_UDP || !LWIP_SOCKET || !ESP_LWIP
|
||||
#error "LWIP_UDP & LWIP_SOCKET & ESP_LWIP must be enable"
|
||||
#else
|
||||
#include "udp_sync.h"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* __LWIP_HDR_LWIPOPTS_H__ */
|
||||
|
59
components/lwip/port/esp8266/include/udp_sync.h
Normal file
59
components/lwip/port/esp8266/include/udp_sync.h
Normal file
@ -0,0 +1,59 @@
|
||||
// Copyright 2018-2019 Espressif Systems (Shanghai) PTE LTD
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#ifndef _UDP_SYNC_H
|
||||
#define _UDP_SYNC_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* @brief initialize UDP sync module
|
||||
*/
|
||||
void udp_sync_init(void);
|
||||
|
||||
/*
|
||||
* @brief register a UDP API message(struct api_msg) to module
|
||||
*
|
||||
* @param in_msg message pointer
|
||||
*/
|
||||
void udp_sync_regitser(void *in_msg);
|
||||
|
||||
/*
|
||||
* @brief ack the message
|
||||
*
|
||||
* @param in_msg message pointer
|
||||
*/
|
||||
void udp_sync_ack(void *in_msg);
|
||||
|
||||
/*
|
||||
* @brief set the current message send result
|
||||
*
|
||||
* @param ret current message send result
|
||||
*/
|
||||
void udp_sync_set_ret(int ret);
|
||||
|
||||
/*
|
||||
* @brief process the sync
|
||||
*
|
||||
* @param ret current message send result
|
||||
*/
|
||||
void udp_sync_proc(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _UDP_SYNC_H */
|
Reference in New Issue
Block a user