lora-packet-forwarder-client

module
v0.0.0-...-3a83b89 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2017 License: MIT

README

LoRa Packet Forwarder Client

Enables communication with the LoRa Packet Forarder from Semtech.

The code is based on the LoRa Gateway Bridge which is also used in the TTN Packet Forwarder Bridge but targets a more generic aproach to talk to the Gateway, e.g. you can receive packets with wrong CRC and there is no dependencie to LoRaWAN specifics like lorawan.EUI64.

Usage

Make sure you have a LoRa Packet Forarder configured to communicate with the client endpoint. You can find example configs and code in /examples: usage.go and local_conf.json

func main() {
	client, err := gateway.NewClient(
		":1680",
		func(gwMac gateway.Mac) error {
			return nil
		},
		func(gwMac gateway.Mac) error {
			return nil
		},
	)

	if err != nil {
		panic(err)
	}

	defer client.Close()

	log.Info("Waiting for gateway packet ...")
	msg := <-client.RXPacketChan()
	log.Infof("Received packet from Gateway with phy payload %v", msg.PHYPayload)

	log.Info("Exit")
}

License

LoRa Gateway Bridge is distributed under the MIT license. See LICENSE.

Directories

Path Synopsis
band
Package band provides band specific defaults and configuration.
Package band provides band specific defaults and configuration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL