-
-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add function for get ManufacturerData and AdvertisingData #53
Conversation
Add function for get ManufacturerData and AdvertisingData
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
@@ -57,7 +61,7 @@ declare namespace NodeBle { | |||
getAlias(): Promise<string>; | |||
isPowered(): Promise<boolean>; | |||
isDiscovering(): Promise<boolean>; | |||
startDiscovery(): Promise<void>; | |||
startDiscovery(options?: {transport?: string, duplicateData?: boolean}): Promise<void>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.