public short TiltX; // From -1000 to 1000 (about), 0 is flat
public short TiltY; // From -1000 to 1000 (about), 0 is flat
public short TiltZ; // From -1000 to 1000 (about), 0 = Straight up, -1000 = Flat, 1000 = Upside down
public short Unknown1; // Always zero
public int AngleY; // From 0 to 359
public int AngleX; // From 0 to 359
public int Unknown2; // Bit field?
I assume you mean "HTCSensorOpen". Do you have an HTCSensorSDK.dll file on the device? That message might mean the dll was found but lacked the required entry point.- unable to find an entry point named HTCSendorOpen in DLL HTCSensorSDK
Sub App_Start
Form1.Show
sen.New1
'TextBox1.Text = sen.GetRawSensorData
Msgbox(sen.ToString)
End Sub
Any further information with that exception? That message is the exception type, I would have expected an additional message as well.when I use the GetRawSensorData I get a "NotSupportedException"
No there is nothing else.. I've attached a screenshotIh has found the dll and the intialisation entry point or it wouldn't have got that far.
Any further information with that exception? That message is the exception type, I would have expected an additional message as well.
Wrong! There is a lot more information there. It shows how important it is to describe exactly and in detail rather than just saying an exception occurred.No there is nothing else
You have to assign the returned data to an array and pick it apart from there. The array will be an array of bytes that you have to transform to the required numbers. With my ByteConverter library it looks likes this (there may be typos/errors, I haven't actually tried the code).Dim data(0)
...
HTCGSensor.New
...
data() = HTCGSensor.GetRawSensorData
In the unlikely event that it works the data is returned in a 20 byte array described in the struct at the start of the source file in the zip. You can reassemble the data the hard way by multiplying and adding bytes or by using my ByteConverter library
TiltX = ByteConv.Int16FromBytes(data(), 0) ' From -1000 to 1000 (about), 0 is flats
TiltY = ByteConv.Int16FromBytes(data(), 2) ' From -1000 to 1000 (about), 0 is flatshort
TiltZ = ByteConv.Int16FromBytes(data(), 4) ' From -1000 to 1000 (about), 0 is flat
Unknown1 = ByteConv.Int16FromBytes(data(), 6) ' Always zero
AngleY = ByteConv.Int32FromBytes(data(), 8) 'From 0 to 359
AngleX = ByteConv.Int32FromBytes(data(), 12) 'From 0 to 359
Unknown2 = ByteConv.Int16FromBytes(data(), 16) ' Bitfield?
Wrong! There is a lot more information there. It shows how important it is to describe exactly and in detail rather than just saying an exception occurred.
Sub Globals
Dim data(0)
End Sub
Sub App_Start
Form1.Show
End Sub
Sub Button1_Click
HTCGSensor.New1
data() = HTCGSensor.GetRawSensorData
Msgbox(ArrayLen(data()))
End Sub
Pity it doesn't tell us what is not supportedNotSupportedException
You will need to play. Add my ByteConverter library as a component, make an object called ByteConv and use the code I posted in #11 to take the data apart. You won't see those values I posted in #4 until you have parsed the data back into the correct format.is this something that can be deducted using your byteconverter lib?
The GSensor API now supports the Samsung Instinct/Omnia!
Sorry but it is too big a job at the moment. The original code is a Visual Studio 2008 project which I can't load in my VS2005 so I had to start the HTC library project from scratch. What's more difficult is that I don't have a Samsung device for testing whereas I do have an HTC Diamond.Any change you could make your sensor.dll also work on an Omina?