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