From 767e6aee06e3e9b0d054b9d15e96069a150a6c0c Mon Sep 17 00:00:00 2001 From: cheetah Date: Tue, 23 Mar 2021 23:18:59 +0000 Subject: [PATCH] first version of status api, cleaned up code, and split LoRaWAN into 2 Connector Types --- index.js | 3 +++ types/RouteablePage.js | 6 ------ types/connectors/LoRaWANConnectorTXBridge.js | 11 +++++++++++ types/index.js | 1 - 4 files changed, 14 insertions(+), 7 deletions(-) delete mode 100644 types/RouteablePage.js create mode 100644 types/connectors/LoRaWANConnectorTXBridge.js diff --git a/index.js b/index.js index baed2fb..2ba94bf 100644 --- a/index.js +++ b/index.js @@ -37,5 +37,8 @@ app.post('/api/message/advanced', async (req, res) => { await types.MessageManager.Deliver(id) return res.json(id) }) +app.get('/api/message/status/:id', async (req, res) => { //TODO: make this fancy + return res.json(types.MessageManager.messages[ req.params.id ]) +}) app.listen(3000) \ No newline at end of file diff --git a/types/RouteablePage.js b/types/RouteablePage.js deleted file mode 100644 index 2a68c66..0000000 --- a/types/RouteablePage.js +++ /dev/null @@ -1,6 +0,0 @@ -class RouteablePage { - id - - constructor() { - } -} \ No newline at end of file diff --git a/types/connectors/LoRaWANConnectorTXBridge.js b/types/connectors/LoRaWANConnectorTXBridge.js new file mode 100644 index 0000000..97bc5fd --- /dev/null +++ b/types/connectors/LoRaWANConnectorTXBridge.js @@ -0,0 +1,11 @@ +const Connector = require("./Connector") + +class LoRaWANConnectorTXBridge extends Connector { + // this is optimized for transmitting Downlink Messages via a Special Bridge which overcomes Network Limitations + constructor (amqpConnMngr) { + super(amqpConnMngr) + this.name = "lorawanbridge" + this.duplexCapable = true + } +} +module.exports = LoRaWANConnectorTXBridge \ No newline at end of file diff --git a/types/index.js b/types/index.js index fb8b761..3c04bce 100644 --- a/types/index.js +++ b/types/index.js @@ -5,7 +5,6 @@ module.exports = { Connectors: require("./connectors"), devices: require("./devices"), Message: require("./Message"), - RouteablePage: require("./RouteablePage"), DeviceRegistry: require("./DeviceRegistry"), MessageManager: require("./MessageManager"),