Request a temperature reading.

@param callback the callback for the temperature result, in degrees Celsius
428186
public void readTemperature(Callback<Integer> callback) {
        addCallback(BeanMessageID.CC_TEMP_READ, callback);
        sendMessageWithoutPayload(BeanMessageID.CC_TEMP_READ);
    }
226561
public void readHardwareVersion(final Callback<String> callback) {
        gattClient.getDeviceProfile().getHardwareVersion(new DeviceProfile.VersionCallback() {
            @Override
            public void onComplete(String version) {
                callback.onResult(version);
            }
        });
    }
616245
function(callback) {
			var query = this.toQuery();
			var idx = 0;
			while (query.args.length > 0) {
				var value = query.args.shift();
				query.text = query.text.replace(/\?/,callback(value,idx));
				idx++;
			}
			return query.text;
		}
602515
public void fetchReceiptTimestamps(final AVIMConversationCallback callback) {
    final AVIMCommonJsonCallback tmpCallback = new AVIMCommonJsonCallback() {
      @Override
      public void done(Map<String, Object> result, AVIMException e) {
        if (null == callback) {
          return;
        }
        if (null != e || null == result) {
          callback.internalDone(e);
        } else {
          long readAt = 0;
          if (result.containsKey(Conversation.callbackReadAt)) {
            readAt = (Long) result.get(Conversation.callbackReadAt);
          }

          long deliveredAt = 0;
          if (result.containsKey(Conversation.callbackDeliveredAt)) {
            readAt = (Long) result.get(Conversation.callbackDeliveredAt);
          }
          AVIMConversation.this.setLastReadAt(readAt, false);
          AVIMConversation.this.setLastDeliveredAt(deliveredAt, false);
          storage.updateConversationTimes(AVIMConversation.this);
          callback.internalDone(null, null);
        }
      }
    };
    boolean ret = InternalConfiguration.getOperationTube().fetchReceiptTimestamps(client.getClientId(), getConversationId(),
            getType(),
            Conversation.AVIMOperation.CONVERSATION_FETCH_RECEIPT_TIME, tmpCallback);
    if (!ret && null != callback) {
      callback.internalDone(new AVException(AVException.OPERATION_FORBIDDEN, "couldn't send request in background."));
    }
  }
214503
function(key, callback) {
		if (typeof data[key] == 'undefined') {
			callback && callback(null, null)
		} else if (typeof data[key] == 'string' || typeof data[key] == 'number' || typeof data[key] == 'boolean') {
			callback && callback(null, data[key])
		} else {
			callback && callback(typeError('getBytes', 'string or number', key))
		}
	}
1013732
private <T, E> void parseAndCallback(
      RequestInfo<T, E> requestInfo, int statusCode, HttpResponse response)
      throws IOException {
    BatchCallback<T, E> callback = requestInfo.callback;

    HttpHeaders responseHeaders = response.getHeaders();
    HttpUnsuccessfulResponseHandler unsuccessfulResponseHandler =
        requestInfo.request.getUnsuccessfulResponseHandler();

    if (HttpStatusCodes.isSuccess(statusCode)) {
      if (callback == null) {
        // No point in parsing if there is no callback.
        return;
      }
      T parsed = getParsedDataClass(requestInfo.dataClass, response, requestInfo);
      callback.onSuccess(parsed, responseHeaders);
    } else {
      HttpContent content = requestInfo.request.getContent();
      boolean retrySupported = retryAllowed && (content == null || content.retrySupported());
      boolean errorHandled = false;
      boolean redirectRequest = false;
      if (unsuccessfulResponseHandler != null) {
        errorHandled = unsuccessfulResponseHandler.handleResponse(
            requestInfo.request, response, retrySupported);
      }
      if (!errorHandled) {
        if (requestInfo.request.handleRedirect(response.getStatusCode(), response.getHeaders())) {
          redirectRequest = true;
        }
      }
      if (retrySupported && (errorHandled || redirectRequest)) {
        unsuccessfulRequestInfos.add(requestInfo);
      } else {
        if (callback == null) {
          // No point in parsing if there is no callback.
          return;
        }
        E parsed = getParsedDataClass(requestInfo.errorClass, response, requestInfo);
        callback.onFailure(parsed, responseHeaders);
      }
    }
  }
