Repository navigation
Conversation
Add function for get ManufacturerData and AdvertisingData
chrvadala
left a comment
There was a problem hiding this comment.
Hello, thanks for this useful PR. Can you integrate it with some unit tests.
Thank you very much
Add Manufacturer data to device events and avoid duplicate date
|
Looks like it has the required unit tests, are you ok with the changes @chrvadala ? |
|
@chrvadala I integrated some unit tests, any news? |
Hello @chrvadala, Any chances that either this PR or #61 get reviewed and possibly merged? Thanks, |
| async startDiscovery (options = {}) { | ||
| if (await this.isDiscovering()) { | ||
| throw new Error('Discovery already in progress') | ||
| } | ||
|
|
||
| if (typeof options !== 'object') { | ||
| throw new Error('Wrong parameter') | ||
| } | ||
| options = Object.assign({ transport: 'le', duplicateData: true }, options) | ||
| await this.helper.callMethod('SetDiscoveryFilter', { | ||
| Transport: buildTypedValue('string', 'le') | ||
| Transport: buildTypedValue('string', options.transport), | ||
| DuplicateData: buildTypedValue('boolean', options.duplicateData) | ||
| }) |
There was a problem hiding this comment.
is this part related to the current PR? It seems that belongs to a different feature
| if ('ManufacturerData' in propertiesChanged) { | ||
| const { value } = propertiesChanged.ManufacturerData | ||
| if (value) { | ||
| this.emit('manufacturerData', value) | ||
| } | ||
| } |
There was a problem hiding this comment.
I understand that you want to proxy the Manufacturer change event to the Device event handler, but currently this isn't available for the rest of props. I prefer to be consistent in the project and remove this part for now.
| isPowered(): Promise<boolean>; | ||
| isDiscovering(): Promise<boolean>; | ||
| startDiscovery(): Promise<void>; | ||
| startDiscovery(options?: {transport?: string, duplicateData?: boolean}): Promise<void>; |
There was a problem hiding this comment.
is this needed by the current PR?
|
Superseed by #61 |
|
Released with 1.11 |
Add function for get ManufacturerData and AdvertisingData to the Device Interface.