资源简介
改进STM32网络通信实验,加入看门狗,支持Client端和Server端网线断开后重连功能。保证Client端和Server端重连功能
代码片段和文件信息
/*
Copyright (c) 2009 Dave Gamble
Permission is hereby granted free of charge to any person obtaining a copy
of this software and associated documentation files (the “Software“) to deal
in the Software without restriction including without limitation the rights
to use copy modify merge publish distribute sublicense and/or sell
copies of the Software and to permit persons to whom the Software is
furnished to do so subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS“ WITHOUT WARRANTY OF ANY KIND EXPRESS OR
IMPLIED INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM DAMAGES OR OTHER
LIABILITY WHETHER IN AN ACTION OF CONTRACT TORT OR OTHERWISE ARISING FROM
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
/* cJSON */
/* JSON parser in C. */
#include
#include
#include
#include
#include
#include
#include
#include “cJSON.h“
#include “malloc.h“
static const char *ep;
const char *cJSON_GetErrorPtr(void) {return ep;}
static int cJSON_strcasecmp(const char *s1const char *s2)
{
if (!s1) return (s1==s2)?0:1;if (!s2) return 1;
for(; tolower(*s1) == tolower(*s2); ++s1 ++s2) if(*s1 == 0) return 0;
return tolower(*(const unsigned char *)s1) - tolower(*(const unsigned char *)s2);
}
static void *(*cJSON_malloc)(size_t sz) = my_malloc;
static void (*cJSON_free)(void *ptr) = my_free;
static char* cJSON_strdup(const char* str)
{
size_t len;
char* copy;
len = strlen(str) + 1;
if (!(copy = (char*)cJSON_malloc(len))) return 0;
memcpy(copystrlen);
return copy;
}
void cJSON_InitHooks(cJSON_Hooks* hooks)
{
if (!hooks) { /* Reset hooks */
cJSON_malloc = my_malloc;
cJSON_free = my_free;
return;
}
cJSON_malloc = (hooks->malloc_fn)?hooks->malloc_fn:my_malloc;
cJSON_free = (hooks->free_fn)?hooks->free_fn:my_free;
}
/* Internal constructor. */
static cJSON *cJSON_New_Item(void)
{
cJSON* node = (cJSON*)cJSON_malloc(sizeof(cJSON));
if (node) memset(node0sizeof(cJSON));
return node;
}
/* Delete a cJSON structure. */
void cJSON_Delete(cJSON *c)
{
cJSON *next;
while (c)
{
next=c->next;
if (!(c->type&cJSON_IsReference) && c->child) cJSON_Delete(c->child);
if (!(c->type&cJSON_IsReference) && c->valuestring) cJSON_free(c->valuestring);
if (c->string) cJSON_free(c->string);
cJSON_free(c);
c=next;
}
}
/* Parse the input text to generate a number and populate the result into item. */
static const char *parse_number(cJSON *itemconst char
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 2425 2016-02-20 13:11 fs\404.html
文件 25477 2016-02-20 12:41 fs\image\head.jpg
文件 48415 2016-06-23 17:36 fs\image\stm32.jpg
文件 1379 2015-03-15 20:46 fs\image\tab.jpg
文件 5368 2016-09-07 12:49 fs\index.html
文件 2901 2016-02-20 13:14 fs\STM32_ADC_TEMPERATE.shtml
文件 3539 2016-02-20 13:13 fs\STM32_LED_OFF_BEEP_OFF.shtml
文件 3544 2016-02-20 13:14 fs\STM32_LED_OFF_BEEP_ON.shtml
文件 3543 2016-02-20 13:14 fs\STM32_LED_ON_BEEP_OFF.shtml
文件 3541 2016-02-20 13:15 fs\STM32_LED_ON_BEEP_ON.shtml
文件 2861 2016-02-20 13:15 fs\STM32_RTC.shtml
目录 0 2016-09-07 19:12 fs\image
目录 0 2016-09-07 19:12 fs
----------- --------- ---------- ----- ----
102993 13
相关资源
- hal库定时器触发adc dma采集
- 基于STM32的嵌入式web服务器的设计
- TLE5012B基于STM32F103 SPI接口的驱动程序
- Huawei LiteOS for STM32F407.zip
- STM32 OTG IP介绍上OTG_FS_HS模块.pdf
- 基于STM32智能骑行头盔的设计.pdf
- STM32F103C8T6(加了蓝牙).zip
- UART_Printf.7z
- GP2D12红外测距传感器使用介绍.rar
- STM32 12864程序
- MPU9250驱动代码
- STM32 adc采集数据存到SD卡中
- STM32静态扭矩传感器源码
- 利用STM32F103驱动HC-SR04超声波模块
- TIM+DAC+DMA输出任意波形
- STM32和CC2530串口通信
- STM32_SD_FATFS文件系统学习资料
- STM32 BLDC开发资料
- RTT-Mini-context_switch.rar
- FPC1020AM.7z
- stm32F4系列实现USB UVC免驱摄像头
- stm32串口1串口2 DMA方式收发数据
- STM32 BLDC直流无刷电机开发板驱动板配
- stm32f103VET6-FreeRTOS-enc28j60-Lwip
- 基于STM32俄罗斯方块源代码
- MPU6050姿态解算STM32源码(互补滤波、
- Keil4.5-STM32-IAP源码及485半双工IAP电路
- 基于STM32的太阳能供电智能花盆
- STM32接入机智云工具包
- STM32光敏传感器
评论
共有 条评论