 
   if ( !BTconnected ) {
     print_state("");
-    Serial.printf("dataTransferBLE(), wait 40 s for BLE connect (protocolType = %d) ...", protocolType);
-  }
-  for (int i = 0; i < 40; i++) {
+    Serial.printf("dataTransferBLE(), wait 100 s for BLE connect (protocolType = %d) ...", protocolType);
+  }
+  for (int i = 0; i < 100; i++) {
     if (BTconnected) {
-      if (protocolType == 1)      
+      if (protocolType == 1) {
         sendToXdripViaBLE();
+      }
       else {
         print_state("");
         Serial.printf(" *** wrong protocol type %d", protocolType);

        }
      }
    }
    // when it was 0 incremnt read counter
    else {
      print_state("do not send 0, increment read pointer instead, simulate ACK");
      got_ack = 1;
    }

    if (got_ack) {
      Serial.printf(" - got ack (read %d, write %d), inc read to ", Pkts.read, Pkts.write);
      if ( ++Pkts.read >= DXQUEUESIZE )
        Pkts.read = 0;     //increment read position since we got an ack for the last package
      Serial.print(Pkts.read);
      Serial.print(" - ");
      resend_pkt = 0;
    }
    else {
      if ( !resend_pkt ) {
        print_state("no ack received, try again");
        resend_pkt = 1;
      }
      else {
        print_state("no ack received, try again next wakeup");
        resend_pkt = 0;
        break;
      }
    }
  } /* while (send all packets available) */

  // transfer the sensor livetime with the last successful tranmitted BG reading
  // currently not supported as an wixel device
  if ( 0 ) {
//  if ( ((loop_cnt % 12) == 0) && (last_raw != 0) )
    if ( got_ack ) {
      char packet[30];
      // build a LimiTTer string
      packet[0] = '\0';
      batteryPcnt = min(map(SoCData.voltage, MIN_VOLTAGE, MAX_VOLTAGE, 0, 100), 100); // Convert voltage to percentage
      sprintf(packet, "%s 216 %s %s", last_raw, batteryPcnt, sensorData.minutesSinceStart);
      print_state("");
      Serial.printf("send sensor lifetime in LimiTTer ASCII format: [%s]", packet);
      send_data((unsigned char*)packet, strlen(packet));

 *  - bugfix to enable live sensor change (@bertrooode, @chaosbiber)
 *  - minor bugfixes
 * V0.9.11
 *  - fixed code errors in LimiTTer mode, no tested before (uncomment #define USE_XBRIDGE2 to activate)
 * V0.9.12
 *  - removed useless while (!Serial), replaced by a fixed delay, RFduino Serial implementation is interrupt driven, only work on Arduino
 *  - removed own printf code to avoid stack overflow, serial output only done with Serial.printf() now
 *  - added while (RDduinoBLE.radioActive); after ...BLE.send / to be tested
 * V0.9.13
 *  - this version number was intentional skipped
 * V0.9.14
 *  - replaced all String class depend code to char[] type to reduce heavy memory usage of the String class
 *  - added stack_check() code / no action taken on underflow / displays function call history after remaining memory is too low
 *  - track and display absolute minimum of available memory
 *  - removed radioActive check before/after BLE.send routines
 *  - reduced BLE packet length to 20 bytes fixed to avoid sending 2 packets / xDrip accepts shorter packets
 *    if the length is coded correctly at start of packet
 * V0.9.15
 *  - restart of BLE stack when not connected at end of loop() to heal slowly packet transmission after reconnect (experimental)
 *  - restart BLE stack if BLE lost during sending the current queue (40 s waiting time)
 *  - testing function result of BLE.send to check proper BLE stack queue filling (currently RFduino only)
 *  - added watchdog again to overcome possible RFduino freezing due to BLE stack overload
 */

 /*
  * to do:
  * - clear up SHADOWFRAM code, implemented with #defined parts and bool flag
  * - adopt Simblee FLASH handling
  * - reintegrate a classic watchdog timer to overcome RFduino freezing
  */

/* ********************* program configuration options **********************/
