# Secure Utilization of Beacons and UAVs in Emergency Response Systems for Building Fire Hazard
## 3 UAV-Assisted Emergency Monitoring and Response System
### System Protocols
#### 3.3.3 Emergency Response  
In the event that a situation is determined to be an emergency, the building manager begins the emergency response process by sending a message to the control server. In order to prevent malicious interference from external sources or false reports, only managers authenticated by the Alljoyn security platform have the right to begin this process. Once an authenticated message has been received from an authorized source, the control server broadcasts emergency alert messages to everyone in the building and to all smart sensors, drones and other building personnel. In addition, the sprinkler installed in the building is operated by the server. This emergency response process is shown in Figure 6. CCTV and indoor and outdoor drones continue to monitor the situation both inside and outside the building, sending all visual data to the server. Furthermore, in an emergency situation, the smart sensors utilize the beacon signals in the users' smart ID cards in each room to determine how many users are indoors and transmit the number to the server.  
To make the above response possible, the system's smart sensors are constantly connected to Bluetooth and therefore always capable of receiving a Bluetooth signal from beacons that are attached to or embedded in users' smart ID cards. In this way, the smart sensors can precisely locate all building occupants at all times. The Bluetooth beacons in the ID cards transmit a constant signal to all the components of the system. This signal includes a time stamp, a TX power setting, an RSSI (dB), a major number and a minor number. The minor number is particularly important, as it is used to provide a unique identification number to each user's ID card, which is what allows the system to specify exactly where each user is located in the building. The location of an ID card, also called its proximity, can be determined by the strength of the signal as it is received by a sensor. Usually, the Friis model formula [35] is used to calculate this distance. Equation (1) is the Friis transmission equation [35].  
\[P_{r}(\omega)=P_{t}(\omega)\frac{G_{t}(\omega)G_{r}(\omega)\lambda^{2}}{(4\pi r )^{2}} \tag{1}\]  
where \(P_{t}\) and \(P_{r}\) are the transmitted and received powers, respectively, \(G_{t}\) and \(G_{r}\) are the antenna gains of the receiving and transmitting antenna, respectively, \(\lambda\) is the wavelength at the operating frequency and \(r\) is the distance between the transmitting and receiving antennas.  
By this Friis model formula, the proximity value of beacons \(r\) is obtained as Equation (2):  
\[r=\frac{\lambda}{4\pi}\sqrt{\frac{P_{t}}{P_{r}}G_{t}G_{r}} \tag{2}\]  
However, the calculated proximity value \(r\) has an accuracy of 68% [25]. Therefore, in order to improve the accuracy, we apply the median of the proximity value \(r\) for a certain period of time to calculate the user's position.  
Therefore, during an emergency situation, the control server informs the occupants in the building of the disaster and, using the proximity data received from their ID cards, determines the optimal emergency route for each person based on his/her current location in the building. In the event that a smart sensor becomes disabled in an emergency situation, by fire, for example, an occupant's  
Figure 6: Emergency response process.  
proximity data can also be transmitted by the indoor/outdoor UAVs as they are also constantly receiving that information via Bluetooth.