1 package com.android.bluetooth.tests; 2 3 /** 4 * The interface for results - makes it easy to replace the result 5 * logger implementation at a later point if needed. 6 * @author cbonde 7 * 8 */ 9 public interface IResultLogger { 10 /** 11 * Add an entry to the result log. 12 * To make the first entry count, add a result of 0 bytes 13 * transfered then starting the test. 14 * Or add a result with 1 byte when e.g. the first byte is received. 15 * @param bytesTransfered The amount of bytes transfered 16 */ addResult(long bytesTransfered)17 void addResult(long bytesTransfered); 18 19 /** 20 * Get the current average speed of the transfer. 21 * (based on the last entry in the log, and not the current time) 22 * @return the average speed in bytes/sec 23 */ getAverageSpeed()24 int getAverageSpeed(); 25 26 /** 27 * Get the current average speed of the last period of the transfer. 28 * (based on the last entry in the log, and not the current time) 29 * @param period the period over which the average is taken. 30 * @return the average speed in bytes/sec 31 */ getAverageSpeed(long period)32 int getAverageSpeed(long period); 33 34 } 35