Merge pull request #26 from ucloud/bugfix_suit_to_other_c_format

suit to other c format
This commit is contained in:
ethanDu1 2020-04-16 15:46:28 +08:00 committed by GitHub
commit 8832a24b01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -108,6 +108,7 @@ static int _setup_connect_init_params(MQTTInitParams* initParams)
static void mqtt_devmodel_thread(void)
{
int rc;
int i = 0;
MQTTInitParams init_params = DEFAULT_MQTT_INIT_PARAMS;
rc = _setup_connect_init_params(&init_params);
@ -138,7 +139,7 @@ static void mqtt_devmodel_thread(void)
IOT_DM_RegisterCallback(PROPERTY_SET , h_dm, property_set_cb);
IOT_DM_Yield(h_dm, 200);
for (int i = 0; i < 10; i++) {
for (i = 0; i < 10; i++) {
IOT_DM_Property_Report(h_dm, PROPERTY_POST, i * 2, "{\"volume\": {\"Value\":50}}");
IOT_DM_TriggerEvent(h_dm, i * 2 + 1, "low_power_alert", "{\"power\": 5}");

View File

@ -920,7 +920,8 @@ static int _handle_suback_packet(UIoT_Client *pClient, Timer *timer, QoS qos)
int flag_dup = 0, i_free = -1;
for (int j = 0; j < count; j++) {
int j;
for (j = 0; j < count; j++) {
/* In negative case, grantedQoS will be 0xFFFF FF80, which means -128 */
if ((uint8_t)grantedQoS[j] == 0x80) {
sub_nack = true;