Retrieve full device twin data on device twin changed events - iot

I would like to retrieve the full device twin data on the desired device twin or reported property changed. I was trying with below query filter but getting error.
An unknown error occurred while updating your IoT hub. Error Report: Invalid Routing Condition, RouteName:DeviceTwin-RptProp-Changed-dev, ErrorMessage:Message:Syntax error., Location :1:15, :1:22, Severity:Error . If you contact a support representative please include this correlation identifier: 3ef0e2ff-60c1-4133-af86-7e506af86faf, timestamp: 2021-11-29 04:24:01Z, errorcode: IH400104.
SELECT * FROM devices WHERE
is_object($body.properties.desired)

The following should work.
To retrieve desired properties of your devices:
SELECT properties.desired
To retrieve reported properties of your devices:
SELECT properties.reported

Related

Error loading a TF lite format model in ios device for custom object detection

I have trained a custom object detection, using transfer learning based on MobileNetV2. I converted the model to tflite format so that I can run it on my IOS device. However, when I run the model in xcode, I get an error.
2019-08-20 16:11:07.225613+0100 ObjectDetection[5692:1119136]
Initialized TensorFlow Lite runtime.
2019-08-20 16:11:07.280287+0100 ObjectDetection[5692:1119136] [MC]
System group container for
systemgroup.com.apple.configurationprofiles path is
/var/containers/Shared/SystemGroup/systemgroup.com.apple.configu
rationprofiles
2019-08-20 16:11:07.282075+0100 ObjectDetection[5692:1119136] [MC]
Reading from public effective user settings.
**Failed to invoke the interpreter with error: Provided data count
1080000 must match the required count 602112.
Failed to invoke the interpreter with error: Provided data count
1080000 must match the required count 602112.**

How to get filtered target device information from windows upper class filter

I'm writing a upper class filter for WPD device. I specified the callback functions for the Read/Write/Ioctl, from the callback declaration I could get the WDFQueue, WDFRequest.
VOID WdfFltrDeviceControl(IN WDFQUEUE Queue, IN WDFREQUEST Request, IN size_t OutputBufferLength, IN size_t InputBufferLength, IN ULONG IoControlCode)
But from the parameter Queue or Request, I could only get the information of device which is created by my driver. Is there any way to retrieve the informations of the attached devices which my driver is currently filtering?(e.g. From the kernel log I can see the ioctl request to my android device, but I don't know how to get the android device object to get the device name)
You are really should be able to get information about your WPD device request using parameters of this method. If you are not, probably your code or .inf filter setup is wrong.
You can use this code snippet to check what device you are filtering now:
WDFDEVICE device = WdfIoQueueGetDevice(Queue);
WCHAR id[255];
ULONG resultLength;
NTSTATUS status = WdfDeviceQueryProperty(device, DevicePropertyHardwareID, sizeof(id), id, &resultLength);
if(NT_SUCCESS(status))
{
//check the device id here
}
Or, if you prefer some another parameter, you could find the list here

How to pair with another BLE device using Ionic?

so in this question I asked how would I identify a bluetooth device after doing an scan. It seems that only those devices I have connected to show their name, all other devices are shown as unnamed.
So my question is, how do I pair all the unnamed devices using the Ionic Native BLE library? It doesn't matter if I need to do a manual process for each one (since this will be done only once). Thanks in advance.
Using your example, when you scan you get objects like this:
{
id: "2BD5D5A7-EF50-B4F4-D4FD-9A8413006D4B",
rssi: -24,
advertising: {
kCBAdvDataIsConnectable: true
},
name: ""
}
where name is an empty string which is your term unnamed.
You can check if the name is an empty string, take the id value instead to establish BLE connection.
ble.connect("2BD5D5A7-EF50-B4F4-D4FD-9A8413006D4B", connectSuccess, connectFailure);

GetDescriptor() null value / 128-bit UUID descriptor?

I'm writing my code using Xamarin. I'm developing my IOS app which allows me to read the BLE devices, Services, characteristic value and activation of the notification.
My BLE beacon have one custom Services that contain two custom characteristics and both have the notification implemented using CCCD.
My ble devices work correctly I test it with BLE scanner app and it working well without any problem.
I can read value and I can active the notification for both characteristic. See picture here.
The app that I wrote using xamarin work correctly (reading services, characteristic value....) the only problem that didn't work is the activation of the notification. Here's a portion of the code :
public UUID Charac_UUID0 = UUID.FromString("0000beef-1212-efde-1523-785fef13d123");
public UUID Charac_UUID = UUID.FromString("0000b1e0-1212-efde-1523-785fef13d123") ;
public UUID Descr_UUID = UUID.FromString("00002902-1212-efde-1523-785fef13d123");
protected BluetoothGattCharacteristic _charac;
....
....
this._charac = App.Current.State.SelectedService.GetCharacteristic(Charac_UUID0);
BluetoothLEManager.Current.ConnectedDevices[App.Current.State.SelectedDevice].SetCharacteristicNotification(_charac, true);
BluetoothGattDescriptor descriptor = _charac.GetDescriptor(Descr_UUID0);
descriptor.SetValue(BluetoothGattDescriptor.EnableNotificationValue.ToArray());
BluetoothLEManager.Current.ConnectedDevices[App.Current.State.SelectedDevice].WriteDescriptor(descriptor);
The code always give me an error at descriptor.SetValue and it indicate me that the descriptor is NULL meaning that _charac.GetDescriptor didn't return any value.
I suspect the Descriptor UUID value (Descr_UUID) is not correct. I don't know excatly how can I determine the Descr_UUID but I saw many example in the internet of people replacing the custom UUID of the caracteristic by 2902 which give me in my case a 128 descriptor UUID equal to 00002902-1212-efde-1523-785fef13d123.
But there is a problem here. The descriptor UUID for both characteristic will be the same because the base UUID is the same for both characteristic?
Any solution?
3 years later im sure you figured it out but, 2902 is the 16 bit value for a Client Characteristic Configuration Descriptor, and I believe it should also be inflated using the "BASE UUID" not just whatever your characteristic descriptor uses. See this: answer
This will convert your 16 (or 32) bit uuids to full 128 bit uuids using the BASE UUID:
public static UUID ConvertUuid(uint uuid)
{
const long msbMask = 0x0000000000001000;
const ulong lsb = 0x800000805f9b34fb;
var msb = msbMask | ((ulong)(uuid & uint.MaxValue) << 32);
return new UUID((long)msb, unchecked((long)lsb));
}

Other causes for DirectShow "no combination of intermediate filters could be found" errors?

I have a Delphi 6 application that uses the DSPACK DirectShow component library. Currently I am getting the error "no combination of intermediate filters could be found" when I attempt to connect the Capture pin on an audio capture device to the Input pin of another filter. I believe I am setting the media formats correctly. I have an error trap and in that trap I query explicitly both pins for the exact media format they are set to in case there is an incongruity. When I do this, both pins come back with the exact same WAV format:
format tag: 1
number of channels: 1
bits per sample: 16
sample rate: 8000
That matches up to what I set both filters to, yet I am getting an error that (usually as far as I know) indicates a format incompatibility. Has anyone run into this error before and knows what I might be doing wrong or what other kinds of tests/inspections I can do?
It turns out the error was being caused by the media format I was returning from my push source audio filter. I had the wrong sub-type and that was triggering the "no combination of intermediate filters could be found" error from DirectShow since the sub-type I was using in my push source filter was incorrect and not compatible with other filters like the Capture filter I was using in my filter graph. See the "UPDATE" note in my thread on media format's for full details:
Correct Media Type settings for a DirectShow filter that delivers Wav audio data?

Resources