823800
function cpuTemperature(callback) {

  return new Promise((resolve) => {
    process.nextTick(() => {
      let result = {
        main: -1.0,
        cores: [],
        max: -1.0
      };
      if (_linux) {
        exec('sensors', function (error, stdout) {
          if (!error) {
            let lines = stdout.toString().split('\n');
            lines.forEach(function (line) {
              let regex = /[+-]([^°]*)/g;
              let temps = line.match(regex);
              let firstPart = line.split(':')[0].toUpperCase();
              if (firstPart.indexOf('PHYSICAL') !== -1 || firstPart.indexOf('PACKAGE') !== -1) {
                result.main = parseFloat(temps);
              }
              if (firstPart.indexOf('CORE ') !== -1) {
                result.cores.push(parseFloat(temps));
              }
            });
            if (result.cores.length > 0) {
              let maxtmp = Math.max.apply(Math, result.cores);
              result.max = (maxtmp > result.main) ? maxtmp : result.main;
            }
            if (callback) { callback(result); }
            resolve(result);
          } else {
            fs.stat('/sys/class/thermal/thermal_zone0/temp', function (err) {
              if (err === null) {
                exec('cat /sys/class/thermal/thermal_zone0/temp', function (error, stdout) {
                  if (!error) {
                    let lines = stdout.toString().split('\n');
                    if (lines.length > 0) {
                      result.main = parseFloat(lines[0]) / 1000.0;
                      result.max = result.main;
                    }
                  }
                  if (callback) { callback(result); }
                  resolve(result);
                });
              } else {
                exec('/opt/vc/bin/vcgencmd measure_temp', function (error, stdout) {
                  if (!error) {
                    let lines = stdout.toString().split('\n');
                    if (lines.length > 0 && lines[0].indexOf('=')) {
                      result.main = parseFloat(lines[0].split('=')[1]);
                      result.max = result.main;
                    }
                  }
                  if (callback) { callback(result); }
                  resolve(result);
                });
              }
            });

          }
        });
      }
      if (_freebsd || _openbsd) {
        exec('sysctl dev.cpu | grep temp', function (error, stdout) {
          if (!error) {
            let lines = stdout.toString().split('\n');
            let sum = 0;
            lines.forEach(function (line) {
              const parts = line.split(':');
              if (parts.length > 0) {
                const temp = parseFloat(parts[1].replace(',', '.'));
                if (temp > result.max) result.max = temp;
                sum = sum + temp;
                result.cores.push(temp);
              }
            });
            if (result.cores.length) {
              result.main = Math.round(sum / result.cores.length * 100) / 100;
            }
          }
          if (callback) { callback(result); }
          resolve(result);
        });
      }
      if (_darwin) {
        let osxTemp = null;
        try {
          osxTemp = require('osx-temperature-sensor');
        } catch (er) {
          osxTemp = null;
        }
        if (osxTemp) {
          result = osxTemp.cpuTemperature();
        }

        if (callback) { callback(result); }
        resolve(result);
      }
      if (_sunos) {
        if (callback) { callback(result); }
        resolve(result);
      }
      if (_windows) {
        try {
          util.wmic('/namespace:\\\\root\\wmi PATH MSAcpi_ThermalZoneTemperature get CurrentTemperature').then((stdout, error) => {
            if (!error) {
              let sum = 0;
              let lines = stdout.split('\r\n').filter(line => line.trim() !== '').filter((line, idx) => idx > 0);
              lines.forEach(function (line) {
                let value = (parseInt(line, 10) - 2732) / 10;
                sum = sum + value;
                if (value > result.max) result.max = value;
                result.cores.push(value);
              });
              if (result.cores.length) {
                result.main = sum / result.cores.length;
              }
            }
            if (callback) { callback(result); }
            resolve(result);
          });
        } catch (e) {
          if (callback) { callback(result); }
          resolve(result);
        }
      }
    });
  });
}
394411
function(method, data, callback) {
      xhr.open(method, url, true, user, password);
      if (mimeType != null && !headers.has("accept")) headers.set("accept", mimeType + ",*/*");
      if (xhr.setRequestHeader) headers.each(function(value, name) { xhr.setRequestHeader(name, value); });
      if (mimeType != null && xhr.overrideMimeType) xhr.overrideMimeType(mimeType);
      if (responseType != null) xhr.responseType = responseType;
      if (timeout > 0) xhr.timeout = timeout;
      if (callback == null && typeof data === "function") callback = data, data = null;
      if (callback != null && callback.length === 1) callback = fixCallback(callback);
      if (callback != null) request.on("error", callback).on("load", function(xhr) { callback(null, xhr); });
      event.call("beforesend", request, xhr);
      xhr.send(data == null ? null : data);
      return request;
    }
599237
public static By callback(final Function<SearchContext, List<WebElement>> callback) {
		if (callback == null)
			throw new IllegalArgumentException("Cannot find elements when the callback is null");

		return new ByCallback(callback);
	}
1197339
function(callback) {
            fs.exists(file, function(exists) {
                if(!exists) {
                    rawData = file;
                    if(typeof rawData === "string") rawData = new Buffer(file);
                    return callback();
                }

                fs.readFile(file, function(err, data) {
                    if(err) return callback(err);
                    rawData = data;
                    return callback();
                });
            });
        }
92240
function (callback) {
            var i;

            for (i = 0; i < this.data.length; i += 1) {
                callback.call(this, this.data[i], i);
            }
            return this;
        }
1092363
def thermostat(self, temperature):
        
        target = int(temperature * 100)
        data = copy.copy(self._parameters)
        data.update({'value': target})
        response = self._get_data('/client/auth/setPoint', data)
        self._logger.debug('Response received {}'.format(response))
        self._clear_cache()
958184
function (callback) {
        if (!imageSizes.length) {
          return callback();
        }

        tempPath = options.tempPath;

        if (!fs.existsSync(options.tempPath)) {
          fs.mkdirSync(options.tempPath);
        }
        return callback(null);
      }
1117931
public void readAccelerometerRange(Callback<AccelerometerRange> callback) {
        addCallback(BeanMessageID.CC_ACCEL_GET_RANGE, callback);
        sendMessageWithoutPayload(BeanMessageID.CC_ACCEL_GET_RANGE);
    }
1003241
public void addCustomEventCallback(
            final CrawlEvent event,
            final PatternMatchingCallback callback) {
        customCallbacks.computeIfAbsent(event, key -> new ArrayList<>()).add(callback);
    }
1257112
public void getLocation(String key, LocationCallback callback) {
        DatabaseReference keyRef = this.getDatabaseRefForKey(key);
        LocationValueEventListener valueListener = new LocationValueEventListener(callback);
        keyRef.addListenerForSingleValueEvent(valueListener);
    }
774727
public void readBatteryLevel(final Callback<BatteryLevel> callback) {
        gattClient.getBatteryProfile().getBatteryLevel(new BatteryLevelCallback() {
            @Override
            public void onBatteryLevel(int percentage) {
                callback.onResult(new BatteryLevel(percentage));
            }
        });
    }