|
|
@@ -25,10 +25,10 @@ static uint8_t connectID = 2;
|
|
|
// 注册参数
|
|
|
static struct TUORENIOT_RegistRequestStruct regist_request = {
|
|
|
.version = 1,
|
|
|
- .platform = "aliyun",
|
|
|
- .networkProtocol = "CoAP",
|
|
|
+ .networkType = 1,
|
|
|
+ .networkProtocol = 1,
|
|
|
.deviceId = "3431228A1936013C",
|
|
|
- .userId = 4562
|
|
|
+ .userId = "1000"
|
|
|
};
|
|
|
|
|
|
// dns
|
|
|
@@ -45,8 +45,8 @@ void TUORENIOT_PackRegistRequest(uint8_t * pack_data, uint16_t * pack_data_lengt
|
|
|
Log_Printf_Debug("mcu_id: %s\r\n", mcu_id);
|
|
|
byteToHexStr(mcu_id, registParams->deviceId, sizeof(mcu_id));
|
|
|
|
|
|
- sprintf((char *)(pack_data + 2), "{\"platform\":\"%s\",\"connectionType\":\"%s\",\"deviceId\":\"%s\"}",
|
|
|
- registParams->platform, registParams->networkProtocol, registParams->deviceId); // 拼接AT指令
|
|
|
+ sprintf((char *)(pack_data + 2), "{\"version\":\"%d\",\"networkType\":\"%d\",\"networkProtocol\":\"%d\",\"productId\":\"%s\",\"deviceId\":\"%s\",\"userId\":\"%s\"}",
|
|
|
+ registParams->version, registParams->networkType, registParams->networkProtocol, registParams->productId, registParams->deviceId, registParams->userId); // 拼接AT指令
|
|
|
Log_Printf_Debug("%s\r\n", (char *)(pack_data + 2));
|
|
|
|
|
|
uint16_t datalen = utils_aes128_ECB_base64_enc_with_length(regist_key, (pack_data + 2));
|