Example #1
0
  /**
   * Toggles the state of the lock
   *
   * @return the state of the lock after the toggle
   */
  public boolean unlock(LockListScreen lls) {

    // Sends the unlock message to the arduino
    lls.sendMessage(
        String.format(CMD_FORMAT, CMD_CHAR, UNLOCK_CODE, macAddress.length(), macAddress));

    // Set isLocked to false
    isLocked = false;

    return isLocked;
  }
Example #2
0
 /**
  * The setup function used during lock setup This command is passed to the device to let it know
  * that you want to establish a permanent connection with a password (the password is the MAC
  * address)
  *
  * @param lls the lock list activity
  */
 public void setLockUID(LockListScreen lls) {
   lls.sendMessage(String.format(CMD_FORMAT, CMD_CHAR, SET_CODE, macAddress.length(), macAddress));
 }