Skip to content

Commit 784ab1a

Browse files
committed
Add event field
1 parent 43ee9f2 commit 784ab1a

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ The server:
2323
* Invokes internal modules with application logic. It provides examples for:
2424
* [Semtech/IMST LoRaMote](http://webshop.imst.de/loramote-lora-evaluation-tool.html)
2525
* [Microchip LoRa(TM) Technology Mote](http://www.microchip.com/Developmenttools/ProductDetails.aspx?PartNO=dm164138)
26+
* Automatically parses well-known payload formats. It currently supports:
27+
* [Cayenne Low Power Payload](https://github.com/myDevicesIoT/cayenne-docs/blob/master/docs/LORA.md#cayenne-low-power-payload)
2628
* Invokes external applications. It currently supports connections via:
2729
* WebSocket protocol [RFC6455](https://tools.ietf.org/rfc/rfc6455.txt)
2830
* HTTP/1.1 and HTTP/2 protocol (REST API)

doc/Handlers.md

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ applications the following fields:
6464
fcnt | Integer | U | Received frame sequence number.
6565
port | Integer | U | LoRaWAN port number.
6666
data | Hex String | U | Raw application payload, encoded as a hexadecimal string.
67+
event | String | J DL | Event name (joined, delivered, lost).
6768
datetime | ISO 8601 | U J DL | Timestamp using the server clock.
6869
freq | Number | U | RX central frequency in MHz (unsigned float, Hz precision).
6970
datr | String | U | LoRa datarate identifier (eg. "SF12BW500").

priv/admin/admin.js

+1
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,7 @@ myApp.config(['NgAdminConfigurationProvider', function (nga) {
800800
{ value: 'fcnt', label: 'fcnt' },
801801
{ value: 'port', label: 'port' },
802802
{ value: 'data', label: 'data' },
803+
{ value: 'event', label: 'event' },
803804
{ value: 'datetime', label: 'datetime' },
804805

805806
{ value: 'freq', label: 'freq' },

src/lorawan_application_backend.erl

+2-1
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ handle_delivery({_Network, #profile{app=AppID}, Node}, Result, Receipt) ->
149149
send_event(Event, Vars0, #handler{app=AppID, parse_event=Parse, fields=Fields}, DeviceOrNode) ->
150150
Vars =
151151
vars_add(app, AppID, Fields,
152+
vars_add(event, Event, Fields,
152153
vars_add(datetime, calendar:universal_time(), Fields,
153154
case DeviceOrNode of
154155
{#device{deveui=DevEUI, appargs=AppArgs}, DevAddr} ->
@@ -161,7 +162,7 @@ send_event(Event, Vars0, #handler{app=AppID, parse_event=Parse, fields=Fields},
161162
vars_add(deveui, get_deveui(DevAddr), Fields,
162163
vars_add(appargs, AppArgs, Fields,
163164
Vars0)))
164-
end)),
165+
end))),
165166
lorawan_backend_factory:event(AppID, DeviceOrNode,
166167
data_to_fields(AppID, Parse, Vars, Event)).
167168

0 commit comments

Comments
 (0)