this is fork and i will modify for STM32

Fork of AWS-test by Pierre-Marie Ancèle

Revision:
2:db59f45ad3d3
Parent:
0:cd5404401c2f
--- a/aws-iot/src/aws_iot_mqtt_client_unsubscribe.cpp	Wed Apr 12 14:09:46 2017 +0200
+++ b/aws-iot/src/aws_iot_mqtt_client_unsubscribe.cpp	Fri Aug 04 14:06:06 2017 +0900
@@ -74,7 +74,7 @@
 	}
 
 	rc = aws_iot_mqtt_internal_init_header(&header, UNSUBSCRIBE, QOS1, dup, 0);
-	if(SUCCESS != rc) {
+	if(IOT_SUCCESS != rc) {
 		FUNC_EXIT_RC(rc);
 	}
 	aws_iot_mqtt_internal_write_char(&ptr, header.byte); /* write header */
@@ -89,7 +89,7 @@
 
 	*pSerializedLen = (uint32_t) (ptr - pTxBuf);
 
-	FUNC_EXIT_RC(SUCCESS);
+	FUNC_EXIT_RC(IOT_SUCCESS);
 }
 
 
@@ -108,8 +108,8 @@
 	FUNC_ENTRY;
 
 	rc = aws_iot_mqtt_internal_deserialize_ack(&type, &dup, pPacketId, pRxBuf, rxBufLen);
-	if(SUCCESS == rc && UNSUBACK != type) {
-		rc = FAILURE;
+	if(IOT_SUCCESS == rc && UNSUBACK != type) {
+		rc = IOT_FAILURE;
 	}
 
 	FUNC_EXIT_RC(rc);
@@ -153,7 +153,7 @@
 	}
 
 	if(false == subscriptionExists) {
-		FUNC_EXIT_RC(FAILURE);
+		FUNC_EXIT_RC(IOT_FAILURE);
 	}
 
 	init_timer(&timer);
@@ -162,23 +162,23 @@
 	rc = _aws_iot_mqtt_serialize_unsubscribe(pClient->clientData.writeBuf, pClient->clientData.writeBufSize, 0,
 											 aws_iot_mqtt_get_next_packet_id(pClient), 1, &pTopicFilter,
 											 &topicFilterLen, &serializedLen);
-	if(SUCCESS != rc) {
+	if(IOT_SUCCESS != rc) {
 		FUNC_EXIT_RC(rc);
 	}
 
 	/* send the unsubscribe packet */
 	rc = aws_iot_mqtt_internal_send_packet(pClient, serializedLen, &timer);
-	if(SUCCESS != rc) {
+	if(IOT_SUCCESS != rc) {
 		FUNC_EXIT_RC(rc);
 	}
 
 	rc = aws_iot_mqtt_internal_wait_for_read(pClient, UNSUBACK, &timer);
-	if(SUCCESS != rc) {
+	if(IOT_SUCCESS != rc) {
 		FUNC_EXIT_RC(rc);
 	}
 
 	rc = _aws_iot_mqtt_deserialize_unsuback(&packet_id, pClient->clientData.readBuf, pClient->clientData.readBufSize);
-	if(SUCCESS != rc) {
+	if(IOT_SUCCESS != rc) {
 		FUNC_EXIT_RC(rc);
 	}
 
@@ -192,7 +192,7 @@
 		}
 	}
 
-	FUNC_EXIT_RC(SUCCESS);
+	FUNC_EXIT_RC(IOT_SUCCESS);
 }
 
 /**
@@ -228,7 +228,7 @@
 	}
 
 	rc = aws_iot_mqtt_set_client_state(pClient, clientState, CLIENT_STATE_CONNECTED_UNSUBSCRIBE_IN_PROGRESS);
-	if(SUCCESS != rc) {
+	if(IOT_SUCCESS != rc) {
 		rc = aws_iot_mqtt_set_client_state(pClient, CLIENT_STATE_CONNECTED_UNSUBSCRIBE_IN_PROGRESS, clientState);
 		return rc;
 	}
@@ -236,7 +236,7 @@
 	unsubRc = _aws_iot_mqtt_internal_unsubscribe(pClient, pTopicFilter, topicFilterLen);
 
 	rc = aws_iot_mqtt_set_client_state(pClient, CLIENT_STATE_CONNECTED_UNSUBSCRIBE_IN_PROGRESS, clientState);
-	if(SUCCESS == unsubRc && SUCCESS != rc) {
+	if(IOT_SUCCESS == unsubRc && IOT_SUCCESS != rc) {
 		unsubRc = rc;
 	}