summaryrefslogtreecommitdiff
path: root/recipes-connectivity/lora/lora-gateway-sx1303_2.0.19.bb
blob: 312eda430b66b922cb3ffaa451b9c4f451c18ebb (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
DESCRIPTION = "LoRa Packet Forwarder"
HOMEPAGE = "https://github.com/MultiTechSystems/sx1302_hal"
PRIORITY = "optional"
SECTION = "console/utils"
# Semtech license is a modified BSD-style license
LICENSE = "Proprietary"
LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=d2119120bd616e725f4580070bd9ee19"
DEPENDS = "logrotate"
RDEPENDS_${PN} += "bash"

PR = "r6"

SRCREV = "V${PV}"

SRC_URI = "git://github.com/MultiTechSystems/sx1302_hal.git;protocol=https;branch=master \
           file://reset_lgw.sh \
           file://global_conf.json.MTAC_003_0_0.EU868 \
           file://global_conf.json.MTAC_003_0_0.US915 \
           file://global_conf.json.MTCAP3.EU868 \
           file://global_conf.json.MTCAP3.US915 \
"

SRC_URI[sha256sum] = "6499b73e97cb3e97fcfc02f4ebeee78cf273ccfec7f2221e2b1b9d1f02e7d408"


S = "${WORKDIR}/git"
B = "${S}"

LORA_DIR = "/opt/lora"


CFLAGS += "-DNODEBUG -I${S}/packet_forwarder/inc -I${S}/libloragw/inc -I${S}/libtools/inc -I${S}/inc -I. -std=gnu11"

do_compile() {
  oe_runmake packet_forwarder LDFLAGS=${LDFLAGS}
  oe_runmake util_boot LDFLAGS=${LDFLAGS}
  oe_runmake util_chip_id FLAGS=${LDFLAGS}
  oe_runmake util_net_downlink LDFLAGS=${LDFLAGS}
  # oe_runmake util_spectral_scan LDFLAGS=${LDFLAGS}
}

do_install() {
  install -d ${D}${LORA_DIR}
  install -d ${D}${libdir}/lora
  install -d ${D}${libdir}/lora/lgw-sx1303/lgw
  install -d ${D}${includedir}/lora/lgw-sx1303/lgw

  install -m 0644 libloragw/libloragw.a ${D}${libdir}/lora/lgw-sx1303/lgw/
  install -m 0644 libloragw/library.cfg ${D}${libdir}/lora/lgw-sx1303/lgw/
  install -m 0644 libloragw/inc/* ${D}${includedir}/lora/lgw-sx1303/lgw/

  install -d ${D}${LORA_DIR}/forwarder-utils-sx1303
  install -d ${D}${LORA_DIR}/gateway-utils-sx1303
  install -m 755 ${WORKDIR}/reset_lgw.sh ${D}${LORA_DIR}/
  install -m 755 packet_forwarder/lora_pkt_fwd ${D}${LORA_DIR}/lora_pkt_fwd_sx1303
  install -m 755 libloragw/test_loragw* ${D}${LORA_DIR}/gateway-utils-sx1303/
  install -m 755 util_boot/boot ${D}${LORA_DIR}/forwarder-utils-sx1303/util_boot
  install -m 755 util_chip_id/chip_id ${D}${LORA_DIR}/forwarder-utils-sx1303/util_chip_id
  install -m 755 util_net_downlink/net_downlink ${D}${LORA_DIR}/forwarder-utils-sx1303/util_net_downlink
  # install -m 755 util_spectral_scan/util_spectral_scan ${D}${LORA_DIR}/forwarder-utils-sx1303/
}

do_install_append_mtcdt() {
  install -m 755 ${WORKDIR}/global_conf.json.MTAC_003_0_0.EU868 ${D}${LORA_DIR}/
  install -m 755 ${WORKDIR}/global_conf.json.MTAC_003_0_0.US915 ${D}${LORA_DIR}/
}

do_install_append_mtcap() {
}


do_install_append_mtcap3() {
  install -m 755 ${WORKDIR}/global_conf.json.MTCAP3.EU868 ${D}${LORA_DIR}/
  install -m 755 ${WORKDIR}/global_conf.json.MTCAP3.US915 ${D}${LORA_DIR}/
}

do_install_append_mtcdt3() {
  install -m 755 ${WORKDIR}/global_conf.json.MTAC_003_0_0.EU868 ${D}${LORA_DIR}/
  install -m 755 ${WORKDIR}/global_conf.json.MTAC_003_0_0.US915 ${D}${LORA_DIR}/
}

do_install_append_mtcdt3hs() {
  install -m 755 ${WORKDIR}/global_conf.json.MTAC_003_0_0.EU868 ${D}${LORA_DIR}/
  install -m 755 ${WORKDIR}/global_conf.json.MTAC_003_0_0.US915 ${D}${LORA_DIR}/
}


FILES_${PN} += "${LORA_DIR}"

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