diff --git a/IDE/MDK5-ARM/Projects/SimpleClient/Abstract.txt b/IDE/MDK5-ARM/Projects/SimpleClient/Abstract.txt index 1a9a172c9..0f0898ceb 100644 --- a/IDE/MDK5-ARM/Projects/SimpleClient/Abstract.txt +++ b/IDE/MDK5-ARM/Projects/SimpleClient/Abstract.txt @@ -1,23 +1,7 @@ -This program is a simple client example with CyaSSL/wolfCrypt library. +wolfSSL example: TLS Client -In order to run this program, -Copy {PACK}\wolfSSL\CyaSSL\{version}\cyassl\certs folder and files to the SD memory. -Set config-SimpleClient.h configuration file for the Callee IP or Port number. +Use Configuration Wizard tab +main.c for remote IP address, port or TLS version +user_settings.h for wolfCrypt or wolfSSL options -For further configuration, refer config-Crypt.h and config-CyaSSL.h. -config-SimpleClient.h is to configure repote callee IP and port. - -When testing this client, it is recommended to test against one of the standard -CyaSSL example applications running on a desktop machine. The standard CyaSSL -example applications are located in the CyaSSL root directory under the -/examples directory. - -For the hardware crypt on config-Crypt.h, download -STSW-STM32062: STM32F2xx standard peripherals library at -http://www.st.com/. Copy Libraries\STM32F2xx_StdPeriph_Driver\{inc,src} to - {PACK}\cyassl\IDE\MDK5-ARM\STM32F2xx_StdPeriph_Lib - - -Support -------- -Please send questions or comments to support@wolfssl.com \ No newline at end of file +For further options, details, see wolfSSL User Manual. diff --git a/IDE/MDK5-ARM/Projects/SimpleClient/SimpleClient.uvoptx b/IDE/MDK5-ARM/Projects/SimpleClient/SimpleClient.uvoptx index 92b94982a..1e0d06b85 100644 --- a/IDE/MDK5-ARM/Projects/SimpleClient/SimpleClient.uvoptx +++ b/IDE/MDK5-ARM/Projects/SimpleClient/SimpleClient.uvoptx @@ -8,7 +8,7 @@ *.c *.s*; *.src; *.a* - *.obj + *.obj; *.o *.lib *.txt; *.h; *.inc *.plm @@ -22,16 +22,16 @@ - STM32F207 Flash + SimpleClient 0x4 ARM-ADS - 12000000 + 25000000 1 1 - 0 - 1 + 1 + 0 0 @@ -45,7 +45,7 @@ 79 66 8 - .\Object\ + .\Output\ 1 @@ -78,23 +78,6 @@ 1 18 - - - 0 - Schematics (MCBSTM32F200) - C:\Keil_v5\ARM\PACK\Keil\STM32F2xx_DFP\2.2.0\MDK/Boards/Keil/MCBSTM32F200/Documentation/mcbstm32f200-schematics.pdf - - - 1 - User Manual (MCBSTM32F200) - C:\Keil_v5\ARM\PACK\Keil\STM32F2xx_DFP\2.2.0\MDK/Boards/Keil/MCBSTM32F200/Documentation/mcbstm32f200.chm - - - 2 - MCBSTM32F200 Evaluation Board Web Page (MCBSTM32F200) - http://www.keil.com/mcbstm32f200/ - - 0 1 @@ -117,7 +100,8 @@ 1 0 0 - 1 + 1 + 5 @@ -127,10 +111,15 @@ - .\STM32_SWO.ini - BIN\UL2CM3.DLL + + STLink\ST-LINKIII-KEIL_SWO.dll + + 0 + ST-LINKIII-KEIL_SWO + -U303030303030303030303031 -O8399 -S0 -C0 -A0 -N00("ARM CoreSight SW-DP") -D00(5BA02477) -L00(0) -TO27 -TC216000000 -TP21 -TDS806B -TDT0 -TDC1F -TIEFFFFFFFF -TIP9 -FO15 -FD20010000 -FC1000 -FN1 -FF0STM32F7x_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F756NGHx$CMSIS\Flash\STM32F7x_1024.FLM) + 0 ARMRTXEVENTFLAGS @@ -139,18 +128,13 @@ 0 DLGTARM - (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0) + (1010=-1,-1,-1,-1,0)(6017=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(6016=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0) 0 ARMDBGFLAGS - - 0 - ULP2CM3 - -UP1135060 -O206 -S8 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO19 -TC120000000 -TP18 -TDX0 -TDD0 -TDS8000 -TDT0 -TDC1F -TIE1 -TIP1 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32F2xx_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F207IG$CMSIS/Flash/STM32F2xx_1024.FLM) - 0 DLGUARM @@ -159,14 +143,46 @@ 0 UL2CM3 - -UM1020ADE -O206 -S8 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO19 -TC120000000 -TP21 -TDS801F -TDT0 -TDC1F -TIE1 -TIP1 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32F2xx_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F207IGHx$CMSIS/Flash/STM32F2xx_1024.FLM) + -UV0998FBE -O207 -S10 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(5BA02477) -L00(0) -TO18 -TC216000000 -TP21 -TDS80B8 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20010000 -FC1000 -FN1 -FF0STM32F7x_1024.FLM -FS08000000 -FL0100000 -FP0($$Device:STM32F756NGHx$CMSIS\Flash\STM32F7x_1024.FLM) 0 0 - 109 + 185 + 1 +
134219474
+ 0 + 0 + 0 + 0 + 0 + 1 + .\main.c + + \\SimpleClient\main.c\185 +
+ + 1 + 0 + 181 + 1 +
134219494
+ 0 + 0 + 0 + 0 + 0 + 1 + .\main.c + + \\SimpleClient\main.c\181 +
+ + 2 + 0 + 306 1
0
0 @@ -180,28 +196,24 @@
- - + + + 0 1 - 8 - port - 0 - - - - - 2 - 8 - 0x8004dc8 - 0 - - + eth_pins + + + + C:\Keil_v5\ARM\PACK\Keil\MDK-Middleware\7.4.1\FileSystem\FileSystem.scvd + Keil.MDK-Middleware.7.4.1 + 1 + 0 0 - 0 + 1 1 0 0 @@ -220,13 +232,26 @@ 0 0 1 - 1 + 0 0 0 0 + 0 + 0 + 0 + + + + + + 1 + 0 + 2 + 2000000 +
@@ -241,7 +266,6 @@ 1 1 0 - 0 0 0 .\main.c @@ -249,16 +273,43 @@ 0 0 + + + + Documentation + 0 + 0 + 0 + 0 - 1 + 2 2 - 1 + 5 0 - 0 0 0 - .\time-CortexM3-4.c - time-CortexM3-4.c + .\Abstract.txt + Abstract.txt + 0 + 0 + + + + + Linker Script + 1 + 0 + 0 + 0 + + 3 + 3 + 5 + 0 + 0 + 0 + .\wolfssl-link.sct + wolfssl-link.sct 0 0 @@ -271,37 +322,10 @@ 0 0 - 2 - 3 - 5 - 0 - 0 - 0 - 0 - .\RTE\wolfSSL\config-Crypt.h - config-Crypt.h - 0 - 0 - - - 2 + 4 4 5 0 - 0 - 0 - 0 - .\RTE\wolfSSL\config-wolfSSL.h - config-wolfSSL.h - 0 - 0 - - - 2 - 5 - 5 - 0 - 0 0 0 .\RTE\wolfSSL\user_settings.h @@ -309,40 +333,14 @@ 0 0 - - 2 - 6 - 5 - 0 - 0 - 0 - 0 - .\config-SimpleClient.h - config-SimpleClient.h - 0 - 0 - - Dcumentation - 1 + ::Board Support + 0 0 0 - 0 - - 3 - 7 - 5 - 0 - 0 - 0 - 0 - .\Abstract.txt - Abstract.txt - 0 - 0 - + 1 @@ -355,7 +353,7 @@ ::CMSIS Driver - 1 + 0 0 0 1 @@ -363,7 +361,7 @@ ::Compiler - 1 + 0 0 0 1 @@ -379,7 +377,7 @@ ::File System - 0 + 1 0 0 1 @@ -387,7 +385,7 @@ ::Network - 1 + 0 0 0 1 diff --git a/IDE/MDK5-ARM/Projects/SimpleClient/config-SimpleClient.h b/IDE/MDK5-ARM/Projects/SimpleClient/config-SimpleClient.h deleted file mode 100644 index c16dd0b42..000000000 --- a/IDE/MDK5-ARM/Projects/SimpleClient/config-SimpleClient.h +++ /dev/null @@ -1,52 +0,0 @@ -/* config-RTX-TCP-FS.h - * - * Copyright (C) 2006-2017 wolfSSL Inc. - * - * This file is part of wolfSSL. - * - * wolfSSL is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * wolfSSL is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA - */ - -// <<< Use Configuration Wizard in Context Menu >>> -// Build Target: Simple Client -// Callee IP Address -// Default: "192.168.1.100" -#define WOLFSSL_CALLEE_IP "192.168.10.8" -// Callee Port Number -// Default: "443" -#define WOLFSSL_CALLEE_PORT "11111" -// HTTP GET Option <0=> HTTP Get <1=> SSL/TLS Message -#define MDK_CONF_HTTP_GET 0 -#if MDK_CONF_HTTP_GET == 0 - #define WOLFSSL_HTTP_GET "-g" - #define WOLFSSL_HTTP_GET_COUNT 1 -#elif MDK_CONF_HTTP_GET == 1 - #define WOLFSSL_HTTP_GET "" - #define WOLFSSL_HTTP_GET_COUNT 0 -#endif -// SSL/TLS Version <0=> SSL3 <1=> TLS 1.0 <2=> TLS 1.1 <3=> TLS 1.2 -#define MDK_CONF_SSL_VERSION 3 -#if MDK_CONF_SSL_VERSION == 0 - #define WOLFSSL_SSL_VER "0" -#elif MDK_CONF_SSL_VERSION == 1 - #define WOLFSSL_SSL_VER "1" -#elif MDK_CONF_SSL_VERSION == 2 - #define WOLFSSL_SSL_VER "2" -#elif MDK_CONF_SSL_VERSION == 3 - #define WOLFSSL_SSL_VER "3" -#endif - -// -// <<< end of configuration section >>> diff --git a/IDE/MDK5-ARM/Projects/SimpleClient/main.c b/IDE/MDK5-ARM/Projects/SimpleClient/main.c index 4374cbf30..06e79ef9f 100644 --- a/IDE/MDK5-ARM/Projects/SimpleClient/main.c +++ b/IDE/MDK5-ARM/Projects/SimpleClient/main.c @@ -23,39 +23,79 @@ #include #endif -#include -#include +#include "wolfssl/wolfcrypt/settings.h" -#include "stm32f2xx_hal.h" -#include "cmsis_os.h" -#include "rl_net.h" -#include +#include "cmsis_os.h" /* CMSIS RTOS definitions */ +#include "rl_net.h" /* Network definitions */ +#include -#include +#include "stm32f7xx_hal.h" + +//-------- <<< Use Configuration Wizard in Context Menu >>> ----------------- + +// Remote Address +// ==================== +// +// IP Address +// Static IPv4 Address +// Default: "192.168.1.1" +#define REMOTE_IP "192.168.1.1" + +// Port +// Default: "11111" +#define REMOTE_PORT "11111" +// + +// Protocol +// ==================== + +// SSL/TLS Version<0=> SSL3 <1=> TLS1.0 <2=> TLS1.1 <3=> TLS1.2 <4=> TLS1.3 +#define TLS_VER 3 + +// Other option +#define OTHER_OPTIONS "" +// + +// RTC: for validate certificate date +// Year <1970-2099> +#define RTC_YEAR 2018 +// Month <1=>Jan<2=>Feb<3=>Mar<4=>Apr<5=>May<6=>Jun<7=>Jul<8=>Aut<9=>Sep<10=>Oct<11=>Nov<12=>Dec +#define RTC_MONTH 1 +// Day <1-31> +#define RTC_DAY 1 +// + +//------------- <<< end of configuration section >>> ----------------------- + +static void SystemClock_Config (void) { + +} + +static void MPU_Config (void) { + +} + +static void CPU_CACHE_Enable (void) { -/*----------------------------------------------------------------------------- - * Initialize Clock Configuration - *----------------------------------------------------------------------------*/ -void SystemClock_Config(void) { - #warning "write MPU specific System Clock Set up\n" } /*----------------------------------------------------------------------------- * Initialize a Flash Memory Card *----------------------------------------------------------------------------*/ #if !defined(NO_FILESYSTEM) -#include "rl_fs.h" +#include "rl_fs.h" /* FileSystem definitions */ + static void init_filesystem (void) { int32_t retv; retv = finit ("M0:"); - if (retv == 0) { + if (retv == fsOK) { retv = fmount ("M0:"); - if (retv == 0) { + if (retv == fsOK) { printf ("Drive M0 ready!\n"); } else { - printf ("Drive M0 mount failed!\n"); + printf ("Drive M0 mount failed(%d)!\n", retv); } } else { @@ -64,6 +104,69 @@ static void init_filesystem (void) { } #endif + +void net_loop(void const *arg) +{ + while(1) { + net_main (); + osThreadYield (); + } +} + +osThreadDef(net_loop, osPriorityNormal, 2, 0); + + +extern uint32_t os_time; +static time_t epoctime = 0; + +#ifdef RTE_CMSIS_RTOS_RTX +uint32_t HAL_GetTick(void) { + return os_time; +} +#endif + +time_t time(time_t *t){ + return epoctime ; +} + +void setTime(time_t t){ + epoctime = t;; +} + +#ifdef WOLFSSL_CURRTIME_OSTICK + +#include +extern uint32_t os_time; + +double current_time(int reset) +{ + if(reset) os_time = 0 ; + return (double)os_time /1000.0; +} + +#else + +#include +#define DWT ((DWT_Type *) (0xE0001000UL) ) +typedef struct +{ + uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */ + uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */ +} DWT_Type; + +extern uint32_t SystemCoreClock ; + +double current_time(int reset) +{ + if(reset) DWT->CYCCNT = 0 ; + return ((double)DWT->CYCCNT/SystemCoreClock) ; +} +#endif + +/*---------------------------------------------------------------------------- + Main Thread 'main': Run Network + *---------------------------------------------------------------------------*/ +#include typedef struct func_args { int argc; char** argv; @@ -71,39 +174,57 @@ typedef struct func_args { extern void client_test(func_args * args) ; -#include "config-SimpleClient.h" int myoptind = 0; char* myoptarg = NULL; -int main() -{ - static char *argv[] = - { "client", "-h", WOLFSSL_CALLEE_IP, "-p", WOLFSSL_CALLEE_PORT, - "-v", WOLFSSL_SSL_VER, WOLFSSL_HTTP_GET } ; - static func_args args = - { 7 + WOLFSSL_HTTP_GET_COUNT, argv } ; +int main (void) { + + struct tm *tm_gm; + time_t now; + static char *argv[] = + { "client", "-h", REMOTE_IP, "-p", REMOTE_PORT, + "-v", " ", OTHER_OPTIONS } ; + static func_args args = + { sizeof(argv)/sizeof(*argv[0]), argv } ; - SystemClock_Config (); + char *verStr[] = { "SSL3", "TLS1.0", "TLS1.1", "TLS1.2", "TLS1.3"}; + #define VERSIZE 2 + char ver[VERSIZE]; + + MPU_Config(); /* Configure the MPU */ + CPU_CACHE_Enable(); /* Enable the CPU Cache */ + + HAL_Init(); /* Initialize the HAL Library */ + SystemClock_Config(); /* Configure the System Clock */ + + setTime((RTC_YEAR-1970)*365*24*60*60 + RTC_MONTH*30*24*60*60 + RTC_DAY*24*60*60); + now = time(NULL); + tm_gm = gmtime(&now); + printf("RTC=%04d/%02d/%02d\n", tm_gm->tm_year + 1900, tm_gm->tm_mon + 1, tm_gm->tm_mday); + #if !defined(NO_FILESYSTEM) init_filesystem (); #endif - netInitialize() ; - osDelay(300) ; - #if defined(DEBUG_WOLFSSL) + net_initialize (); + + #if defined(DEBUG_WOLFSSL) printf("Turning ON Debug message\n") ; wolfSSL_Debugging_ON() ; #endif - if(args.argc == 7) - printf("Simple SSL/TLS, ") ; - else - printf("HTTP GET, ") ; + snprintf(ver, VERSIZE, "%d", TLS_VER); + argv[6] = ver; - printf("Callee IP: %s, Port: %s, Version:%s\n", argv[2], argv[4], argv[6]) ; + printf("SSL/TLS Client(%d)\n ", sizeof(argv)/sizeof(argv[0])) ; + printf(" Remote IP: %s, Port: %s\n Version: %s\n", argv[2], argv[4], verStr[TLS_VER]) ; + printf(" Other options: %s\n", OTHER_OPTIONS); + + osThreadCreate (osThread(net_loop), NULL); + + client_test(&args) ; + + while(1) + osDelay(1000); - while(1) { - client_test(&args) ; - printf("Enter any key to iterate.\n") ; - getchar() ; - } } + diff --git a/IDE/MDK5-ARM/Projects/SimpleClient/simpleClient.uvprojx b/IDE/MDK5-ARM/Projects/SimpleClient/simpleClient.uvprojx deleted file mode 100644 index 3b38ec8d8..000000000 --- a/IDE/MDK5-ARM/Projects/SimpleClient/simpleClient.uvprojx +++ /dev/null @@ -1,955 +0,0 @@ - - - - 2.1 - -
### uVision Project, (C) Keil Software
- - - - STM32F207 Flash - 0x4 - ARM-ADS - - - STM32F207IGHx - STMicroelectronics - Keil.STM32F2xx_DFP.2.2.0 - http://www.keil.com/pack - IROM(0x08000000,0x100000) IRAM(0x20000000,0x20000) CPUTYPE("Cortex-M3") CLOCK(12000000) ELITTLE - - - UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32F2xx_1024 -FS08000000 -FL0100000 -FP0($$Device:STM32F207IGHx$CMSIS/Flash/STM32F2xx_1024.FLM)) - 0 - $$Device:STM32F207IGHx$Drivers/CMSIS/Device/ST/STM32F2xx/Include/stm32f2xx.h - - - - - - - - - - $$Device:STM32F207IGHx$CMSIS\SVD\STM32F20x.svd - 0 - 0 - - - - - - - 0 - 0 - 0 - 0 - 1 - - .\Object\ - EchoClient - 1 - 0 - 0 - 1 - 1 - .\Object\ - 1 - 0 - 0 - - 0 - 0 - - - 0 - 0 - 0 - 0 - - - 0 - 0 - - - 0 - 0 - 0 - 0 - - - 0 - 0 - - - 0 - 0 - - 0 - - - - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 3 - - - 1 - - - SARMCM3.DLL - -REMAP -MPU - DCM.DLL - -pCM3 - SARMCM3.DLL - -MPU - TCM.DLL - -pCM3 - - - - 1 - 0 - 0 - 0 - 16 - - - 0 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 0 - 1 - - - 1 - 1 - 1 - 1 - 1 - 1 - 0 - 1 - 1 - 1 - - 0 - 1 - - - - - - - - - - - - - .\STM32_SWO.ini - BIN\UL2CM3.DLL - - - - - 1 - 0 - 0 - 1 - 1 - 4100 - - 1 - BIN\UL2CM3.DLL - - - - - - 0 - - - - 0 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 0 - 1 - 1 - 0 - 1 - 1 - 0 - 0 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 1 - 0 - 0 - "Cortex-M3" - - 1 - 0 - 0 - 1 - 1 - 0 - 0 - 0 - 0 - 0 - 8 - 0 - 0 - 0 - 3 - 3 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 1 - 0 - 0 - 0 - 0 - 1 - 0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x20000000 - 0x20000 - - - 1 - 0x8000000 - 0x100000 - - - 0 - 0x0 - 0x0 - - - 1 - 0x0 - 0x0 - - - 1 - 0x0 - 0x0 - - - 1 - 0x0 - 0x0 - - - 1 - 0x8000000 - 0x100000 - - - 1 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x0 - 0x0 - - - 0 - 0x20000000 - 0x20000 - - - 0 - 0x0 - 0x0 - - - - - - 1 - 4 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 2 - 0 - 0 - 1 - 0 - - --diag_suppress=1293 - HSE_VALUE=25000000 HAVE_CONFIG_H MDK_CONF_SimpleClient WOLFSSL_USER_SETTINGS - - - - - - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - - - - 1 - 0 - 0 - 0 - 1 - 0 - 0x08000000 - 0x20000000 - - - - - - - - - - - - - Source - - - main.c - 1 - .\main.c - - - time-CortexM3-4.c - 1 - .\time-CortexM3-4.c - - - - - Configuration - - - config-Crypt.h - 5 - .\RTE\wolfSSL\config-Crypt.h - - - config-wolfSSL.h - 5 - .\RTE\wolfSSL\config-wolfSSL.h - - - user_settings.h - 5 - .\RTE\wolfSSL\user_settings.h - - - config-SimpleClient.h - 5 - .\config-SimpleClient.h - - - - - Dcumentation - - - Abstract.txt - 5 - .\Abstract.txt - - - - - ::CMSIS - - - ::CMSIS Driver - - - ::Compiler - - - ::Device - - - ::File System - - - ::Network - - - ::wolfSSL - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - RTE\CMSIS\RTX_Conf_CM.c - - - - - - - - RTE\Device\MK70FN1M0xxx12\startup_MK70F12.s - - - - - - RTE\Device\MK70FN1M0xxx12\system_MK70F12.c - - - - - - RTE\Device\STM32F207IGHx\RTE_Device.h - - - - - - - - RTE\Device\STM32F207IGHx\startup_stm32f207xx.s - - - - - - - - RTE\Device\STM32F207IGHx\stm32f2xx_hal_conf.h - - - - - - - - RTE\Device\STM32F207IGHx\system_stm32f2xx.c - - - - - - - - RTE\Device\STM32F207IG\RTE_Device.h - - - - - - RTE\Device\STM32F207IG\startup_stm32f207xx.s - - - - - - RTE\Device\STM32F207IG\startup_stm32f2xx.s - - - - - - RTE\Device\STM32F207IG\stm32f2xx_hal_conf.h - - - - - - RTE\Device\STM32F207IG\system_stm32f2xx.c - - - - - - RTE\Device\TM4C129ENCPDT\startup_TM4C129.s - - - - - - RTE\Device\TM4C129ENCPDT\system_tm4c129.c - - - - - - RTE\File_System\FS_Config.c - - - - - - - - RTE\File_System\FS_Config_MC_0.h - - - - - - - - RTE\Network\Net_Config.c - - - - - - - - RTE\Network\Net_Config_BSD.h - - - - - - - - RTE\Network\Net_Config_DNS_Client.h - - - - - - - - RTE\Network\Net_Config_ETH_0.h - - - - - - - - RTE\Network\Net_Config_TCP.h - - - - - - - - RTE\Network\Net_Config_UDP.h - - - - - - - - RTE\Network\Net_Debug.c - - - - - - RTE\Other\config-Crypt.h - - - - - - RTE\Other\config-wolfSSL.h - - - - - - RTE\Other\config-RTX-TCP-FS.h - - - - - - RTE\Other\config.h - - - - - - RTE\wolfSSL\config-Crypt.h - - - - - - - - RTE\wolfSSL\config-wolfSSL.h - - - - - - RTE\wolfSSL\config-wolfSSL.h - - - - - - - - RTE\wolfSSL\config.h - - - - - - RTE\wolfSSL\settings.h - - - - - - RTE\wolfSSL\user_settings.h - - - - - - - - - -
diff --git a/examples/client/client.c b/examples/client/client.c index 632c89577..08d093db9 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -24,26 +24,19 @@ #include #endif +#include + #include #if defined(WOLFSSL_MDK_ARM) || defined(WOLFSSL_KEIL_TCP_NET) #include #include - - #if !defined(WOLFSSL_MDK_ARM) - #include "cmsis_os.h" - #include "rl_fs.h" - #include "rl_net.h" - #else - #include "rtl.h" - #include "wolfssl_MDK_ARM.h" - #endif + #include "cmsis_os.h" + #include "rl_fs.h" + #include "rl_net.h" + #include "wolfssl_MDK_ARM.h" #endif -#include - -#include - #include #include @@ -109,8 +102,10 @@ static int NonBlockingSSL_Connect(WOLFSSL* ssl) while (ret != WOLFSSL_SUCCESS && (error == WOLFSSL_ERROR_WANT_READ || error == WOLFSSL_ERROR_WANT_WRITE || error == WC_PENDING_E)) { + #ifdef WOLFSSL_DTLS int currTimeout = 1; - + #endif + if (error == WOLFSSL_ERROR_WANT_READ) printf("... client would read block\n"); else if (error == WOLFSSL_ERROR_WANT_WRITE)