mirror of https://github.com/RT-Thread/rt-thread
[sal] add draft for docking winsock
This commit is contained in:
parent
19abf927d2
commit
b793b6427a
|
@ -29,6 +29,11 @@ config RT_USING_DFS_WINSHAREDIR
|
||||||
select RT_USING_POSIX_FS
|
select RT_USING_POSIX_FS
|
||||||
default n
|
default n
|
||||||
|
|
||||||
|
config BSP_USING_SAL_WINSOCK
|
||||||
|
bool "Enable Windows socket (winsock) with SAL"
|
||||||
|
select RT_USING_SAL
|
||||||
|
default n
|
||||||
|
|
||||||
config BSP_USING_LVGL
|
config BSP_USING_LVGL
|
||||||
bool "Enable LVGL for LCD"
|
bool "Enable LVGL for LCD"
|
||||||
select PKG_USING_LVGL
|
select PKG_USING_LVGL
|
||||||
|
|
|
@ -43,14 +43,14 @@ struct timezone
|
||||||
int tz_dsttime; /* type of dst correction */
|
int tz_dsttime; /* type of dst correction */
|
||||||
};
|
};
|
||||||
|
|
||||||
#if !defined(_TIMEVAL_DEFINED)
|
#ifndef _TIMEVAL_DEFINED
|
||||||
#define _TIMEVAL_DEFINED
|
#define _TIMEVAL_DEFINED
|
||||||
struct timeval
|
struct timeval
|
||||||
{
|
{
|
||||||
time_t tv_sec; /* seconds */
|
time_t tv_sec; /* seconds */
|
||||||
suseconds_t tv_usec; /* and microseconds */
|
suseconds_t tv_usec; /* and microseconds */
|
||||||
};
|
};
|
||||||
#endif /* !defined(_TIMEVAL_DEFINED) && !defined(_WIN32) */
|
#endif /* _TIMEVAL_DEFINED */
|
||||||
|
|
||||||
#if defined(__ARMCC_VERSION) || defined(_WIN32) || (defined(__ICCARM__) && (__VER__ < 8010001))
|
#if defined(__ARMCC_VERSION) || defined(_WIN32) || (defined(__ICCARM__) && (__VER__ < 8010001))
|
||||||
struct timespec
|
struct timespec
|
||||||
|
|
|
@ -12,27 +12,28 @@ if RT_USING_SAL
|
||||||
help
|
help
|
||||||
The ability that check internet status is provided by RT-Thread.
|
The ability that check internet status is provided by RT-Thread.
|
||||||
|
|
||||||
if RT_USING_LWIP || AT_USING_SOCKET
|
menu "Docking with protocol stacks"
|
||||||
|
|
||||||
menu "protocol stack implement"
|
config SAL_USING_LWIP
|
||||||
|
bool "Docking with lwIP stack"
|
||||||
|
default y
|
||||||
|
depends on RT_USING_LWIP
|
||||||
|
|
||||||
config SAL_USING_LWIP
|
config SAL_USING_AT
|
||||||
bool "Support lwIP stack"
|
bool "Docking with AT commands stack"
|
||||||
default y
|
default y
|
||||||
depends on RT_USING_LWIP
|
depends on AT_USING_SOCKET
|
||||||
|
|
||||||
config SAL_USING_AT
|
config SAL_USING_WINSOCK
|
||||||
bool "Support AT Commands stack"
|
bool "Docking with Windows socket (winsock)"
|
||||||
default y
|
default y
|
||||||
depends on AT_USING_SOCKET
|
depends on BSP_USING_SAL_WINSOCK
|
||||||
|
|
||||||
config SAL_USING_TLS
|
config SAL_USING_TLS
|
||||||
bool "Support MbedTLS protocol"
|
bool "Docking with MbedTLS protocol"
|
||||||
default y
|
default y
|
||||||
depends on PKG_USING_MBEDTLS
|
depends on PKG_USING_MBEDTLS
|
||||||
endmenu
|
endmenu
|
||||||
|
|
||||||
endif
|
|
||||||
|
|
||||||
config SAL_USING_POSIX
|
config SAL_USING_POSIX
|
||||||
bool
|
bool
|
||||||
|
|
|
@ -11,16 +11,19 @@ CPPPATH = [cwd + '/include']
|
||||||
CPPPATH += [cwd + '/include/socket']
|
CPPPATH += [cwd + '/include/socket']
|
||||||
|
|
||||||
if GetDepend('SAL_USING_LWIP'):
|
if GetDepend('SAL_USING_LWIP'):
|
||||||
src += Glob('impl/af_inet_lwip.c')
|
src += Glob('docking/af_inet_lwip.c')
|
||||||
|
|
||||||
if GetDepend('SAL_USING_AT'):
|
if GetDepend('SAL_USING_AT'):
|
||||||
src += Glob('impl/af_inet_at.c')
|
src += Glob('docking/af_inet_at.c')
|
||||||
|
|
||||||
if GetDepend('SAL_USING_LWIP') or GetDepend('SAL_USING_AT'):
|
if GetDepend('SAL_USING_LWIP') or GetDepend('SAL_USING_AT'):
|
||||||
CPPPATH += [cwd + '/impl']
|
CPPPATH += [cwd + '/docking']
|
||||||
|
|
||||||
|
if GetDepend('SAL_USING_WINSOCK'):
|
||||||
|
src += Glob('docking/af_inet_winsock.c')
|
||||||
|
|
||||||
if GetDepend('SAL_USING_TLS'):
|
if GetDepend('SAL_USING_TLS'):
|
||||||
src += Glob('impl/proto_mbedtls.c')
|
src += Glob('docking/proto_mbedtls.c')
|
||||||
|
|
||||||
if GetDepend('SAL_USING_POSIX'):
|
if GetDepend('SAL_USING_POSIX'):
|
||||||
CPPPATH += [cwd + '/include/dfs_net']
|
CPPPATH += [cwd + '/include/dfs_net']
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2006-2022, RT-Thread Development Team
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
|
*
|
||||||
|
* Change Logs:
|
||||||
|
* Date Author Notes
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <winsock.h>
|
||||||
|
|
||||||
|
/* Do NOT include sys/time.h in this file */
|
Loading…
Reference in New Issue