From 7ef5902c3de8146f8c2eb370e026b0f4a95e0946 Mon Sep 17 00:00:00 2001 From: George Oikonomou Date: Sun, 4 Dec 2016 18:51:57 +0000 Subject: [PATCH] Add the sniff make target We can now run make sniff and this will provide correct command line arguments for all supported devices. --- examples/sensniff/Makefile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/examples/sensniff/Makefile b/examples/sensniff/Makefile index 0bc269162..afa1cd4b6 100755 --- a/examples/sensniff/Makefile +++ b/examples/sensniff/Makefile @@ -23,3 +23,23 @@ all: $(CONTIKI_PROJECT) CONTIKI = ../.. include $(CONTIKI)/Makefile.include + +PYTHON ?= python +SENSNIFF = $(CONTIKI)/tools/sensniff/sensniff.py + +ifeq ($(BAUDRATE),) + BAUDRATE = 460800 +endif + +SENSNIFF_FLAGS += -b $(BAUDRATE) + +ifneq ($(PORT),) + SENSNIFF_FLAGS += -d $(PORT) +endif + +sniff: +ifeq ($(wildcard $(SENSNIFF)), ) + $(error Could not find the sensniff script. Did you run 'git submodule update --init' ?") +else + $(PYTHON) $(SENSNIFF) $(SENSNIFF_FLAGS) +endif