some changes
This commit is contained in:
14
src/main.ts
14
src/main.ts
@ -1,14 +1,18 @@
|
||||
import * as log from './log'
|
||||
import * as MqttClient from './mqttclient'
|
||||
import * as mqtt from './mqttclient'
|
||||
|
||||
class Dispatcher {
|
||||
private _mqttClient: MqttClient.MqttClient
|
||||
private _mqttClient: mqtt.MqttClient
|
||||
|
||||
constructor() {
|
||||
this._mqttClient = new MqttClient.MqttClient()
|
||||
this._mqttClient = new mqtt.MqttClient()
|
||||
|
||||
this._mqttClient.register('IoT/test', null)
|
||||
this._mqttClient.register('IoT/Device/#', null)
|
||||
this._mqttClient.register('IoT/test', (message: any) : any => {
|
||||
log.info("Callback for IoT/test")
|
||||
log.info(`message is ${message}`)
|
||||
return `<<${message}>>`
|
||||
})
|
||||
this._mqttClient.register('IoT/Device/#', mqtt.passThrough)
|
||||
}
|
||||
|
||||
exec() : void {
|
||||
|
Reference in New Issue
Block a user