summaryrefslogtreecommitdiff
path: root/recipes-connectivity/lora/lora-packet-forwarder_4.0.1.bb
blob: 06302f51945ea7b52ca2f7e30fab73801e21b4ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
DESCRIPTION = "LoRa Packet Forwarder"
HOMEPAGE = "https://github.com/Lora-net/packet_forwarder"
PRIORITY = "optional"
SECTION = "console/utils"
# Semtech license is a modified BSD-style license
LICENSE = "Proprietary"
LIC_FILES_CHKSUM = "file://LICENSE;md5=22af7693d7b76ef0fc76161c4be76c45"
DEPENDS = "lora-gateway logrotate lora-logging libgps24"
RDEPENDS_${PN} += "bash"
FILESEXTRAPATHS_append_mtcdt3hs := ":${THISDIR}/lora-packet-forwarder/mtcdt3"
PR = "r23"
SRCREV = "28b9dff2eb06fb88421cf32771d380a178079fce"
PACKAGE_ARCH = "${MACHINE_ARCH}"

SRC_URI = "git://git.multitech.net/packet_forwarder_mtac_full;branch=master;protocol=git \
           file://README.md \
           file://lora-packet-forwarder.init \
           file://lora-packet-forwarder.default \
           file://global_conf.json.3.0.0.PCB_E336.EU868.basic.clksrc0 \
           file://global_conf.json.3.0.0.MTAC_LORA_1_0.EU868.basic.clksrc0 \
           file://global_conf.json.3.0.0.MTAC_LORA_1_0.US915.basic.clksrc0 \
           file://global_conf.json.3.0.0.MTAC_LORA_1_5.EU868.basic.clksrc0 \
           file://global_conf.json.3.0.0.MTAC_LORA_1_5.US915.basic.clksrc0 \
           file://global_conf.json.3.0.0.MTAC_LORA_1_5.AS923.basic.clksrc0 \
           file://global_conf.json.3.0.0.MTAC_LORA_1_5.AS923-LBT.basic.clksrc0 \
           file://global_conf.json.3.0.0.MTAC_LORA_1_5.KR920-LBT.basic.clksrc0 \
           file://global_conf.json.3.0.0.MTAC_LORA_1_5.IN865.basic.clksrc0 \
           file://global_conf.json.3.0.0.MTAC_LORA_1_5.AU915.basic.clksrc0 \
           file://global_conf.json.3.0.0.MTAC_LORA_1_5.RU864.basic.clksrc0 \
           file://global_conf.json.3.1.0.MTCAP-LORA-1-5.EU868.basic \
           file://global_conf.json.3.1.0.MTCAP-LORA-1-5.US915.basic \
           file://global_conf.json.3.1.0.MTCAP-LORA-1-5.AU915.basic \
           file://global_conf.json.3.1.0.MTCAP-LORA-1-5.AS923.basic \
           file://global_conf.json.3.1.0.MTCAP-LORA-1-5.AS923-LBT.basic \
           file://global_conf.json.3.1.0.MTCAP-LORA-1-5.IN865.basic \
           file://global_conf.json.3.1.0.MTCAP-LORA-1-5.KR920-LBT.basic \
           file://global_conf.json.3.1.0.MTCAP-LORA-1-5.RU864.basic \
           file://global_conf.json.MTCAP2-LORA-1.5.AS923 \
           file://global_conf.json.MTCAP2-LORA-1.5.AS923-LBT \
           file://global_conf.json.MTCAP2-LORA-1.5.AU915 \
           file://global_conf.json.MTCAP2-LORA-1.5.EU868 \
           file://global_conf.json.MTCAP2-LORA-1.5.IN865 \
           file://global_conf.json.MTCAP2-LORA-1.5.KR920-LBT \
           file://global_conf.json.MTCAP2-LORA-1.5.RU864 \
           file://global_conf.json.MTCAP2-LORA-1.5.US915 \
           file://local_conf.json \
"


S = "${WORKDIR}/git"
B = "${S}"
TARGET_CC_ARCH += "${LDFLAGS}"


LORA_DIR = "/opt/lora"

export LGW_PATH = "${STAGING_LIBDIR}/lora"
export LGW_INC = "${STAGING_INCDIR}/lora"

CFLAGS += "-I${LGW_INC} -Iinc -I. -std=gnu11"

do_compile() {
  oe_runmake
}

do_install() {
  install -d ${D}${LORA_DIR}
  install -m 755 lora_pkt_fwd/lora_pkt_fwd ${D}${LORA_DIR}/
  install -m 755 ${WORKDIR}/local_conf.json ${D}${LORA_DIR}/

  install -d ${D}${LORA_DIR}/forwarder-utils
  install -m 755 util_sink/util_sink ${D}${LORA_DIR}/forwarder-utils/
  install -m 755 util_ack/util_ack ${D}${LORA_DIR}/forwarder-utils/
  install -m 755 util_tx_test/util_tx_test ${D}${LORA_DIR}/forwarder-utils/
  install -m 755 ${WORKDIR}/README.md  ${D}${LORA_DIR}/

  install -d ${D}${sysconfdir}/default
  install -m 0644 ${WORKDIR}/lora-packet-forwarder.default ${D}${sysconfdir}/default/lora-packet-forwarder
  install -d ${D}${sysconfdir}/init.d
  install -m 0755 ${WORKDIR}/lora-packet-forwarder.init ${D}${sysconfdir}/init.d/lora-packet-forwarder
}

