# Opportunistic Sensor Data Collection with Bluetooth Low Energy
## 5 Evaluation
### Maximum Amount of Collected Data: Experimental Results
#### 5.5.1 Influence of _comInterval_ on Amount of Collected Data per Contact Interval  
In order to obtain the amount of collected data per contact interval for different _comInterval_ values, two modules are used, as master and slave, respectively. Our goal is to measure the maximum achievable value for the aforementioned performance parameter, at the upper layer Attribute Protocol (ATT) level, i.e., ATT payload per time unit (the reader may refer to the literature for a detailed description of ATT [7, 8]). To this end, the slave sends ATT notifications to the master, which does not trigger ATT-layer acknowledgments, at the highest possible rate. The master is connected through a serial link with a PC to trace the BLE Link Layer state of the master, and the amount of successfully transferred packets. For the measurements, a Texas Instruments CC2540 USB sniffer connected to the PC is used to obtain the timestamp of the first and the last packets transferred. The _comInterval_ parameter is set in the master. Recall that this parameter is communicated by the master to the slave in the Connection Request message during connection establishment. To perform the measurements, two different scripts were developed (as a side contribution of this paper, the scripts are both available at [35]). One script generates the data packets sent by the slave,  
Figure 22: Energy cost for the advertisement-based and the connection-based approaches as a function of _adbulletval_, for different \(T_{contact}\) and \(N\) values, assuming \(\text{comInterval}=4\) s, and a time between contacts of one day. whereas the other is executed at the master for service discovery, connection establishment and data reception. During the tests, the two BLE modules are located at a near-zero distance, in front of each other. A large number of different _connInterval_ values are tested within a set of low _connInterval_ values, as explained next. For each _connInterval_ value, 10 individual experiments are performed. In each experiment, 100 kB of data are transferred. As shown in Figure 23, with the lowest _connInterval_ values, the amount of collected data increases slightly with _connInterval_, since the idle time in a _connInterval_ tends to decrease. As _connInterval_ grows, the amount of collected data stays relatively constant up to around _connInterval_ = 20 ms. Thereafter, the amount of collected data starts to decrease. In order to provide insight on the above results, we also measured throughput within a contact interval. The maximum throughput within a contact interval achieved during the tests is 156.5 kbit/s. (It must be noted that, to our best knowledge, this obtained throughput value within a contact interval is the highest compared with the works available in the literature (see Section 2.2), and is higher than the one reported by the manufacturer. This was possible by using a timer-based application for generating and sending data, while the example code provided by the manufacturer involves more complex processing, including use of the Analog to Digital Converter (ADC), for the same purpose.) However, this value is limited by the maximum number of round trip exchanges per _connInterval_ allowed by the platform, which we found to be 11 (see Figure 24). The maximum measured throughput is lower than the maximum theoretical throughput of BLE (reported to be 236.7 kbit/s [30]). This is expected, as BLE implementations are not optimized for high throughput [8; 14]. Nevertheless, this fact must be taken into account in a practical OSDC scenario with BLE, where the maximum amount of data that may be collected per contact interval from the sensor node will be lower than the theoretical one. For example, the measured maximum amount of collected data in a contact time of 150 s is 23.5 Mbit, while the theoretical one is around 32 Mbit. Finally, because the number of 11 round trips per _connInterval_ cannot be exceeded due to radio buffer limitations, increasing _connInterval_ beyond 20 ms decreases the amount of collected data per contact interval.