Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hey guys,

 

               I got most of my project almost done. I have successfully been able to mute my music, e.g. skyBlue and other url based music, during transmitions and receiving, but only on the COM1 radio. The only problem I am having is the COM2 offset. I don't believe that I have the right offset, because instead of returning a byte, i.e. 0 or 1, it is returning random numbers, e.g. 61045631.

 

The offest I am using for COM2 is 0x7b99 for receiving and 0x07b9a for transmitting.

 

Are these the right offsets? And if so, what could be going wrong?

 

Once I am done, I might need some people to help beta test to work out any problems or to help develop it more. I don't know if there is anything out like this, but if there is oh well. I have enjoyed working on it.

 

Right now, I believe it will only work with Squawkbox, because those are the offsets that I am using.

Posted

Hi,

 

The two offsets you are using (0x07B99 and 0x07B9A) are listed as being 1 byte long. From the result you are getting it's look like you've declared these offsets as Int32, int (C#) or Integer (VB) which are all 4 bytes long.

 

It would be helpful if you posted the relevant code but I'm pretty sure that's your mistake here.

 

Here's an example of the correct declarations for these offsets:

 

VB:

Dim Com2Receive as Offset(Of Byte) = New Offset(Of Byte)(&H7B99)
Dim Com2Transmit as Offset(Of Byte) = New Offset(Of Byte)(&H7B9A)

C#

private Offset<byte> com2Receive = new Offfset<byte>(0x7B99); 
private Offset<byte> com2Transmit = new Offfset<byte>(0x7B9A);

Give that a try.

 

It's very important to declare the offsets with the correct .net variable type. This is explained in my UserGuide.pdf on page 7.

 

Paul

Posted

You are right.  The code I have is the exact same as you have written, expect I did set it as an integer. I didn't think it would make that much of big deal since it should only return a byte. Especially, since with the COM1 I did the same and it didn't seem to affect the the reading.

 

My Code: VB

Dim COM2Receive as Offset(Of Integer) = New Offset (Of Integer) (&H7B99)
Dim COM2Transmit as Offset(Of Integer) = New Offset (Of Integer) (&H7B9A)

But thanks for the help. I will give it a try and let you know.

Posted

Hi,

 

The amount of data that get returned depends only on the type you have set in the offset declaration. FSUIPC doesn't know how big the offsets are so it's not true that it should only return a byte. You've asked for 4 bytes so FSUIPC will return 4 bytes. These will be offsets 7B99, 7B9A, 7B9B and 7B9C.

 

That's why is critical that you select the correct type when declaring offsets.

 

Paul

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.