Support BLE transport in casample program.
authorOssama Othman <ossama.othman@intel.com>
Tue, 19 May 2015 17:07:00 +0000 (10:07 -0700)
committerErich Keane <erich.keane@intel.com>
Wed, 20 May 2015 16:43:09 +0000 (16:43 +0000)
Change-Id: I5a78b5944b9a46a538969265fe9b2edc0e7ac6e1
Signed-off-by: Ossama Othman <ossama.othman@intel.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1039
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: jihwan seo <jihwan.seo@samsung.com>
Reviewed-by: Erich Keane <erich.keane@intel.com>
resource/csdk/connectivity/samples/linux/sample_main.c

index ab6ef93..d7c2354 100644 (file)
@@ -911,8 +911,8 @@ void select_network()
     printf("\n=============================================\n");
     printf("\tselect network\n");
     printf("IPv4 : 0\n");
-    printf("EDR : 2\n");
-    printf("LE : 3\n");
+    printf("EDR  : 2\n");
+    printf("LE   : 3\n");
     printf("select : ");
 
     char buf[MAX_BUF_LEN] = { 0 };
@@ -1053,7 +1053,11 @@ void get_network_info()
         {
             printf("Address: %s\n", tempInfo[index].addressInfo.BT.btMacAddress);
         }
-        printf("Secured: %d\n\n", tempInfo[index].isSecured);
+        else if (CA_LE == tempInfo[index].type)
+        {
+            printf("Address: %s\n", tempInfo[index].addressInfo.LE.leMacAddress);
+        }
+        printf("Secured: %s\n\n", tempInfo[index].isSecured ? "true" : "false");
 
         if (tempInfo[index].isSecured)
         {
@@ -1093,6 +1097,10 @@ void request_handler(const CARemoteEndpoint_t *object, const CARequestInfo_t *re
     {
         printf("Remote Address: %s \n", object->addressInfo.BT.btMacAddress);
     }
+    else if (CA_LE == object->transportType)
+    {
+        printf("Remote Address: %s \n", object->addressInfo.LE.leMacAddress);
+    }
     printf("Data: %s\n", requestInfo->info.payload);
     printf("Message type: %s\n", MESSAGE_TYPE[requestInfo->info.type]);
 
@@ -1167,6 +1175,10 @@ void response_handler(const CARemoteEndpoint_t *object, const CAResponseInfo_t *
     {
         printf("Remote Address: %s \n", object->addressInfo.BT.btMacAddress);
     }
+    else if (CA_LE == object->transportType)
+    {
+        printf("Remote Address: %s \n", object->addressInfo.LE.leMacAddress);
+    }
     printf("response result : %d\n", responseInfo->result);
     printf("Data: %s\n", responseInfo->info.payload);
     printf("Message type: %s\n", MESSAGE_TYPE[responseInfo->info.type]);