Jump to content
The simFlight Network Forums

problem when retrieving strings using the pyuipc python module


Recommended Posts

Hello,

I'm writing an application using Python that uses the pyuipc module.

One of the functions is to retrieve any messages that are sent out via SimConnect and read them via text-to-speech.

This works most of the time. However, I'm running into a few situations where pyuipc can't process the string. It is possibly related to a strange character in the return string. 

An example of where this happens is when reading the menus from GSX (ground services x). I can read the menus, up to the point where you choose the jetway options. Pyuipc then throws an error. I can't do any processing on the string, since pyuipc isn't returning anything, just throwing an error.

Can anyone suggest a way around this? I know I can read the menus with lua, but the question then is how to output the results using TTS, or transfer the result to my application so I can read it?

 

I tried emailing this question to the developer of the pyuipc module, but never heard back. The module is open source, but I'm not a C developer.

Any help would be apreciated!

My app can b found at:

http://www.github.com/jfayre/voice-flight-following

 

 

Link to comment
Share on other sites

Hi,

23 hours ago, Jason Fayre said:

It is possibly related to a strange character in the return string. 

I think the first step would be to log what the strings are to see if this sheds any light on the problem. Could you try adding the following to the [General] section of your .ini file:
    Debug=Please
    TestOptions=x8000

(This is the TextMenu logging flag).

You could also log offsets (from the FSUIPC UI) B010 (as U32) and B014 (as AsciiZ), sending the results to the log file. The logging of offset B014 will probably not be that useful, as it will stop after the first zero terminated string, but would be useful to see anyway.

If you could post your log file exhibiting your problem with the above logging activated, I'll take a further look.

Cheers,

John

P.S. I've not looked into the python module yet so this may take some time!

Link to comment
Share on other sites

Hello!

I got a response back from the developer of the python module. He made a change for me that returns the string from fSUIPC as a python byte string so I can do my own decoding.

The module was trying to decode the string as utf-8 before returning, but for some reason that wasn't working in my case.

I think I've got that sorted out now.

 

 

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.