Files
caocong 95916b9995 fix:修改UDP通讯中,取电变化上报机制
1、问题点:当RCU网络状态异常的情况下,网络还处于协商状态下,还未进入正常通讯环节时,取电变化不会进行判断。这会导致取电变化上报与实际产生取电状态时间点对不上。
2、将BLV_C1F_Module代码上传至Gitea,之前代码修改记录请查看 .\BasicCode\Readme.txt
2026-01-23 09:23:12 +08:00

78 lines
2.0 KiB
C
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#ifndef _ALIYUN_H
#define _ALIYUN_H
#include "mqtt.h"
#define ALIYUN_DOMAIN ".iot-as-mqtt.cn-shanghai.aliyuncs.com" //阿里云域名固定后缀
#define ALIYUN_CLIENT_ID "|securemode=3,signmethod=hmacsha1|" //阿里云ClientID固定后缀
#define ALIYUN_CLIENT_ID2 "|securemode=3,signmethod=hmacsha1,timestamp=789|"
#define CLIENT_ID_KEY "clientId"
#define DEVICE_NAME_KEY "deviceName"
#define PRODUCTKEY_KEY "productKey"
#define NET485_PRODUCTKEY "a12hZXRHLLY"
#define NET485_DEVICE_NAME "NET485_1"
#define NET485_DEVICE_SECRET "804be6c043218f8c6a70175278aeca78"
#define NET485_DEVICE2_NAME "NET485_2"
#define NET485_DEVICE2_SECRET "590301f6291563957d96a329df8a6254"
#define NET485_PUBLISH "/a12hZXRHLLY/NET485_1/user/post"
#define NET485_SUBLISH "/a12hZXRHLLY/NET485_1/user/get"
#define NET485_PUBLISH2 "/a12hZXRHLLY/NET485_2/user/post"
#define NET485_SUBLISH2 "/a12hZXRHLLY/NET485_2/user/get"
#define FRG_PRODUCTKEY "a1STn6qUB4r"
#define FRG_DEVICE_NAME "34D0B8108D15"
#define FRG_DEVICE_SECRET "xlRTX2JSU10Bqp9ldgf4gP79euLGVDxT"
#define FRG_PUBLISH_ALIY "user/update"
#define FRG_PUBLISH "/a1STn6qUB4r/34D0B8108D15/user/update"
#define FRG_SUBLISH "/a1STn6qUB4r/34D0B8108D15/user/get"
#define DEF_PRODUCTKEY "a1STn6qUB4r"
#define DEF_ALIY_PUBLISH "user/update"
#define DEF_ALIY_SUBLISH "user/get"
#define DEF_ALIY_KEEPALIVE 120
#pragma pack(1)
typedef struct
{
/*阿里云三要素*/
UINT8 productKey[12]; //productKey
UINT8 deviceName[65]; //设备名
UINT8 deviceSecret[33]; //设备秘钥
UINT8 publish[65]; //阿里云发布地址与MQTT发布订阅地址的区别在于阿里云只需要传地址后缀由程序拼接mqtt需要完整的地址
UINT8 sublish[65]; //阿里云订阅地址
/*MQTT基本参数*/
MQTT_DATA mqtt_data;
}ALIYUN_INFO;
#pragma pack()
UINT8 ALiYun_Machine_Init(MQTT_INFO* Mqtt_info, char* ProductKey, char* deviceName, char* DeviceSecret, char* sublish, int keepAliveInterval);
UINT8 ALIYUN_Flash_Parameter_Init(MQTT_INFO* Mqtt_info);
#endif