Avatar for user71866

user71866

Member since Jan 2017 • Last active Feb 2017
  • 1 conversations
  • 8 comments

Most recent activity

  • in Interfacing
    Avatar for user71866

    Hi Gordon ,
    I will take a look at it . Thank you

  • in Interfacing
    Avatar for user71866

    Hi Gordon,
    I have sent you Microsoft's example with some changes I 'm trying to do in order to get the data. It is the UWP and run the First Scenario. When you run the UWP press the run button and you will see the changes I have made in the Scenario1_Watcher.cs file
    This is what I have in UWP.
    Can you please assist to parse puck's data ?
    thank you

  • in Interfacing
    Avatar for user71866

    Hi Gordon ,
    From my example app I'm getting this as Data. When I don't press the button
    42-04-01-80-2C-78-BD-BC-0B-BE-66-7A-BD-B­C-0B-BE-65-01-00-00-00-00-00-00

    But if I press it I don't see any change in the transmission.
    I used your Jscript exactly as you send me.
    What "string" should I expect or what will be the exact type of format that I should expect ?
    Remember I'm using C#.
    Please assist.
    thank you

  • in Interfacing
    Avatar for 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 .

  • in Interfacing
    Avatar for user71866

    Can you please point me from the Below list which value should I place ?

    bluetooth.com/specifications­/assigned-numbers/company-identifiers

  • in Interfacing
    Avatar for user71866

    Hi Gordon ,
    I was able to get all the data from puck using the advertising example of Microsoft.
    Microsoft provides a class BluetoothLEManufacturerData were you can get the CompanyId and the data. To make Microsoft's example to work I had to comment all the filters(this class takes filters to limit the bluetooth devices) and that resulted to return me everything..

    msdn.microsoft.com/en-us/library­/windows/apps/windows.devices.bluetooth.­advertisement.bluetoothlemanufacturerdat­a?f=255&MSPPError=-2147217396

    The thing is that I want to limit (add filter) the number of devices and read only the puck devices.
    I was wondering how to do that.

    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 .

            // Begin of watcher configuration. Configure the advertisement filter to look for the data advertised by the publisher 
            // in Scenario 2 or 4. You need to run Scenario 2 on another Windows platform within proximity of this one for Scenario 1 to 
            // take effect. The APIs shown in this Scenario are designed to operate only if the App is in the foreground. For background
            // watcher operation, please refer to Scenario 3.
    
            // Please comment out this following section (watcher configuration) if you want to remove all filters. By not specifying
            // any filters, all advertisements received will be notified to the App through the event handler. You should comment out the following
            // section if you do not have another Windows platform to run Scenario 2 alongside Scenario 1 or if you want to scan for 
            // all LE advertisements around you.
    
            // For determining the filter restrictions programatically across APIs, use the following properties:
            //      MinSamplingInterval, MaxSamplingInterval, MinOutOfRangeTimeout, MaxOutOfRangeTimeout
    
            // Part 1A: Configuring the advertisement filter to watch for a particular advertisement payload
    
            // First, let create a manufacturer data section we wanted to match for. These are the same as the one 
            // created in Scenario 2 and 4.
            var manufacturerData = new BluetoothLEManufacturerData();
    
            // Then, set the company ID for the manufacturer data. Here we picked an unused value: 0xFFFE
            **manufacturerData.CompanyId = 0xFFFE;**
    
    
            // Finally set the data payload within the manufacturer-specific section
            // Here, use a 16-bit UUID: 0x1234 -> {0x34, 0x12} (little-endian)
            var writer = new DataWriter();
            writer.WriteUInt16(0x1234);
    
            // Make sure that the buffer length can fit within an advertisement payload. Otherwise you will get an exception.
            manufacturerData.Data = writer.DetachBuffer();
    
            // Add the manufacturer data to the advertisement filter on the watcher:
            watcher.AdvertisementFilter.Advertisemen­t.ManufacturerData.Add(manufacturerData)­;
    
    
            // Part 1B: Configuring the signal strength filter for proximity scenarios
    
            // Configure the signal strength filter to only propagate events when in-range
            // Please adjust these values if you cannot receive any advertisement 
            // Set the in-range threshold to -70dBm. This means advertisements with RSSI >= -70dBm 
            // will start to be considered "in-range".
            watcher.SignalStrengthFilter.InRangeThre­sholdInDBm = -70;
    
            // Set the out-of-range threshold to -75dBm (give some buffer). Used in conjunction with OutOfRangeTimeout
            // to determine when an advertisement is no longer considered "in-range"
            watcher.SignalStrengthFilter.OutOfRangeT­hresholdInDBm = -75;
    
            // Set the out-of-range timeout to be 2 seconds. Used in conjunction with OutOfRangeThresholdInDBm
            // to determine when an advertisement is no longer considered "in-range"
            watcher.SignalStrengthFilter.OutOfRangeT­imeout = TimeSpan.FromMilliseconds(2000);
    
            // By default, the sampling interval is set to zero, which means there is no sampling and all
            // the advertisement received is returned in the Received event
    
            // End of watcher configuration. There is no need to comment out any code beyond this point.
    

    The example puts a value manufacturerData.CompanyId = 0xFFFE;
    In our case with the Puck device what should I put in order to tell the watcher to read only the puck.js?
    Is this value changes everytime ?

    Appreciate your guidance on this.

    thank you

  • in Interfacing
    Avatar for user71866

    Hi Gordon ,
    I will take a look at it and revert .
    Thank you

  • in Interfacing
    Avatar for 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
    github.com/Microsoft/Windows-uni­versal-samples/tree/master/Samples/Devic­eEnumerationAndPairing
    and some other examples
    github.com/Microsoft/Windows-uni­versal-samples/tree/master/Samples/Bluet­oothRfcommChat
    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.

Actions