first version of status api, cleaned up code, and split LoRaWAN into 2 Connector Types

This commit is contained in:
cheetah 2021-03-23 23:18:59 +00:00
parent 91226efa79
commit 767e6aee06
4 changed files with 14 additions and 7 deletions

View file

@ -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)

View file

@ -1,6 +0,0 @@
class RouteablePage {
id
constructor() {
}
}

View file

@ -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

View file

@ -5,7 +5,6 @@ module.exports = {
Connectors: require("./connectors"),
devices: require("./devices"),
Message: require("./Message"),
RouteablePage: require("./RouteablePage"),
DeviceRegistry: require("./DeviceRegistry"),
MessageManager: require("./MessageManager"),