sclausen / ngx-mqtt

This library isn't just a wrapper around MQTT.js for angular. It uses observables and takes care of subscription handling and message routing.

Home Page:https://sclausen.github.io/ngx-mqtt/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

onPacketreceive/onPacketsend observables don't include packet's info

sinexflecs opened this issue · comments

Hi,

I've been trying to use the onPacketreceive/onPacketsend events to collect data from the packets without success.

The event is triggered but the packet data is always undefined:

this._mqttService.onPacketreceive.asObservable()
    .subscribe(t => {
        console.log('onPacketreceive', t);
    });
this._mqttService.onPacketsend.asObservable()
    .subscribe(packet => {
        console.log('onPacketsend', packet);
    });

image

Everything else works fine, except this.

Am I using it wrong?

Thanks!

Yes, you're right, that was an actual bug. Thank's for noticing.