Jump to content
The simFlight Network Forums

Recommended Posts

Hello ,

I have been learning java and have tried to use the FSUIPC java api to get information and send information to fsx. This has worked fine however I do not know to send messages to fsx. In the example provided with the download prints information on the simulator and aircraft and also sends a message to fsx saying ,"Hello world". I have looked hard through the example code and searching the web but couldn't find out. 

 

Many thanks,

 

Arun

Link to comment
Share on other sites

I have been learning java and have tried to use the FSUIPC java api to get information and send information to fsx. This has worked fine however I do not know to send messages to fsx. In the example provided with the download prints information on the simulator and aircraft and also sends a message to fsx saying ,"Hello world". I have looked hard through the example code and searching the web but couldn't find out. 

 

I don't know Java at all, but if you can write to FSUIPC offsets from Java then just use the offset 3380 to write the text, then 32FA to get it displayed. Please refer to the offsets list provided in the SDK (and also in your FSUIPC Documents subfolder).

 

Pete

Link to comment
Share on other sites

Hi Pete,

 

 

fsuipc_wrapper.WriteData(3380 , 32FA , ?);

I can see it takes  int aOffset , int aCount , byte[] aData but I dont know what any of these are.

 

Is this correct?

 

Sorry as I'm new i'm not sure how this works. I looked at the api under the doc folder but still couldn't figure it out.

 

Arun 

Edited by arunptl100
Link to comment
Share on other sites

fsuipc_wrapper.WriteData(3380 , 32FA , ?);

I can see it takes  int aOffset , int aCount , byte[] aData but I dont know what any of these are.

 

Is this correct?

 

Oh dear. No.

 

It isn't hard, and the names do describe what they are!

 

Both 3380 and 32FA are offsets (effectively addresses in a large data area), and they are hexadecimal so must be expressed as such. Sorry, but I have no idea how Java represents a hex number. Maybe 0x preceding or maybe $ like VB?

 

A "count" is a number giving the size of the data to be written: in this case the number of BYTES. In FS each character in a string is a BYTE and strings are ended with a zero BYTE. A byte is 8 bits.

 

Data is the data - i.e. the stuff you want to write. Normally this is a pointer to the data, but I've no idea how or if Java even works with pointers.

 

You evidently have not referred to the offsets list at all to see what these should be written with? I did suggest you look these things up.

 

And don't forget you need to connect to FSUIPC first.

 

Do you know any Java at all? If not I suggest you learn some first. I'm afraid I cannot help with Java.

 

Pete

Link to comment
Share on other sites

Ok , yes I have connected to fs and have printed heading and speed ect. Yes I have been studying java

 

Ah, good. Then all you need now to be aware of is that offsets are hexadecimal (but you can convert them to decimal if you must), and FS likes strings for display only in "ASCIIZ", which is a series of ASCII 8-bit characters terminated by a zero byte.

 

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.