Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi @Paul Henty,

I'm using your client libraries in a small plugin for StreamDeck to trigger virtual joystick buttons at offset 3340. This works fine.

I'm updating my plugin to use offset 7F00, which provides more joysticks and buttons. I updated my usage, but this doesn't seem to trigger FSUIPC.

I simply changed my offset declaration from:

private readonly Offset<BitArray> Buttons = new Offset<BitArray>("Buttons", 0x3340, 36);

to:

private readonly Offset<BitArray> Buttons = new Offset<BitArray>("Buttons", 0x7f00, 256);

and my bit calculation (example for clearing) from:

Buttons.Value.Set((vj - 64) * 32 + bn, false);

to:

Buttons.Value.Set((vj - 64) * 128 + bn, false);

All other logging I put in (which button being pressed etc.) work as expected, and there seem to be no other errors in any of the StreamDeck logs.

I also put a watch on offset 7F00 as U32 in FSUIPC, but it seems to not be receiving anything.

Any thoughts? What am I missing?

Thanks,

John

 

 

Posted

Hi John,

I can't see anything wrong with your code. 

Quote

I also put a watch on offset 7F00 as U32 in FSUIPC, but it seems to not be receiving anything.

Have you tried just writing a basic offset - e.g. declare a standard int offset for 7F00 and just write 1 and 0 to it and see if it has any effect?  Should activate the first button on stick 64.

If you're using FSUIPC7, the offsets list I have says this offset has not been tested/has unknown status.

I can't check it here but maybe @John Dowsoncould have a quick look at this offset in FSUIPC7 and confirm if it's working or not.

Paul

Posted
2 hours ago, Paul Henty said:

If you're using FSUIPC7, the offsets list I have says this offset has not been tested/has unknown status.

It does say this but it should be fine...no change in this offset from FSUIPC5 and onwards, so I wouldn't expect a problem...

2 hours ago, Paul Henty said:

Have you tried just writing a basic offset - e.g. declare a standard int offset for 7F00 and just write 1 and 0 to it and see if it has any effect?  Should activate the first button on stick 64.

This is the test you need to do, and with the FSUIPC7 button assignment window open, to see if it is registered.

I am away this weekend, and when I get back it will take me a while to catch-up on support requests, but once that is done I can check this further here.

John

Posted

Hi@John Dowson @Paul Henty,

So I used the FSUIPCExampleCode_CS project to test this out by modifying the BC004_WritingOffsets example.

I changed altimeterPressure to point to 0x3340 offset, and used a bool to toggle whether I was setting it to 1 or 0. This works and  FSUIPC receives it.

        private Offset<ushort> altimeterPressure = new Offset<ushort>(0x3340);   // 2-byte offset - Unsigned Short
        private bool b = false;
...
        private void btnSetStandardPressure_Click(object sender, EventArgs e)
        {
            b = !b;
            this.altimeterPressure.Value = (ushort)(b ? 1 : 0);

It showed up in Buttons & Switch Assignments, and in the log for the offset:

   643313 Monitor IPC:7F00 (U8) = 0
   643313 Monitor IPC:3340 (U8) = 1
   705719 Monitor IPC:3340 (U8) = 0
   706032 Monitor IPC:3340 (U8) = 1
   706219 Monitor IPC:3340 (U8) = 0
   706719 Monitor IPC:3340 (U8) = 1
   715594 Monitor IPC:3340 (U8) = 0
   715782 Monitor IPC:3340 (U8) = 1
   715969 Monitor IPC:3340 (U8) = 0

I then changed altimeterPressure to point to 0x7f00 offset, but nothing happens. It doesn't trigger in the Buttons & Switch Assignments and shows nothing in the log.

        private Offset<ushort> altimeterPressure = new Offset<ushort>(0x7f00);   // 2-byte offset - Unsigned Short

Thoughts?

Thanks,

John

 

  • 3 weeks later...
Posted

Ok, I have now looked into this. Offset area 0x7F00 is badly documented, and is for real joysticks not virtual ones. Basically it is a copy of the facilities provided at offset 0x03C0, but for joysticks with up to 128 buttons, not the facilities for virtual joystick buttons provided at 0x3340. I will correct the documentation.

John

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.