#!/bin/bash

# first device connected

idf.py -DROLE=SENDER build

ret_val=$?

if (($ret_val != 0)); then
	exit
fi

if [$1 == '']; then
	idf.py -p /dev/ttyUSB0 flash && idf.py -p /dev/ttyUSB0 monitor -B 450000
else
	idf.py -p $1 flash && idf.py -p $1 monitor -B 450000
fi
