Replacing default BUFFSIZE value with new buffer size value when a resize needs to...
[iot2.git] / benchmarks / drivers / GPSPhoneGateway / PhoneInfo.java
1 package iotcode.GPSPhoneGateway;
2
3 /** PhoneInfo that implements PhoneInfoInterface
4  *
5  * @author      Rahmadi Trimananda <rahmadi.trimananda @ uci.edu>
6  * @version     1.0                
7  * @since       2016-04-27
8  */
9 public class PhoneInfo implements PhoneInfoInterface {
10
11         /**
12          * PhoneInfo class properties
13          */
14         private int iRoomIdentifier;
15         private boolean bRingStatus;
16         private boolean bNewRoomIDAvail;
17         private boolean bNewRingStatusAvail;
18
19         /**
20          * Constructor
21          */
22         public PhoneInfo() {
23                 this.iRoomIdentifier = 0;
24                 this.bRingStatus = false;
25                 this.bNewRoomIDAvail = false;
26                 this.bNewRingStatusAvail = false;
27         }
28
29         /**
30          * Set room identifier info from the phone app using IoTRemoteCall
31          *
32          * @param   iId         Room identifier (integer)
33          * @return  String
34          */
35         public String setRoomID(Integer iId) {
36
37                 this.iRoomIdentifier = iId;
38                 this.bNewRoomIDAvail = true;
39                 System.out.println("New room ID set: " + this.iRoomIdentifier);
40                 return "info sent";
41         }
42
43         /**
44          * Set ring status info from the phone app using IoTRemoteCall
45          *
46          * @param   bStatus             Ring status (true/false)
47          * @return  String
48          */
49         public String setRingStatus(Boolean bStatus) {
50
51                 this.bRingStatus = bStatus;
52                 this.bNewRingStatusAvail = true;
53                 System.out.println("New ring status set: " + this.bRingStatus);
54                 return "info sent";
55         }
56
57         /**
58          * Simply return this.iRoomIdentifier
59          */
60         public int getRoomID() {
61
62                 return this.iRoomIdentifier;
63         }
64
65         /**
66          * Simply return this.bRingStatus
67          */
68         public boolean getRingStatus() {
69
70                 return this.bRingStatus;
71         }
72         
73         /**
74          * Simply return this.bNewRoomIDAvail
75          */
76         public boolean isNewRoomIDAvailable() {
77
78                 return this.bNewRoomIDAvail;
79         }
80
81         /**
82          * Simply return this.bNewRingStatusAvail
83          */
84         public boolean isNewRingStatusAvailable() {
85
86                 return this.bNewRingStatusAvail;
87         }
88
89         /**
90          * Set this.bNewRoomIDAvail
91          */
92         public void setNewRoomIDAvailable(boolean bValue) {
93
94                 this.bNewRoomIDAvail = bValue;
95         }
96
97         /**
98          * Set this.bNewRingStatusAvail
99          */
100         public void setNewRingStatusAvailable(boolean bValue) {
101
102                 this.bNewRingStatusAvail = bValue;
103         }
104 }