##Note: the tracking of the "CHUNK" and "FILE" experiments are not yet implemented.
AtomD is an application designed to perform D2D measurements in real conditions by using the Google Nearby Connections API.
This tool allows you to do the following:
- Create and manipulate different experimental environments.
- Track the GSP location (latitude and longitude) for each generated action.
- Obtain the average throughput of the link through file transmission.
- Analyze the delay during the neighbor discovery(ND) process.
This application is designed for Sdk 28 to Sdk 33 . Additionally, it uses the following dependencies:
- location
- nearby
- room
To start using AtomD, you must first make a P2P connection with another device. This can be done by selecting the role for neighbor discovery(4) and pressing the D2D button (3).
When the status panel lights up (1), D2D is running.
To create an experiment, go to the Experiments tab (9), where you can create test experiments using Chunk (new message), throughput test (new file), and connection establishment delay test (new attempts of discovery).
Each new experiment will be added to a list database (7).
When starting an experiment, choose it from the list of experiments and click start (8). To end the D2D connection, click on stop (8).
Since AtomD's goal is to analyze the behavior of D2D in real environments, it uses an SQLite database named "atomd_db" to record each experiment log.
The tables corresponding to the database are listed below.
-
chunk_experiments
- experiment_name
- message_size
- message_attempts
- message_payload
-
file_experiments
- experiment_name
- file_size
- number_of_tries
-
connection_attempts
- experiment_name
- number_of_repetitions
-
data_connection_attempts
- experiment_id: Unique ID of the experiment instance
- source_id: Readable Id of the device(2)
- target_id: Readable Id of target device
- total_attempts: Total number of attempts to be performed
- low_power: If true, ND is performed by BLE, otherwise with bluetooth classic
- attempt: Number of attempt performed
- state: State of the ND where the data was recorded
- state_timing: Timed time when the data was recorded in milliseconds
- latitude: Last latitude obtained
- longitude: Last longitude obtained
class Builder(private val owner: LifecycleOwner, val deviceName: String, val context: Context){
fun setListener(listener: D2DListener)
fun build()
}
fun startDiscovery(strategy: Strategy, lowPower: Boolean)
fun startAdvertising(deviceName: String, strategy: Strategy, lowPower: Boolean, connectionType: Int)
fun notifyToConnectedDevice(endPointId: String, notificationParameters: JSONObject, afterCompleteTask:()->Unit? )
fun isConnected()
fun isDiscovering()
fun stopDiscoveringOrAdvertising()
fun disconnectFromDevice(endPointId: String)
fun stopAll()
fun sendSetOfChunks() -> TODO
fun sendSetOfBinaryFile() -> TODO
fun performDiscoverAttempts(targetDevice: String, repetitions: Int, isLowPower: Boolean)
fun getRequiredPermissions()
fun enableLocationUpdate(activity : Activity)
fun disableLocationUpdate()