Fix typo for bearpi_hm_nano

Signed-off-by: Neil Chen <jingsi.chen@petalmail.com>
This commit is contained in:
Neil Chen
2022-06-17 20:47:50 +08:00
parent 35810b5299
commit 960ac691d0
22 changed files with 63 additions and 63 deletions
+16 -16
View File
@@ -162,20 +162,20 @@ void MutexExample(void)
示例代码编译烧录后,按下开发板的RESET按键,通过串口助手查看日志,中优先级任务一直正常运行,而高优先级和低优先级的任务因为互相抢占互斥锁,交替运行。
```sh
LowPrioThread is runing.
MidPrioThread is runing.
MidPrioThread is runing.
MidPrioThread is runing.
HighPrioThread is runing.
MidPrioThread is runing.
MidPrioThread is runing.
MidPrioThread is runing.
LowPrioThread is runing.
MidPrioThread is runing.
MidPrioThread is runing.
MidPrioThread is runing.
HighPrioThread is runing.
MidPrioThread is runing.
MidPrioThread is runing.
MidPrioThread is runing
LowPrioThread is running.
MidPrioThread is running.
MidPrioThread is running.
MidPrioThread is running.
HighPrioThread is running.
MidPrioThread is running.
MidPrioThread is running.
MidPrioThread is running.
LowPrioThread is running.
MidPrioThread is running.
MidPrioThread is running.
MidPrioThread is running.
HighPrioThread is running.
MidPrioThread is running.
MidPrioThread is running.
MidPrioThread is running
```
@@ -48,7 +48,7 @@ typedef enum {
NDEFLastPos
} RecordPosEnu;
/*
* This strucure is used in the ADD record functionality
* This structure is used in the ADD record functionality
* to store the last nfc page information, in order to continue from that point.
*/
typedef struct {
@@ -247,7 +247,7 @@ int E53IA1ReadData(E53IA1Data *ReadData)
data[DATA_CHECK] = SHT3X_Data_Buffer[TEMP_HSB];
tmp = SHT3xCheckCrc(data, SHT30_TEMP_DATA_LEN, data[DATA_CHECK]);
/* value is ture */
/* value is true */
if (!tmp) {
dat = ((uint16_t)data[0] << DATA_WIDTH_8_BIT) | data[1];
ReadData->Temperature = SHT3xCalcTemperatureC(dat);
@@ -257,7 +257,7 @@ int E53IA1ReadData(E53IA1Data *ReadData)
data[DATA_LSB] = SHT3X_Data_Buffer[HUM_LSB];
data[DATA_MSB] = SHT3X_Data_Buffer[HUM_MSB];
data[DATA_CHECK] = SHT3X_Data_Buffer[HUM_HSB];
/* value is ture */
/* value is true */
tmp = SHT3xCheckCrc(data, SHT30_HUM_DATA_LEN, data[DATA_CHECK]);
if (!tmp) {
dat = ((uint16_t)data[0] << DATA_WIDTH_8_BIT) | data[1];
@@ -33,11 +33,11 @@
ret = oc_mqtt_profile_connect(&connect_para);
if((ret == (int)en_oc_mqtt_err_ok)){
g_app_cb.connected = 1;
printf("oc_mqtt_profile_connect succed!\r\n");
printf("oc_mqtt_profile_connect succeed!\r\n");
}
else
{
printf("oc_mqtt_profile_connect faild!\r\n");
printf("oc_mqtt_profile_connect failed!\r\n");
}
```
@@ -125,9 +125,9 @@ static int CloudMainTaskEntry(void)
ret = oc_mqtt_profile_connect(&connect_para);
if ((ret == (int)en_oc_mqtt_err_ok)) {
g_app_cb.connected = 1;
printf("oc_mqtt_profile_connect succed!\r\n");
printf("oc_mqtt_profile_connect succeed!\r\n");
} else {
printf("oc_mqtt_profile_connect faild!\r\n");
printf("oc_mqtt_profile_connect failed!\r\n");
}
E53IS1Init();
@@ -173,4 +173,4 @@ static void IotMainTaskEntry(void)
}
}
APP_FEATURE_INIT(IotMainTaskEntry);
APP_FEATURE_INIT(IotMainTaskEntry);
@@ -34,11 +34,11 @@
ret = oc_mqtt_profile_connect(&connect_para);
if((ret == (int)en_oc_mqtt_err_ok)){
g_app_cb.connected = 1;
printf("oc_mqtt_profile_connect succed!\r\n");
printf("oc_mqtt_profile_connect succeed!\r\n");
}
else
{
printf("oc_mqtt_profile_connect faild!\r\n");
printf("oc_mqtt_profile_connect failed!\r\n");
}
```
@@ -339,4 +339,4 @@ static void deal_motor_cmd(cmd_t *cmd, cJSON *obj_root)
![](../../docs/figures/D11_iot_cloud_oc_agriculture/查看设备信息.png "查看设备信息")
在华为云平台设备详情页,单击“命令”,选择同步命令下发,选中创建的命令属性,单击“确定”,即可发送下发命令控制设备,如下图所示。
![](../../docs/figures/D11_iot_cloud_oc_agriculture/命令下发.png "命令下发")
![](../../docs/figures/D11_iot_cloud_oc_agriculture/命令下发.png "命令下发")
@@ -299,9 +299,9 @@ static int CloudMainTaskEntry(void)
ret = oc_mqtt_profile_connect(&connect_para);
if ((ret == (int)en_oc_mqtt_err_ok)) {
g_app_cb.connected = 1;
printf("oc_mqtt_profile_connect succed!\r\n");
printf("oc_mqtt_profile_connect succeed!\r\n");
} else {
printf("oc_mqtt_profile_connect faild!\r\n");
printf("oc_mqtt_profile_connect failed!\r\n");
}
while (1) {
@@ -380,4 +380,4 @@ static void IotMainTaskEntry(void)
}
}
APP_FEATURE_INIT(IotMainTaskEntry);
APP_FEATURE_INIT(IotMainTaskEntry);
@@ -247,7 +247,7 @@ int E53IA1ReadData(E53IA1Data *ReadData)
data[DATA_CHECK] = SHT3X_Data_Buffer[TEMP_HSB];
tmp = SHT3xCheckCrc(data, SHT30_TEMP_DATA_LEN, data[DATA_CHECK]);
/* value is ture */
/* value is true */
if (!tmp) {
dat = ((uint16_t)data[0] << DATA_WIDTH_8_BIT) | data[1];
ReadData->Temperature = SHT3xCalcTemperatureC(dat);
@@ -257,7 +257,7 @@ int E53IA1ReadData(E53IA1Data *ReadData)
data[DATA_LSB] = SHT3X_Data_Buffer[HUM_LSB];
data[DATA_MSB] = SHT3X_Data_Buffer[HUM_MSB];
data[DATA_CHECK] = SHT3X_Data_Buffer[HUM_HSB];
/* value is ture */
/* value is true */
tmp = SHT3xCheckCrc(data, SHT30_HUM_DATA_LEN, data[DATA_CHECK]);
if (!tmp) {
dat = ((uint16_t)data[0] << DATA_WIDTH_8_BIT) | data[1];
@@ -35,11 +35,11 @@
ret = oc_mqtt_profile_connect(&connect_para);
if((ret == (int)en_oc_mqtt_err_ok)){
g_app_cb.connected = 1;
printf("oc_mqtt_profile_connect succed!\r\n");
printf("oc_mqtt_profile_connect succeed!\r\n");
}
else
{
printf("oc_mqtt_profile_connect faild!\r\n");
printf("oc_mqtt_profile_connect failed!\r\n");
}
```
@@ -239,9 +239,9 @@ static int CloudMainTaskEntry(void)
ret = oc_mqtt_profile_connect(&connect_para);
if ((ret == (int)en_oc_mqtt_err_ok)) {
g_app_cb.connected = 1;
printf("oc_mqtt_profile_connect succed!\r\n");
printf("oc_mqtt_profile_connect succeed!\r\n");
} else {
printf("oc_mqtt_profile_connect faild!\r\n");
printf("oc_mqtt_profile_connect failed!\r\n");
}
while (1) {
app_msg = NULL;
@@ -311,4 +311,4 @@ static void IotMainTaskEntry(void)
}
}
APP_FEATURE_INIT(IotMainTaskEntry);
APP_FEATURE_INIT(IotMainTaskEntry);
@@ -14,7 +14,7 @@ sock_fd = socket(AF_INET, SOCK_DGRAM, 0)) //AF_INT:ipv4, SOCK_DGRAM:udp协议
在网络编程中所需要进行的第一件事情就是创建一个socket,无论是客户端还是服务器端,都需要创建一个socket,该函数返回socket文件描述符,类似于文件描述符。socket是一个结构体,被创建在内核中。
### sendto()
```c
int sendto(socket s, const void *msg, int len, unsigned int flags, const struct sockaddr *to , int tolen);
int sendto(socket s, const void *msg, int len, unsigned int flags, const struct sockaddr *to , int token);
```
**描述:**
@@ -125,4 +125,4 @@ static void UDPClientTask(void)
192.168.0.175:8888=>Hello! BearPi-HM_nano UDP Client!
```
![UDP发送数据](../../docs/figures/D3_iot_udp_client/UDP发送数据.png)
![UDP发送数据](../../docs/figures/D3_iot_udp_client/UDP发送数据.png)
@@ -52,9 +52,9 @@
///< UP means the device send data to the cloud
typedef enum {
EN_OC_MQTT_PROFILE_MSG_TYPE_UP_MSGUP = 0, ///< DEVICE REPORT MESSAG DIRECTLY
EN_OC_MQTT_PROFILE_MSG_TYPE_UP_MSGUP = 0, ///< DEVICE REPORT MESSAGE DIRECTLY
EN_OC_MQTT_PROFILE_MSG_TYPE_UP_PROPERTYREPORT, ///< DEVICE REPORT PROPERTY
EN_OC_MQTT_PROFILE_MSG_TYPE_UP_SUBPROPERTYREPORT, ///< GATWAY REPORT SUBDEVICEPROPERTY
EN_OC_MQTT_PROFILE_MSG_TYPE_UP_SUBPROPERTYREPORT, ///< GATEWAY REPORT SUBDEVICEPROPERTY
EN_OC_MQTT_PROFILE_MSG_TYPE_UP_PROPERTYSETRESPONSE, ///< RESPONSE TO THE PROPERTY SET
EN_OC_MQTT_PROFILE_MSG_TYPE_UP_PROPERTYGETRESPONSE, ///< RESPONSE TO THE PROPERTY GET
EN_OC_MQTT_PROFILE_MSG_TYPE_UP_CMDRESPONSE, ///< RESPONSE TO THE COMMAND
@@ -246,7 +246,7 @@ int E53IA1ReadData(E53IA1Data *ReadData)
data[DATA_CHECK] = SHT3X_Data_Buffer[TEMP_HSB];
tmp = SHT3xCheckCrc(data, SHT30_TEMP_DATA_LEN, data[DATA_CHECK]);
/* value is ture */
/* value is true */
if (!tmp) {
dat = ((uint16_t)data[0] << DATA_WIDTH_8_BIT) | data[1];
ReadData->Temperature = SHT3xCalcTemperatureC(dat);
@@ -256,7 +256,7 @@ int E53IA1ReadData(E53IA1Data *ReadData)
data[DATA_LSB] = SHT3X_Data_Buffer[HUM_LSB];
data[DATA_MSB] = SHT3X_Data_Buffer[HUM_MSB];
data[DATA_CHECK] = SHT3X_Data_Buffer[HUM_HSB];
/* value is ture */
/* value is true */
tmp = SHT3xCheckCrc(data, SHT30_HUM_DATA_LEN, data[DATA_CHECK]);
if (!tmp) {
dat = ((uint16_t)data[0] << DATA_WIDTH_8_BIT) | data[1];
@@ -231,7 +231,7 @@ static char *topic_make(char *fmt, char *device_id, char *request_id)
return ret;
}
///< use this function to report the messsage
///< use this function to report the message
#define CN_OC_MQTT_PROFILE_MSGUP_TOPICFMT "$oc/devices/%s/sys/messages/up"
int oc_mqtt_profile_msgup(char *deviceid, oc_mqtt_profile_msgup_t *payload)
{
@@ -36,11 +36,11 @@
ret = oc_mqtt_profile_connect(&connect_para);
if((ret == (int)en_oc_mqtt_err_ok)){
g_app_cb.connected = 1;
printf("oc_mqtt_profile_connect succed!\r\n");
printf("oc_mqtt_profile_connect succeed!\r\n");
}
else
{
printf("oc_mqtt_profile_connect faild!\r\n");
printf("oc_mqtt_profile_connect failed!\r\n");
}
```
@@ -233,9 +233,9 @@ static int CloudMainTaskEntry(void)
ret = oc_mqtt_profile_connect(&connect_para);
if ((ret == (int)en_oc_mqtt_err_ok)) {
g_app_cb.connected = 1;
printf("oc_mqtt_profile_connect succed!\r\n");
printf("oc_mqtt_profile_connect succeed!\r\n");
} else {
printf("oc_mqtt_profile_connect faild!\r\n");
printf("oc_mqtt_profile_connect failed!\r\n");
}
while (1) {
app_msg = NULL;
@@ -309,4 +309,4 @@ static void IotMainTaskEntry(void)
}
}
APP_FEATURE_INIT(IotMainTaskEntry);
APP_FEATURE_INIT(IotMainTaskEntry);
@@ -33,11 +33,11 @@
ret = oc_mqtt_profile_connect(&connect_para);
if((ret == (int)en_oc_mqtt_err_ok)){
g_app_cb.connected = 1;
printf("oc_mqtt_profile_connect succed!\r\n");
printf("oc_mqtt_profile_connect succeed!\r\n");
}
else
{
printf("oc_mqtt_profile_connect faild!\r\n");
printf("oc_mqtt_profile_connect failed!\r\n");
}
```
@@ -231,9 +231,9 @@ static int CloudMainTaskEntry(void)
ret = oc_mqtt_profile_connect(&connect_para);
if ((ret == (int)en_oc_mqtt_err_ok)) {
g_app_cb.connected = 1;
printf("oc_mqtt_profile_connect succed!\r\n");
printf("oc_mqtt_profile_connect succeed!\r\n");
} else {
printf("oc_mqtt_profile_connect faild!\r\n");
printf("oc_mqtt_profile_connect failed!\r\n");
}
while (1) {
@@ -311,4 +311,4 @@ static void IotMainTaskEntry(void)
}
}
APP_FEATURE_INIT(IotMainTaskEntry);
APP_FEATURE_INIT(IotMainTaskEntry);
@@ -33,11 +33,11 @@
ret = oc_mqtt_profile_connect(&connect_para);
if((ret == (int)en_oc_mqtt_err_ok)){
g_app_cb.connected = 1;
printf("oc_mqtt_profile_connect succed!\r\n");
printf("oc_mqtt_profile_connect succeed!\r\n");
}
else
{
printf("oc_mqtt_profile_connect faild!\r\n");
printf("oc_mqtt_profile_connect failed!\r\n");
}
```
@@ -159,9 +159,9 @@ static int CloudMainTaskEntry(void)
ret = oc_mqtt_profile_connect(&connect_para);
if ((ret == (int)en_oc_mqtt_err_ok)) {
g_app_cb.connected = 1;
printf("oc_mqtt_profile_connect succed!\r\n");
printf("oc_mqtt_profile_connect succeed!\r\n");
} else {
printf("oc_mqtt_profile_connect faild!\r\n");
printf("oc_mqtt_profile_connect failed!\r\n");
}
while (1) {
@@ -260,4 +260,4 @@ static void IotMainTaskEntry(void)
}
}
APP_FEATURE_INIT(IotMainTaskEntry);
APP_FEATURE_INIT(IotMainTaskEntry);
+2 -2
View File
@@ -112,7 +112,7 @@ LOSCFG_RAM_MONITOR=n
LOSCFG_DRIVERS_UART=y
# LOSCFG_PLATFORM_UART_WITHOUT_VFS is not set
LOSCFG_PLATFORM_OSAPPINIT=y
#close printf for all moudle if controlled by
#close printf for all modules if controlled by
LOSCFG_DEBUG_CLOSE_PRINT=y
#
@@ -126,6 +126,6 @@ LOSCFG_PERSISTENT_STORAGE=y
# LOSCFG_TEST_NET is not set
# data aquire
# data acquire
LOSCFG_DAQ = n
CONFIG_DIAG_SUPPORT_AUTO_LINK=n
+2 -2
View File
@@ -70,7 +70,7 @@ typedef enum {
en_mqtt_al_version_3_1_1,
}en_mqtt_al_verison;
/** @brief defines the paramter for the mqtt connect */
/** @brief defines the parameter for the mqtt connect */
typedef struct {
mqtt_al_string_t serveraddr; ///< mqtt server:support domain name and dot format
int serverport; ///< mqtt server port
@@ -148,7 +148,7 @@ typedef enum {
/**
* @brief defines the operation will be registered to the mqtt service
* @brief parameter and return code refere to the corresponding api
* @brief parameter and return code reference to the corresponding api
*
*/
typedef struct {