Jump to content
The simFlight Network Forums
Abdullah Radwan

COM1/COM2 is flipped in XPUIPC

Recommended Posts

Hello,

I am using offset 3122 to read the selected COM. This is the code I use:

byte audioSelection;

FSUIPC_Read(0x3122, 1, &audioSelection, &error);
int comSelection = 0;
if(audioSelection >= 128) comSelection = 1;
else comSelection = 2;

This works well with FSX (And P3D I assume, I didn't test it on P3D). However, with X-Plane 11 and XPUIPC, I got it flipped (COM2 instead of COM1, and vice versa). Is there any way to get it right?

Share this post


Link to post
Share on other sites
1 hour ago, Abdullah Radwan said:

This works well with FSX (And P3D I assume, I didn't test it on P3D). However, with X-Plane 11 and XPUIPC, I got it flipped (COM2 instead of COM1, and vice versa). Is there any way to get it right?

First thing would be to report the error to the XPUIPC author.

To fix it in your program you'd surely just  need to set your comSelection value the other way around for your X-Plane version. If you can test whether you are talking to FSX/P3D or XPlane, then just make it conditional on that.

Pete

 

Share this post


Link to post
Share on other sites

There isn't a direct way of knowing that you are connected to XPUIPC, however, I noticed that when you are connected to XPUIPC, FSUIPC_FS_VERSION reports SIM_FSX and FSUIPC_VERSION reports 5 (which is impossible). So here is the code:

bool isCom1Selected, isXPUIPC;
isXPUIPC = (0x0f & (FSUIPC_Version >> 28)) == 5 && FSUIPC_FS_Version == SIM_FSX;
if(audioSelection & 128) isCom1Selected = true;
else isCom1Selected = false;
if(isXPUIPC) isCom1Selected = !isCom1Selected;

 

Share this post


Link to post
Share on other sites
7 hours ago, Abdullah Radwan said:

I noticed that when you are connected to XPUIPC, FSUIPC_FS_VERSION reports SIM_FSX and FSUIPC_VERSION reports 5 (which is impossible).

I see. So you've got a way. Well done.

Pete

 

Share this post


Link to post
Share on other sites

Hello...

I have the same problem with one of my app.
But, how to report the problem to Torsten Spiering (the author)?
I can't find a way to contact him. 
Do you know a way?

Thanks.
Regards.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • 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.