Skip to content

Commit

Permalink
Merge pull request #516 from ndrake/allow-zero-timeout
Browse files Browse the repository at this point in the history
Allow advertising timeout of zero
  • Loading branch information
randdusing authored Jan 5, 2019
2 parents 90ec4d3 + a0a3709 commit f6917e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/android/BluetoothLePlugin.java
Original file line number Diff line number Diff line change
Expand Up @@ -709,11 +709,11 @@ private void startAdvertisingAction(JSONArray args, CallbackContext callbackCont
settingsBuilder.setConnectable(connectable);

int timeout = obj.optInt("timeout", 1000);
if (timeout < 1 || timeout > 180000) {
if (timeout < 0 || timeout > 180000) {
JSONObject returnObj = new JSONObject();

addProperty(returnObj, "error", "startAdvertising");
addProperty(returnObj, "message", "Invalid timeout (1 - 180000)");
addProperty(returnObj, "message", "Invalid timeout (0 - 180000)");

callbackContext.error(returnObj);
return;
Expand Down

0 comments on commit f6917e6

Please sign in to comment.