Jump to content
The simFlight Network Forums

set FSUIPC Offset via Webpage


Recommended Posts

Hello,

 

i want to ask if it is possible to set a FSUIPC Offset ( FSX Door open SHIFT + E as example ) via a Webpage mayby using Java?

 

The Background is i have a program which can call a Website like http://localhost/opendoors.html?Door1 or something like that.

But it can not call a executable.

At my local pc which runs the FSX i want to run a webserver and call this site from the

Programm to open the Doors.

 

Is there a way?

 

Thx

Matthias

Link to comment
Share on other sites

i want to ask if it is possible to set a FSUIPC Offset ( FSX Door open SHIFT + E as example ) via a Webpage mayby using Java?

 

Well there is a Java interface package for FSUIPC included in the FSUIPC SDK. Didn't you look at that? OI'm afraid I have no idea, but if you can do it in JAVA then you have the interface.

 

Pete

Link to comment
Share on other sites

thanks, i never used Java...i used a litle bit C# with SharpDevelop, but have not really much expierence.

@Java i have less then in C#.

 

So .. is it ok to ask for a litle bit Feature help?

 

Well, someone visiting here may possibly be able to help, but it won't be me. You might be better off asking in a Forum where there are more Java users -- a web developers forum I suppose.

 

Pete

Link to comment
Share on other sites

i mean that maybe any other Member can help me.

 

Matthias

 

Maybe. Perhaps you should re-post your question as a more explicit plea for help i.e. a title like "Please help me access FSUIPC offset from a web page". I'll not answer that thread then someone might feel they could help seeing no responses.

 

Maybe also post in other forums where folks may be more likely to be doing web-based things. 

 

Regards

Pete

Link to comment
Share on other sites

He Pete,

i am on the way to get it working :smile: ... cool :smile:

But i have a litle Problem.

I have defined a Offset for the Doors like this:

private Offset<byte[]> o_doors = new Offset<byte[]>(0x3367, 4); // Offset for doors

Now i am able to READ the Door Offset via

o_doors.Value[0].ToString()

That works and gives me the correct values.

But i tried to WRITE into this Offset and this will not work??

I tried it like this:

o_doors.Value[0] = 0;

or

o_doors.Value[0] = 1;

Before i Change and read the Values i Open the FSUIPC , Process and after that Close the FSUIPC Connection.

Can you help here ?

Thanks

Matthias

Link to comment
Share on other sites

I have defined a Offset for the Doors like this:

private Offset<byte[]> o_doors = new Offset<byte[]>(0x3367, 4); // Offset for doors

 

I don't know what language that is, but if the "4" means 4 bytes then it is wrong -- the 3367 offset is a one-byte value.

 

But i tried to WRITE into this Offset and this will not work??

I tried it like this:

o_doors.Value[0] = 0;

or

o_doors.Value[0] = 1;

 

 

The doors offset 3367 is a collection of BITS, not a single value. You have to change only the bit you want and leave the others alone -- so you need a bit of logic programming.

 

And because I don't know what language that is I've no idea what it does.

 

Before i Change and read the Values i Open the FSUIPC , Process and after that Close the FSUIPC Connection.

The sequence should be:

 

1. Open the connection at the start of your complete program

 

2. Request all the reads and writes you want, one after the other. This just builds up a list in memory

 

3. Send it to FSUIPC by the Process call.

 

4. Wat a while to allow FS some time

 

5. Repeat from step 2 until finished program

 

6. Close the connection

 

7. Exit program.

 

There are examples in C and other languages in the SDK. I can only help with C and ASM.

 

Don't forget you can see what is going on in FSUIPC by using its logging facilities, and experiment using FSInterrogate.

 

Regards

Pete

Link to comment
Share on other sites

Hello,

i got it working ... but now i have the next Problem .. sorry.

How can i send a Key to FSX?

Thats for Ground Service X. Her i Need to send a 1 or 2 ( the key ) to FSX.

For that i did a search in the FSUIPC document and found Offset 3210.

So, first question .. is this the right Offset for that?

The second is how to set up the Variable in C# or even in C or C++?

private Offset<BitArray> o_keys = new Offset<BitArray>(0x3210, 224);

Like this?

The Problem is that FSX dont have the Focus all the time.

Matthias

Link to comment
Share on other sites

For that i did a search in the FSUIPC document and found Offset 3210.

