Skip to content
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

Closed
wants to merge 6 commits into from

Conversation

Raffone17
Copy link
Contributor

Add function for get ManufacturerData and AdvertisingData to the Device Interface.

Copy link
Owner

@chrvadala chrvadala left a 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

@lesleyxyz
Copy link

Looks like it has the required unit tests, are you ok with the changes @chrvadala ?

@Raffone17
Copy link
Contributor Author

@chrvadala I integrated some unit tests, any news?

@gmacario
Copy link

@chrvadala I integrated some unit tests, any news?

Hello @chrvadala,

Any chances that either this PR or #61 get reviewed and possibly merged?

Thanks,
Gianpaolo

Comment on lines +78 to 89
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)
})
Copy link
Owner

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

Comment on lines +23 to +28
if ('ManufacturerData' in propertiesChanged) {
const { value } = propertiesChanged.ManufacturerData
if (value) {
this.emit('manufacturerData', value)
}
}
Copy link
Owner

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>;
Copy link
Owner

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?

@chrvadala
Copy link
Owner

Superseed by #61

@chrvadala
Copy link
Owner

Released with 1.11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants