This software setup a central node of a star topology network

Dependencies:   MQTT target_st_bluenrg

Fork of ble-star-mbed by Lorenzo Invidia

Revision:
3:3f35e80ed848
Parent:
2:1525f4848cf2
Child:
4:4af40af2530e
--- a/source/BleMasterService.cpp	Mon Feb 26 12:29:03 2018 +0000
+++ b/source/BleMasterService.cpp	Tue Mar 13 16:31:07 2018 +0000
@@ -502,7 +502,7 @@
         perDevs.connection_handle[index] = handle;
         perDevs.is_disconnected[index] = false;
 
-        printf("\r\n\nConnected to peripheral: [%02x %02x %02x %02x %02x %02x] (%d/%d - 0x%04x) (role: %s)\n",
+        printf("\r\nConnected to peripheral: [%02x %02x %02x %02x %02x %02x] (%d/%d - 0x%04x) (role: %s)\n",
                       tempAddr[5], tempAddr[4], tempAddr[3], tempAddr[2],
                       tempAddr[1], tempAddr[0], index+1, perDevs.connDevices+1, handle, (role == 1 ? "slave" : "master"));
 
@@ -527,9 +527,9 @@
         slaveDev.is_discoverable = false;
 
 
-        printf("\r\n\nConnected to master: [%02x %02x %02x %02x %02x %02x] (role: %s) (adv: %d)\n",
+        printf("\r\nConnected to master: [%02x %02x %02x %02x %02x %02x] (role: %s)\n",
                       tempAddr[5], tempAddr[4], tempAddr[3], tempAddr[2],
-                      tempAddr[1], tempAddr[0], (role == 1 ? "slave" : "master"), ble.gap().getState().advertising);
+                      tempAddr[1], tempAddr[0], (role == 1 ? "slave" : "master"));
 
     }//if-SLAVE
 
@@ -1450,7 +1450,6 @@
             if ((stackBusy == 0) && (writeDescriptorCompleted ==1)){
                 notifyMaster(ATTR_HEAD_LEN+WUP_DATA_LEN, star_attr_value, slave_attr_handle);
             }else {
-                //disableAllNotifications();
                 return; 
             }
              
@@ -1484,7 +1483,6 @@
             if ((stackBusy == 0) && (writeDescriptorCompleted ==1)){
                 notifyMaster(ATTR_HEAD_LEN+MIC_DATA_LEN, star_attr_value, slave_attr_handle);
             }else {
-                //disableAllNotifications();
                 return; 
             }
         }
@@ -1511,7 +1509,6 @@
             if ((stackBusy == 0) && (writeDescriptorCompleted ==1)){
                 notifyMaster(ATTR_HEAD_LEN+PRX_DATA_LEN, star_attr_value, slave_attr_handle);
             }else {
-                //disableAllNotifications();
                 return; 
             }
         }
@@ -1558,7 +1555,6 @@
             if ((stackBusy == 0) && (writeDescriptorCompleted ==1)){
                 notifyMaster(ATTR_HEAD_LEN+data_len, star_attr_value, slave_attr_handle);
             }else {
-                //disableAllNotifications();
                 return; 
             }
 
@@ -1593,7 +1589,6 @@
             if ((stackBusy == 0) && (writeDescriptorCompleted ==1)){
                 notifyMaster(ATTR_HEAD_LEN+SFUSION_DATA_LEN, star_attr_value, slave_attr_handle);
             }else {
-                //disableAllNotifications();
                 return; 
             }
             perDevs.sfusion_char_read[index] = 1;
@@ -1633,7 +1628,6 @@
                 notifyMaster(ATTR_HEAD_LEN+PRESS_DATA_LEN+(3*TYPE_ID_LEN)+HUM_DATA_LEN+(2*TEMP_DATA_LEN),
                         star_attr_value, slave_attr_handle);
             }else {
-                //disableAllNotifications();
                 return; 
             }
         }
@@ -1662,7 +1656,6 @@
             if ((stackBusy == 0) && (writeDescriptorCompleted ==1)){
                 notifyMaster(ATTR_HEAD_LEN+LED_DATA_LEN, star_attr_value, slave_attr_handle);
             }else {
-                //disableAllNotifications();
                 return; 
             }
         }
@@ -1688,7 +1681,6 @@
             if ((stackBusy == 0) && (writeDescriptorCompleted ==1)){
                 notifyMaster(ATTR_HEAD_LEN+LUX_DATA_LEN, star_attr_value, slave_attr_handle);
             }else {
-                //disableAllNotifications();
                 return; 
             }
         }