Skip to content

Add function for get ManufacturerData and AdvertisingData - #53

Closed
Raffone17 wants to merge 6 commits into
chrvadala:mainfrom
arolgroup:main
Closed

Raffone17 wants to merge 6 commits into
chrvadala:mainfrom
arolgroup:main

Conversation

@Raffone17

Copy link
Copy Markdown
Contributor

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

@chrvadala chrvadala left a comment

Copy link
Copy Markdown
Owner

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
Copy Markdown

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

@Raffone17

Copy link
Copy Markdown
Contributor Author

@chrvadala I integrated some unit tests, any news?

@gmacario

Copy link
Copy Markdown

@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 thread src/Adapter.js
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
Copy Markdown
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 thread src/Device.js
Comment on lines +23 to +28
if ('ManufacturerData' in propertiesChanged) {
const { value } = propertiesChanged.ManufacturerData
if (value) {
this.emit('manufacturerData', value)
}
}

Copy link
Copy Markdown
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.

Comment thread src/index.d.ts
isPowered(): Promise<boolean>;
isDiscovering(): Promise<boolean>;
startDiscovery(): Promise<void>;
startDiscovery(options?: {transport?: string, duplicateData?: boolean}): Promise<void>;

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

Superseed by #61

@chrvadala

Copy link
Copy Markdown
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.

5 participants