docs: def _get_ruuvitag_datas(macs=[], search_duratio_sec=None, run_flag=RunFlag(), bt_device=''):
          """
          Get data from BluetoothCommunication and handle data encoding.
  
          Args:
              macs (list): MAC addresses. Default empty list
              search_duratio_sec (int): Search duration in seconds. Default None
              run_flag (object): RunFlag object. Function executes while run_flag.running. Default new RunFlag
              bt_device (string): Bluetooth device id
          Yields:
              tuple: MAC and State of RuuviTag sensor data
          """
  
          mac_blacklist = []
          start_time = time.time()
          data_iter = ble.get_datas(mac_blacklist, bt_device)
  
          for ble_data in data_iter:
              # Check duration
              if search_duratio_sec and time.time() - start_time > search_duratio_sec:
                  data_iter.send(StopIteration)
                  break
              # Check running flag
              if not run_flag.running:
                  data_iter.send(StopIteration)
                  break
              # Check MAC whitelist
              if macs and not ble_data[0] in macs:
                  continue
              (data_format, data) = RuuviTagSensor.convert_data(ble_data[1])
              # Check that encoded data is valid RuuviTag data and it is sensor data
              # If data is not valid RuuviTag data add MAC to blacklist
              if data is not None:
                  state = get_decoder(data_format).decode_data(data)
                  if state is not None:
                      yield (ble_data[0], state)
              else:
                  mac_blacklist.append(ble_data[0])