## 5 End-to-End Solutions for M2M Communication
### Testbed Implementation of M2M Solutions
In these cases, the GPRS interface should remain on but at an idle state, employed only to receive incoming calls if needed; (ii) if the WiFi connection is not available, the WiFi network interface should be switched off completely and GPRS should be employed for communication. A prototype M2M solution built on Android mobile devices is presented in [120]. At the patient's side, wearable sensors are employed to measure physiological data such as ECG and oxygen saturation. The sensor nodes are connected to M2M nodes, which are, in turn, wirelessly connected to the Internet through the M2M gateway. The sensor network employs the IEEE 802.15.4 protocol along with the IPv6 addressing mechanism. At the other end of the M2M system, a server PC collects and processes the sensor data, which are ultimately made available to the medical personnel through a user-friendly Android application. By combining IPv6 techniques over mobile communication technology, this testbed implementation has provided a practical, scalable and flexible way to make a large amount of biomedical signals accessible online. In some works, ambient sensor networks for environmental monitoring are employed in conjunction with WBANs, in order to provide additional information on the patient's whereabouts, such as temperature, humidity and light conditions. Along this line, a three-tier network architecture, depicted in Figure 6, is proposed in [121], for the remote monitoring of elderly or chronic patients in their residence. The lower tier consists of two systems: (i) a patient-worn fabric belt, which integrates the medical sensors and is equipped with a Bluetooth transceiver; and (ii) the ambient wireless sensors that form a ZigBee network and are deployed in the patient's surroundings (e.g., in the patient's home or in a nursing house). In the middle tier, an ad hoc network of powerful mobile computing devices (e.g., laptops, PDAs, _etc._) gathers the medical and ambient sensory data and forwards them to the higher tier. The middle-tier devices must have multiple network interfaces: Bluetooth and ZigBee to communicate with the lower tier and WLAN or cellular capabilities for connection with the higher layer. Finally, the higher tier is structured on the Internet and includes the application databases and servers that are accessed by the healthcare providers. The study involves a real implementation of the proposed architecture and tackles several security issues that arise along the three tiers. The proposed framework offers a flexible and secure solution for the monitoring of multiple patients that can be applied to different scenarios, including home, hospital and nursing home environments. Sensor networks can also be employed for patient localization purposes. In [122], the authors propose a system architecture based on two independent subsystems for the monitoring and location tracking of patients within hospital environments, as shown in Figure 7. The healthcare monitoring subsystem consists of smart shirts with integrated medical sensors, each equipped with a wireless IEEE 802.15.4 module. The location subsystem has two components: (i) a deployment of wireless IEEE 802.15.4 nodes  
Figure 6: Example of three-tier network architecture. that are installed in known locations within the hospital infrastructure and broadcast periodic beacon frames; and (ii) IEEE 802.15.4 end devices, held by the patients, that collect signal strength information from the received beacons. Both subsystems transmit their respective data (_i.e._, medical sensory data and signal strength information) to a gateway through an IEEE 802.15.4-based ad hoc distribution network. The gateway has wired Internet connectivity and forwards the data to the management server and the monitoring mHealth application. The proposed system has been tested with success in a hospital, achieving high reliability, sufficient battery lifetime of the sensors and real-time data reconstruction.