How to Interface with Windows Universal App ? #911
Replies: 11 comments
-
Posted at 2017-01-04 by @gfwilliams Hi, I'd look at this: https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/BluetoothAdvertisement Specifically the Advertisement 'watcher'. The question then is how you advertise your information for the 'watcher' to see. To start, on your Puck you can run:
Once you disconnect from it, the Puck will start advertising the temperature - which you should be able to read with your app. You're quite limited by the amount of data you can send in advertising packets, so I'd consider packing it all together. For example if you upload this:
Then it'll advertise 2 bytes - the temperature and the 'alarm' - with Bluetooth UUID 0xFFFF. When you press the button the alarm will turn to 1 and the red LED will start blinking, or if you hold it for >5 seconds and release the alarm will turn off. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-09 by user71866 Hi Gordon , |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-09 by user71866 Hi Gordon , The thing is that I want to limit (add filter) the number of devices and read only the puck devices. The class has a CompanyID property and the Data. When you put the CompanyID as a filter the watcher reads only this device. Take a look at the below code .
The example puts a value manufacturerData.CompanyId = 0xFFFE; Appreciate your guidance on this. thank you |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-09 by user71866 Can you please point me from the Below list which value should I place ? https://www.bluetooth.com/specifications/assigned-numbers/company-identifiers |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-09 by @gfwilliams Hi - as I understand it, no Company ID is specified in the Puck's advertising data. I don't have a unique ID either, as that costs a lot of money. Can you not filter advertisements based on |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-09 by user71866 I wanted to limit the search but if it cannot be done... There is a property which says if it is paired so I can check that . |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-18 by user71866 Hi Gordon , But if I press it I don't see any change in the transmission. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-18 by @gfwilliams And the Puck is flashing the red LED when this is happening? I just tried this and if you scan using the
So I'm not quite sure what you're seeing in the UWP app, but it doesn't appear to be the advertising data that the Puck is sending (or even some part of it). I'd focus on getting your UWP app so that it can report the exact same advertising data that |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-18 by user71866 Hi Gordon, Attachments: |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-18 by @gfwilliams I'm afraid I can't - I spend an awful lot of time supporting Puck.js and developing the firmware and tools for it. I have to draw the line at helping you develop an application on a completely different platform that I have never used before, when I've already written code for you on Puck.js that is working fine. Perhaps someone else on here might be able to help? Otherwise stackoverflow.com would probably be a good place to ask. There's already this question and answer that might help: http://stackoverflow.com/questions/41425293/uwp-ble-advertising-read-data |
Beta Was this translation helpful? Give feedback.
-
Posted at 2017-01-18 by user71866 Hi Gordon , |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2017-01-04 by user71866
Hi ,
I 'm going to need some information and want to know if it is feasible to do some extra things.
I have successfully paired the puck.js with my windows 10 laptop , able to send commands through the Web IDE ...Everything is working fine.
I have tested also an example from Microsoft with bluetooth devices and Microsoft's example returns the device . some characteristics , gatt etc. All these using C# and universal apps.
I want to know if it is possible to get readings from puck.js inside a Universal App and displays them there.
Is it something that it can be done ?
What code(javascript) do I need to send to the puck device in order to get the readings ? Meaning that I need to check the temperature , if the light is flashing , if the button is pressed ?
Can I display those reading inside a Universal App using C# ?
I found the below link
https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/DeviceEnumerationAndPairing
and some other examples
https://github.com/Microsoft/Windows-universal-samples/tree/master/Samples/BluetoothRfcommChat
were I can see the Device but I don't know what else do I need to do in the puck.js to transmit all the readings.
Are this device compatible with the above examples?
Appreciate your assistance on this.
Beta Was this translation helpful? Give feedback.
All reactions