This is a mirror of official site: http://jasper-net.blogspot.com/

Sensor7.NET

| Sunday, November 14, 2010
Project Description
Sensor7.NET is the COM Wrapper implemented IDispatch interface for Windows 7 Sensor API.
You can use Windows 7 Sensor API feature in your Silverlight OOB applications or Desktop Gadgets via this COM Wrapper.
Please enjoy it!

You need Visual Studio 2010.

Installation
Build solution.
Execute SensorCOMW.exe on command window as follows when you use this COM assembly on the other PC.

> SensorCOMW.exe /RegServer

In your Silverlight OOB application.

Case 1: You can use sensor as Synchronous style.


using (dynamic sensor7com = AutomationFactory.CreateObject("Sensor7COMW.DispSensorManager"))
{
// get sensors by sensor type (this case: COMPASS_3D) which is defined in Windwos 7 SDK.
using (dynamic mgSensors = sensor7com.GetSensorsByTypeId("{76B5CE0D-17DD-414D-93A1-E127F40BDF6E}"))
{
dynamic sensor = mgSensors.GetAt(0);
if (sensor != null)
{
dynamic sensorData = sensor.SensorData;
// get sensed data specified by sensor data type Pid and FmtId(this case:compansated magnetic north degree) in the Windows 7 SDK.
dynamic degree = sensorData.GetPropertyValue("{1637D8A2-4248-4275-865D-558DE84AEDFD}",11);
dynamic timeStamp = sensorData.TimeStamp;
textBlockNorthDegree.Text = String.Format("{0} - {1}", degree.ToString(), timeStamp.ToString);
}
}
}

Read more: Codeplex

Posted via email from .NET Info

0 comments: