Skip to content

Commit

Permalink
v1.3.0
Browse files Browse the repository at this point in the history
- Feature: adding preliminary beacon support for class B development.
- Solved warnings with 64b integer printf when compiling on x86_64.
- Updated build system for easier deployment on various hardware.
- Changed threads organization in the forwarder programs.
- Removed duplicate protocol documentation.
  • Loading branch information
Sylvain Miermont committed Mar 28, 2014
1 parent 9b2bd33 commit e435e9b
Show file tree
Hide file tree
Showing 63 changed files with 5,065 additions and 681 deletions.
52 changes: 26 additions & 26 deletions basic_pkt_fwd/LICENSE.TXT → LICENSE
Original file line number Diff line number Diff line change
@@ -1,29 +1,4 @@
--- For the parson library (parson.c and parson.h) ---

Parson ( http://kgabis.github.com/parson/ )
Copyright (c) 2012 Krzysztof Gabis

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

--- For the rest of the code : Revised BSD License ---

Copyright (c) 2013, SEMTECH S.A.
Copyright (C) 2013, SEMTECH S.A.
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand All @@ -47,3 +22,28 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


--- For the parson library ---

Parson ( http://kgabis.github.com/parson/ )
Copyright (C) 2012 Krzysztof Gabis

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
ITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

25 changes: 25 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
### Environment constants

LGW_PATH := ../../lora_gateway/libloragw
CROSS_COMPILE :=
export

### general build targets

all:
$(MAKE) all -e -C basic_pkt_fwd
$(MAKE) all -e -C gps_pkt_fwd
$(MAKE) all -e -C beacon_pkt_fwd
$(MAKE) all -e -C util_ack
$(MAKE) all -e -C util_sink
$(MAKE) all -e -C util_tx_test

clean:
$(MAKE) clean -e -C basic_pkt_fwd
$(MAKE) clean -e -C gps_pkt_fwd
$(MAKE) clean -e -C beacon_pkt_fwd
$(MAKE) clean -e -C util_ack
$(MAKE) clean -e -C util_sink
$(MAKE) clean -e -C util_tx_test

### EOF
Binary file renamed gps_pkt_fwd/PROTOCOL.PDF → PROTOCOL.PDF
Binary file not shown.
19 changes: 16 additions & 3 deletions gps_pkt_fwd/PROTOCOL.TXT → PROTOCOL.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ That object contains the status of the gateway, with the following fields:
lati | number | GPS latitude of the gateway in degree (float, N is +)
long | number | GPS latitude of the gateway in degree (float, E is +)
alti | number | GPS altitude of the gateway in meter RX (integer)
rxnb | number | Number or radio packets received (unsigned integer)
rxok | number | Number or radio packets received with a valid PHY CRC
rxnb | number | Number of radio packets received (unsigned integer)
rxok | number | Number of radio packets received with a valid PHY CRC
rxfw | number | Number of radio packets forwarded (unsigned integer)
ackr | number | Percentage of upstream datagrams that were acknowledged
dwnb | number | Number of downlink datagrams received (unsigned integer)
Expand Down Expand Up @@ -316,7 +316,7 @@ That object contain a RF packet to be emitted and associated metadata with the f
tmst | number | Send packet on a certain timestamp value (will ignore time)
time | string | Send packet at a certain time (GPS synchronization required)
freq | number | TX central frequency in MHz (unsigned float, Hz precision)
rfch | number | Concentrator "RF chain" used for RX (unsigned integer)
rfch | number | Concentrator "RF chain" used for TX (unsigned integer)
powe | number | TX output power in dBm (unsigned integer, dBm precision)
modu | string | Modulation identifier "LORA" or "FSK"
datr | string | Datarate identifier (eg. SF12BW500 for Lora)
Expand Down Expand Up @@ -346,3 +346,16 @@ Example (white-spaces, indentation and newlines added for readability):
"data":"H3P3N2i9qc4yt7rK7ldqoeCVJGBybzPY5h1Dd7P7p8v"
}
```

7. Revisions
-------------

### v1.1 ###

* Added syntax for status report JSON object on upstream.

### v1.0 ###

* Initial version.

*EOF*
1 change: 1 addition & 0 deletions VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.3.0
103 changes: 78 additions & 25 deletions basic_pkt_fwd/Makefile
Original file line number Diff line number Diff line change
@@ -1,42 +1,95 @@
### Application-specific constants

APP_NAME=basic_pkt_fwd
APP_NAME := basic_pkt_fwd

### constant symbols
CROSS_COMPILE=
CC=gcc
CFLAGS=-O2 -Wall -Wextra -Iinc
C99FLAGS=-O2 -Wall -Wextra -std=c99 -Iinc
FLAG_AUX=
### Environment constants

### constants for Lora Gateway HAL library
LGW_PATH := ../../lora_gateway/libloragw
CROSS_COMPILE :=

LGW_PATH=../../lora_gateway/libloragw
LGW_INC=-I$(LGW_PATH)/inc
#LGW_LNK=-lloragw -lrt -lpthread
LGW_LNK=-lloragw -lrt -lpthread -lmpsse
# add libmpsse or not, depending on what option you compiled the libloragw with
### External constant definitions
# must get library build option to know if mpsse must be linked or not

### general build targets
include $(LGW_PATH)/library.cfg
RELEASE_VERSION := `cat ../VERSION`

all: $(APP_NAME)
### Constant symbols

CC := $(CROSS_COMPILE)gcc
AR := $(CROSS_COMPILE)ar

CFLAGS := -O2 -Wall -Wextra -std=c99 -Iinc -I.
VFLAG := -D VERSION_STRING="\"$(RELEASE_VERSION)\""

### Constants for Lora concentrator HAL library
# List the library sub-modules that are used by the application

LGW_INC =
ifneq ($(wildcard $(LGW_PATH)/inc/config.h),)
# only for HAL version 1.3 and beyond
LGW_INC += $(LGW_PATH)/inc/config.h
endif
LGW_INC += $(LGW_PATH)/inc/loragw_hal.h

### Linking options

ifeq ($(CFG_SPI),native)
LIBS := -lloragw -lrt -lpthread
else ifeq ($(CFG_SPI),ftdi)
LIBS := -lloragw -lrt -lpthread -lmpsse
else
# keep compatibility with SX1301 HAL version 1.2.x and bellow
ifeq ($(LGW_PHY),native)
LIBS := -lloragw -lrt -lpthread
else ifeq ($(LGW_PHY),ftdi)
LIBS := -lloragw -lrt -lpthread -lmpsse
else
$(error [error] Can't find configuration for SPI phy)
endif
endif

### General build targets

all: $(APP_NAME) global_conf.json

clean:
rm -f obj/*.o
rm -f $(APP_NAME)
find . -name global_conf.json -exec rm -i {} \;

### Sub-modules compilation

obj/base64.o: src/base64.c inc/base64.h
$(CC) -c $(CFLAGS) $< -o $@

obj/parson.o: src/parson.c inc/parson.h
$(CC) -c $(CFLAGS) $< -o $@

### sub-modules compilation
### Select the proper configuration JSON for the program

obj/base64.o: src/base64.c
$(CROSS_COMPILE)$(CC) -c $(CFLAGS) -o obj/base64.o $(LGW_INC) src/base64.c $(FLAG_AUX)
ifeq ($(CFG_BAND),eu868)
global_conf.json: cfg/global_conf.eu868.json
cp $< $@
else ifeq ($(CFG_BAND),us915)
global_conf.json: cfg/global_conf.us915.json
cp $< $@
else ifeq ($(CFG_BAND),cn470)
global_conf.json: cfg/global_conf.cn470.json
cp $< $@
else ifeq ($(CFG_BAND),eu433)
global_conf.json: cfg/global_conf.eu433.json
cp $< $@
else
global_conf.json: cfg/global_conf.empty.json
cp $< $@
endif

obj/parson.o: src/parson.c
$(CROSS_COMPILE)$(CC) -c $(CFLAGS) -o obj/parson.o $(LGW_INC) src/parson.c $(FLAG_AUX)
### Main program compilation and assembly

### main program compilation and assembly
obj/$(APP_NAME).o: src/$(APP_NAME).c $(LGW_INC) inc/parson.h inc/base64.h
$(CC) -c $(CFLAGS) $(VFLAG) -I$(LGW_PATH)/inc $< -o $@

obj/$(APP_NAME).o: src/$(APP_NAME).c
$(CROSS_COMPILE)$(CC) -c $(C99FLAGS) -o obj/$(APP_NAME).o $(LGW_INC) src/$(APP_NAME).c $(FLAG_AUX)
$(APP_NAME): obj/$(APP_NAME).o $(LGW_PATH)/libloragw.a obj/parson.o obj/base64.o
$(CC) -L$(LGW_PATH) $< obj/parson.o obj/base64.o -o $@ $(LIBS)

$(APP_NAME): $(LGW_PATH)/libloragw.a obj/$(APP_NAME).o obj/parson.o obj/base64.o
$(CROSS_COMPILE)$(CC) -o $(APP_NAME) obj/$(APP_NAME).o obj/parson.o obj/base64.o -L$(LGW_PATH) $(LGW_LNK)
### EOF
Binary file removed basic_pkt_fwd/PROTOCOL.PDF
Binary file not shown.
Loading

0 comments on commit e435e9b

Please sign in to comment.