So, first question .. is this the right Offset for that?

 

No, 3210 is for applications to register keys with FSUIPC so that when the user presses them the application gets notified by a flag in those offsets. It is the complete opposite of "sending a key to FS". What makes you think it is anything like what you want?

 

There is a facility for sending the actual KEYDOWN and KEYUP windows messages to the FS window (offset 3200) but that needs an understanding of Windows programming and is quite complex to use.

 

Easiest way is to use the added FSUIPC control for key press/release (see advanced FSUIPC guide, the list of "Additional 'FS' controls added by FSUIPC" near the back. Control 1070 is what you want.

 

You can send any controls, FS or FSUIPC added, via offset 3110.

 

Pete

Link to comment
Share on other sites

Hello,

hmm, so ok i will try the other way via Offset 3110.

When i understand it correct i have first to set up the Offset like

private Offset<int> o_keys = new Offset<int>(0x3110);

then i found the 1070 control in the user guide

1070 Key Press and Release (param is Keycode + 256*Shift code, or JsBk)

so..if i want to send a "1" to the FSX which have the KeyCode 31.

What have i to set for the Offset 3110??

Is there maybe a example?

Matthias

Link to comment
Share on other sites

hmm, so ok i will try the other way via Offset 3110.

 

You need 3114 as well, for the parameter. Please do read the documentation more carefully. You seem to rush into things without first reading about them! It would save a lot of time if you slowed down a little and did the research first.

 

then i found the 1070 control in the user guide

1070 Key Press and Release (param is Keycode + 256*Shift code, or JsBk)

so..if i want to send a "1" to the FSX which have the KeyCode 31.

What have i to set for the Offset 3110??

 

As it clearly says, the control number goes to 3110! Why not actually read what it says? The control number is 1070 as you have found, and as I told you before!

 

It also tells you that the parameter goes in 3114. You must write that BEFORE writing to 3110 because writing to 3110 initiates the action.

 

And where on Earth are you finding that the keycode for '1' is 31? It is 49 -- hex 31 maybe, but you must be more careful!

 

Please read more before posting these incessant questions which are mostly answered in the documents. I do have other things to do, you know.

 

Pete

Link to comment
Share on other sites

Last Question because i can not really nderstand what you want to explain in the advanced user guide.

I did a test with the "Q" key to see how and if it works.

For that i puut now first 81 in Offset 3114 and then 1070 in 3110.

Ok, that works.

But how can i sen the combinationof CTRL+F12?

The document says

1070 Key Press and Release (param is Keycode + 256*Shift code, or JsBk)

Hmm...and i fond this in the document:

The <shifts> value is a combination (add them) of the following values, as needed:

1 Shift

2 Control

4 Tab

8 Norm

Add them where ??

I am very sorry, but i can really not understand what you here mean.

Please help for this a last time

Matthias

Link to comment
Share on other sites

The <shifts> value is a combination (add them) of the following values, as needed:

1 Shift

2 Control

4 Tab

8 Norm

Add them where ??

 

Oh dear.

 

First, if you want multiple shifts, you do as it says, add them together. So Shift + Control is 1 + 2 = 3.

 

How hard is that? And why are you even asking about a combination of shifts when you only want one of them?

 

The document says

1070 Key Press and Release (param is Keycode + 256*Shift code, or JsBk)

 

But how can i sen the combinationof CTRL+F12?

 

So, you know Ctrl is 2. The rest is simple SIMPLE arithmetic, surely. What is your problem with it?

 

See that 256*2 = 512.  So

 

512 + keycode for F12 =  512 + 123 = 635.

 

So, why couldn't you do this simple sum yourself?  How are you managing to do any programming at all without some basis in notation and logic?

 

Pete

Link to comment
Share on other sites

Hello,

hmm....i tried this, but it dosent work first time.

But then i tried 1071 for the 3110 Offset and now it works.

My calculator gives me first time for 123 + 256*2 = 758.

I think he miss the () around 256*2.

But now it works and i want to say Thanks you for the help again !

Matthias

Link to comment
Share on other sites

hmm....i tried this, but it dosent work first time.

But then i tried 1071 for the 3110 Offset and now it works.

 

1071 presses the key and keeps it pressed! You'd need to use 1072 at some time after to release it, otherwise it will be "stuck" and not re-usable.

 

Pete

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.