Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

carlocorradini/domus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Domus

An emulation of a home automation system where each device is represented as a single process. There are two kind of devices, control and interaction one, and various types. All have a "status", one or more switches and a register with parameters.

Read assignment task for more information

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

  • Preparation

    1. Clone this repo on your host using Git

      $ git clone https://github.com/carlocorradini/domus.git
    2. Change current working directory

      $ cd domus/project/
    3. Compile Domus using GNU Make

      After compilation a build directory will be generated.

      build contains two subfolders:

      • bin

        Domus binaries

      • obj

        Domus object files

      $ make build
  • Run

    All binaries are under build/bin/ folder

    1. Domus

      Domus main program for controlling Devices automatically

      $ ./domus
    2. Domus Manual

      Domus manual controller for Human interaction

      $ ./domus_manual
  • Connect

    Perform the connection between Domus Manual and Domus.

    Launch both programs as described above, and type:

    • Domus

      Get Domus unique PID

      > connect
    • Domus Manual

      Connect to Domus using unique PID

      > connect <PID>

Supported commands

Below is a table of supported command in Domus & Domus Manual

  • Domus

    Command Description
    add <device> [name] Add a <device> to the system and show its features. Add [name] to define a custom name for the <device>
    clear Clear the CLI interface
    del <id> [--all] Delete the device with <id>. If [--all] delete all devices. If it's a control device, deletion is done recursively
    device Display all supported devices and their description
    exit Close Domus
    help Display help information about Domus
    hierarchy Display the current devices hierarchy in the system, described by [name] <id>
    info <id> [--all] Show device info with <id>. Show all devices info with [--all]
    link <id> to <id> Connect two devices each other. One must be a control device
    list Display all available devices and their features
    switch <id> <label> <pos> Switch the device with <id> the feature <label> into <pos>
    connect Get unique Domus PID for connecting Domus Manual control interface to Domus
  • Domus Manual

    Command Description
    clear Clear the CLI interface
    connect <PID> Connect to Domus using unique <PID>
    device Display all supported devices and their description
    exit Close Domus
    help Display help information about Domus
    switch <id> <label> <pos> Manually switch the device with <id> the feature <label> into <pos>

Extra functionalities

  • History navigation using arrows: &
  • Autocomplete using Tab
  • Info about command by adding ? at the end of it (ex. help ? )

Built With

  • GNU Make - GNU Make is a tool which controls the generation of executables and other non-source files of a program from the program's source files.
  • Git - Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency

Versioning

We use Git for versioning

Authors

  • Carlo Corradini - Initial work - 192451
  • Simone Nascivera - Initial work - 193246

License

This project is licensed under the MIT License - see the LICENSE file for details

© Domus 2019