do_install_append_mtcdt() {
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.EU868.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_0.EU868.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_0
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.EU868.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_5
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_0.EU868.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_0.EU868
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.EU868.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_5.EU868
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.RU864.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_5.RU864
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_0.US915.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_0.US915
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.US915.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_5.US915
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.AU915.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_5.AU915
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.AS923.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_5.AS923
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.AS923-LBT.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_5.AS923-LBT
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.KR920-LBT.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_5.KR920-LBT
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.IN865.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_5.IN865
}

do_install_append_mtcap() {
  install -m 755 ${WORKDIR}/global_conf.json.3.1.0.MTCAP-LORA-1-5.EU868.basic ${D}${LORA_DIR}/global_conf.json.MTCAP_LORA_1_5.EU868
  install -m 755 ${WORKDIR}/global_conf.json.3.1.0.MTCAP-LORA-1-5.RU864.basic ${D}${LORA_DIR}/global_conf.json.MTCAP_LORA_1_5.RU864
  install -m 755 ${WORKDIR}/global_conf.json.3.1.0.MTCAP-LORA-1-5.US915.basic ${D}${LORA_DIR}/global_conf.json.MTCAP_LORA_1_5.US915
  install -m 755 ${WORKDIR}/global_conf.json.3.1.0.MTCAP-LORA-1-5.AU915.basic ${D}${LORA_DIR}/global_conf.json.MTCAP_LORA_1_5.AU915
  install -m 755 ${WORKDIR}/global_conf.json.3.1.0.MTCAP-LORA-1-5.AS923.basic ${D}${LORA_DIR}/global_conf.json.MTCAP_LORA_1_5.AS923
  install -m 755 ${WORKDIR}/global_conf.json.3.1.0.MTCAP-LORA-1-5.AS923-LBT.basic ${D}${LORA_DIR}/global_conf.json.MTCAP_LORA_1_5.AS923-LBT
  install -m 755 ${WORKDIR}/global_conf.json.3.1.0.MTCAP-LORA-1-5.KR920-LBT.basic ${D}${LORA_DIR}/global_conf.json.MTCAP_LORA_1_5.KR920-LBT
  install -m 755 ${WORKDIR}/global_conf.json.3.1.0.MTCAP-LORA-1-5.IN865.basic ${D}${LORA_DIR}/global_conf.json.MTCAP_LORA_1_5.IN865

  install -m 755 ${WORKDIR}/global_conf.json.MTCAP2-LORA-1.5.EU868 ${D}${LORA_DIR}/global_conf.json.MTCAP2_LORA_1_5.EU868
  install -m 755 ${WORKDIR}/global_conf.json.MTCAP2-LORA-1.5.RU864 ${D}${LORA_DIR}/global_conf.json.MTCAP2_LORA_1_5.RU864
  install -m 755 ${WORKDIR}/global_conf.json.MTCAP2-LORA-1.5.US915 ${D}${LORA_DIR}/global_conf.json.MTCAP2_LORA_1_5.US915
  install -m 755 ${WORKDIR}/global_conf.json.MTCAP2-LORA-1.5.AU915 ${D}${LORA_DIR}/global_conf.json.MTCAP2_LORA_1_5.AU915
  install -m 755 ${WORKDIR}/global_conf.json.MTCAP2-LORA-1.5.AS923 ${D}${LORA_DIR}/global_conf.json.MTCAP2_LORA_1_5.AS923
  install -m 755 ${WORKDIR}/global_conf.json.MTCAP2-LORA-1.5.AS923-LBT ${D}${LORA_DIR}/global_conf.json.MTCAP2_LORA_1_5.AS923-LBT
  install -m 755 ${WORKDIR}/global_conf.json.MTCAP2-LORA-1.5.KR920-LBT ${D}${LORA_DIR}/global_conf.json.MTCAP2_LORA_1_5.KR920-LBT
  install -m 755 ${WORKDIR}/global_conf.json.MTCAP2-LORA-1.5.IN865 ${D}${LORA_DIR}/global_conf.json.MTCAP2_LORA_1_5.IN865
}

do_install_append_mtcdt3() {
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.EU868.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_0.EU868.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_0
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.EU868.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_5
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_0.EU868.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_0.EU868
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.EU868.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_5.EU868
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.RU864.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_5.RU864
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_0.US915.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_0.US915
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.US915.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_5.US915
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.AU915.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_5.AU915
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.AS923.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_5.AS923
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.AS923-LBT.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_5.AS923-LBT
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.KR920-LBT.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_5.KR920-LBT
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.IN865.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_5.IN865
}

do_install_append_mtcdt3hs() {
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.EU868.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_0.EU868.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_0
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.EU868.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_5
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_0.EU868.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_0.EU868
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.EU868.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_5.EU868
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.RU864.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_5.RU864
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_0.US915.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_0.US915
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.US915.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_5.US915
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.AU915.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_5.AU915
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.AS923.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_5.AS923
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.AS923-LBT.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_5.AS923-LBT
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.KR920-LBT.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_5.KR920-LBT
  install -m 755 ${WORKDIR}/global_conf.json.3.0.0.MTAC_LORA_1_5.IN865.basic.clksrc0 ${D}${LORA_DIR}/global_conf.json.MTAC_LORA_1_5.IN865
}


FILES_${PN} += "${LORA_DIR}"
FILES_${PN}-dbg += "${LORA_DIR}/.debug ${LORA_DIR}/forwarder-utils/.debug"

# disable this on purpose for dev purposes
do_rm_work() {
  echo "skipping"
}