引入mqtt 引入cjson

This commit is contained in:
2584532475@qq.com committed 2023-11-30 08:10:01 +08:00
1 parent a69c1a58d6
commit f8591b8b99
86 files changed
+12141 -2157

No files matched your search

+25 -4
View File
@@ -2,19 +2,19 @@
#include <easyflash.h>
#include <stdlib.h>
#include <string.h>
#include "rtthread.h"
// 获取uint32_t 的数值
uint32_t ef_get_integer(const char * key)
{
uint32_t integer = NULL;
char * value_ptr;
char * value_ptr;
/* get the boot count number from Env */
value_ptr = ef_get_env (key);
integer = atol (value_ptr);
integer = atoi (value_ptr);
return integer;
}
@@ -42,3 +42,24 @@ char * ef_get_string(const char * key)
}
// 存储无符号整
void ef_save_uint(const char* key, unsigned int value)
{
char valuebuff[128];
rt_sprintf(valuebuff, "%u", value);
ef_set_env(key, valuebuff);
ef_save_env();
}
// 存储string类型
void ef_save_string(const char* key, char* value, int size)
{
char valuebuff[128];
rt_sprintf(valuebuff, "%*.s", size, value);
//rt_kprintf("%s\r\n",valuebuff);
ef_set_env(key, valuebuff);
ef_save_env();
}