queens-satellite-team / mock-sat

Accessible open-source development platform for all QSAT prototyping needs!
2 stars 0 forks source link

Change send/receive scripts to accept ports as inputs #19

Open anthonysteel opened 4 years ago

anthonysteel commented 4 years ago

Right now the ports that the Arduinos are connected on are hard coded in the CMakeLists and in send.py / receive.py. Change these to accept the port as an input for easier development across machines.

anthonysteel commented 4 years ago

For example, in the CMakeLists.txt file there is the following:

generate_arduino_firmware(server
    SKETCH server.cpp
    PORT /dev/ttyS9
    SERIAL picocom @SERIAL_PORT@
    BOARD mega2560)

generate_arduino_firmware(client
    SKETCH client.cpp
    PORT /dev/ttyS9
    SERIAL picocom @SERIAL_PORT@
    BOARD mega2560

which generates two executables, client and server. It would be better if port was specified at build time. Something like:

cmake --send-port /dev/ttyS8 --receive-port /dev/ttyS9 ..

CMake should have support for this kind of thing, or it can be set as an environment variable which CMake captures.