Skip to content

Commit

Permalink
Merge pull request #268 from lealem47/sn-error-code
Browse files Browse the repository at this point in the history
Return correct error code in SN_Client_Connect
  • Loading branch information
embhorn authored Jan 7, 2022
2 parents 0750696 + 530d3e0 commit f51d59f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions examples/sn-client/sn-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,15 @@ int sn_test(MQTTCtx *mqttCtx)
/* Send Connect and wait for Connect Ack */
rc = SN_Client_Connect(&mqttCtx->client, connect);

if (rc != MQTT_CODE_SUCCESS) {
PRINTF("MQTT-SN Connect: %s (%d)",
MqttClient_ReturnCodeToString(rc), rc);
goto disconn;
}

/* Validate Connect Ack info */
PRINTF("....MQTT-SN Connect Ack: Return Code %u",
connect->ack.return_code);
if (rc != MQTT_CODE_SUCCESS) {
goto disconn;
}
}

/* Either the register or the subscribe block could be used to get the
Expand Down

0 comments on commit f51d59f

Please sign in to comment.