fixed android LE multicast
authorjihwan.seo <jihwan.seo@samsung.com>
Sun, 7 Jun 2015 02:57:41 +0000 (11:57 +0900)
committerErich Keane <erich.keane@intel.com>
Tue, 9 Jun 2015 15:44:16 +0000 (15:44 +0000)
when send is failed in multicast in a device,
multicast routine just return without next step.
next device can be tried send through this fix.

Change-Id: I870c40384ddd5fbe092fdaae0db1ba03b7ccd583
Signed-off-by: jihwan.seo <jihwan.seo@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1210
Reviewed-by: Jaehong Jo <jaehong.jo@samsung.com>
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Erich Keane <erich.keane@intel.com>
resource/csdk/connectivity/src/bt_le_adapter/android/caleclient.c

index 75fddd6..a3a2ccc 100644 (file)
@@ -689,13 +689,12 @@ CAResult_t CALEClientSendMulticastMessageImpl(JNIEnv *env, const char* data,
         goto error_exit;
     }
 
-    uint32_t index = 0;
-    while (index < length)
+    for (uint32_t index = 0; index < length; index++)
     {
         jobject jarrayObj = (jobject) u_arraylist_get(g_deviceList, index);
         if (!jarrayObj)
         {
-            OIC_LOG(ERROR, TAG, "jarrayObj is null");
+            OIC_LOG(ERROR, TAG, "jarrayObj is not available");
             continue;
         }
 
@@ -724,27 +723,25 @@ CAResult_t CALEClientSendMulticastMessageImpl(JNIEnv *env, const char* data,
         if (!jni_address)
         {
             OIC_LOG(ERROR, TAG, "CALEGetAddressFromBTDevice has failed");
-            goto error_exit;
+            continue;
         }
 
         const char* address = (*env)->GetStringUTFChars(env, jni_address, NULL);
         if (!address)
         {
             OIC_LOG(ERROR, TAG, "address is not available");
-            goto error_exit;
+            continue;
         }
 
         res = CALECheckSendState(address);
         if (CA_STATUS_OK != res)
         {
-            OIC_LOG(ERROR, TAG, "send has failed");
+            OIC_LOG_V(INFO, TAG, "multicast : send has failed for this device[%s]", address);
             (*env)->ReleaseStringUTFChars(env, jni_address, address);
-            goto error_exit;
+            continue;
         }
 
         (*env)->ReleaseStringUTFChars(env, jni_address, address);
-
-        index++;
     }
 
     OIC_LOG(DEBUG, TAG, "connection routine is finished");