Skip to content

Commit

Permalink
feat: Advertisement packet data logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Loodyy committed Dec 3, 2024
1 parent b07c416 commit fda66f8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/device/device.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ export abstract class deviceBase {
// Set an event handler
let serviceData = { model: this.device.bleModel, modelName: this.device.bleModelName } as ad['serviceData']
switchbot.onadvertisement = (ad: ad) => {
this.debugLog(`ad: ${JSON.stringify(ad, null, ' ')}`)
if (this.device.bleMac === ad.address && ad.serviceData.model === this.device.bleModel) {
this.debugLog(`${JSON.stringify(ad, null, ' ')}`)
this.debugLog(`address: ${ad.address}, model: ${ad.serviceData.model}`)
Expand Down

0 comments on commit fda66f8

Please sign in to comment.