added pagernetz.at dummy for later use
This commit is contained in:
parent
3d5d7b53e5
commit
5432160001
4 changed files with 26 additions and 0 deletions
|
@ -12,6 +12,10 @@
|
|||
"enabled": true,
|
||||
"duplexTimeout": 300
|
||||
},
|
||||
"pagernetzAT": {
|
||||
"enabled": true,
|
||||
"duplexTimeout": 300
|
||||
},
|
||||
"pocsag": {
|
||||
"enabled": true,
|
||||
"duplexTimeout": 300
|
||||
|
|
3
index.js
3
index.js
|
@ -32,6 +32,9 @@ if (!!config.connectors.emPuppettering && config.connectors.emPuppettering.enabl
|
|||
types.ConnectorRegistry.register(new types.Connectors.eMessagePuppeteerConnectorTwoWays(connection))
|
||||
}
|
||||
|
||||
if (!!config.connectors.ecityruf && config.connectors.pagernetzAT.enabled === true) {
|
||||
types.ConnectorRegistry.register(new types.Connectors.PagernetzConnetorAT(connection))
|
||||
}
|
||||
|
||||
types.ConnectorRegistry.register(new types.Connectors.DummyConnector())
|
||||
|
||||
|
|
17
types/connectors/PagernetzConnetorAT.js
Normal file
17
types/connectors/PagernetzConnetorAT.js
Normal file
|
@ -0,0 +1,17 @@
|
|||
const Connector = require("./Connector")
|
||||
const md5 = require('md5')
|
||||
|
||||
const config = require('../../config.json')
|
||||
class PagernetzConnetorAT extends Connector {
|
||||
constructor (amqpConnMngr) {
|
||||
super(amqpConnMngr)
|
||||
this.name = "pagernetz-at"
|
||||
this.duplexCapable = true
|
||||
}
|
||||
async transmitMessage(msg, params) {
|
||||
const UUID = this.name+':'+md5(JSON.stringify([ this.name, ...params ])) // uuid=name+hash of name+args
|
||||
await new Promise((res)=>setTimeout(res,3e3))
|
||||
this.connectorRegistry.reportFail(msg, UUID)
|
||||
}
|
||||
}
|
||||
module.exports = PagernetzConnetorAT
|
|
@ -21,6 +21,8 @@ module.exports = {
|
|||
eMessagePuppeteerConnectorCityruf,
|
||||
eMessagePuppeteerConnectorTwoWays,
|
||||
|
||||
PagernetzConnetorAT: require('./PagernetzConnetorAT'),
|
||||
|
||||
LoRaWANConnector: require("./LoRaWANConnector"),
|
||||
POCSAGConnector: require("./POCSAGConnector"),
|
||||
DummyConnector: require("./DummyConnector"),
|
||||
|
|
Loading…
Add table
Reference in a new issue