1 package iotcode.GPSPhoneGateway;
3 /** PhoneInfo that implements PhoneInfoInterface
5 * @author Rahmadi Trimananda <rahmadi.trimananda @ uci.edu>
9 public class PhoneInfo implements PhoneInfoInterface {
12 * PhoneInfo class properties
14 private int iRoomIdentifier;
15 private boolean bRingStatus;
16 private boolean bNewRoomIDAvail;
17 private boolean bNewRingStatusAvail;
23 this.iRoomIdentifier = 0;
24 this.bRingStatus = false;
25 this.bNewRoomIDAvail = false;
26 this.bNewRingStatusAvail = false;
30 * Set room identifier info from the phone app using IoTRemoteCall
32 * @param iId Room identifier (integer)
35 public String setRoomID(Integer iId) {
37 this.iRoomIdentifier = iId;
38 this.bNewRoomIDAvail = true;
39 System.out.println("New room ID set: " + this.iRoomIdentifier);
44 * Set ring status info from the phone app using IoTRemoteCall
46 * @param bStatus Ring status (true/false)
49 public String setRingStatus(Boolean bStatus) {
51 this.bRingStatus = bStatus;
52 this.bNewRingStatusAvail = true;
53 System.out.println("New ring status set: " + this.bRingStatus);
58 * Simply return this.iRoomIdentifier
60 public int getRoomID() {
62 return this.iRoomIdentifier;
66 * Simply return this.bRingStatus
68 public boolean getRingStatus() {
70 return this.bRingStatus;
74 * Simply return this.bNewRoomIDAvail
76 public boolean isNewRoomIDAvailable() {
78 return this.bNewRoomIDAvail;
82 * Simply return this.bNewRingStatusAvail
84 public boolean isNewRingStatusAvailable() {
86 return this.bNewRingStatusAvail;
90 * Set this.bNewRoomIDAvail
92 public void setNewRoomIDAvailable(boolean bValue) {
94 this.bNewRoomIDAvail = bValue;
98 * Set this.bNewRingStatusAvail
100 public void setNewRingStatusAvailable(boolean bValue) {
102 this.bNewRingStatusAvail = bValue;