You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
624 B
JavaScript

4 years ago
const { POCSAGConnector } = require("./connectors")
class ConnectorRegistry {
constructor() {
this.Connectors = {}
}
register(connector) {
this.Connectors[ connector.name ] = connector
}
transmit(name, msg, params) {
4 years ago
if (!this.Connectors[ name ]) throw "not registred"
this.Connectors[ name ].transmitMessage(msg, params)
4 years ago
}
supportDuplex(name) {
if (!this.Connectors[ name ]) throw "not registred"
return this.Connectors[ name ].duplexCapable
}
receive(id, data) {
}
4 years ago
}
const registry = new ConnectorRegistry()
module.exports = registry