Skip to content

Connectivity between car emulator and Android app

NilsDunlop edited this page May 28, 2021 · 10 revisions

Description

The connectivity feature is responsible for having the Medcar and the android app being able to connect. When the car and the android app are connected they can communicate and send over different commands. The communication is handled by using the MQTT protocol and an AWS server but there is also an option in the app where the user could choose to use localhost. Every piece of information that the app and car need to send to each other is going to be through MQTT.

Functional Requirements:

  • The android app shall be able to connect to the MQTT broker.
  • The emulator shall receive the instructions/commands from the application via the MQTT broker.
  • The application shall be able to send instructions/commands to the emulator via the MQTT broker.
  • All of the commands available on the application shall be able to be executed on the car.

Non-Functional Requirements:

  • The app and the emulator shall successfully connect 90% of the time.
  • The app and the emulator shall not unexpectedly lose connection to the MQTT broker 95% of the time they are being used.
  • The execution of the commands between the application and the emulator shall not take more than 3 seconds on the localhost.
  • The execution of the commands between the application and the emulator shall not take more than 5 seconds on the AWS server.

Example

A medical worker opens the Medcar app and selects to use either online or offline mode. The online mode is going to use the AWS server and the offline mode is going to use localhost. When the worker has selected to use either online or offline mode then the worker will proceed to the car selection screen. After the worker has selected a car, the worker can now press the "connection" button. If the worker presses the connection button, a connection between the app and the emulator will be established via the MQTT broker. The worker will get a pop-up that informs the worker that the app and emulator have connected successfully. When the emulator and the app are connected, the worker could send over commands to the emulator by either use the joystick to steer the car or use the auto mode.