GIMX Web API and Android application

Discuss everything to do with GIMX here
Post Reply
Lucashsmello
Posts: 7
Joined: Tue Nov 20, 2018 11:44 am
Location: Brazil
Contact:

GIMX Web API and Android application

Post by Lucashsmello » Sun Jan 06, 2019 12:22 am

I'm currently developing a GIMX Web API to serve an android application that starts/stops and monitors GIMX on a remote device (RPi for example). I am using python-flask-RESTful to implement it. The code is found here: https://github.com/Lucashsmello/GIMX-WebAPI.

This project is in the very beginning.

Currently the WebAPI service only uses gimx binary with its options, stdout+stderr and key events (ex: generate shift+ESC programmatically to stop gimx) to control and monitor GIMX process. Capturing status and error on stdout and stderr are not reliable and not easy. I think a proper solution should use a GIMX API that provides functionality to monitor and control gimx. Is there anything better than using "stdout+stderr+keyevents" already implemented or someone planning to implement?.


A screenshot of the current state of the android application:


It can start,stop, get the list of configurations files and monitor some errors. It usually works.
This is my first time developing a Web Server/API and i have low experience in Android development, therefore development is being very slow and any suggestions and help are welcome.

User avatar
Matlo
Posts: 5226
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: GIMX Web API and Android application

Post by Matlo » Sun Jan 06, 2019 8:04 pm

Status could be provided via UDP packets using the same format as for controlling a remote instance.
https://gimx.fr/wiki/index.php?title=Network_API
GIMX creator Donate Shop

Lucashsmello
Posts: 7
Joined: Tue Nov 20, 2018 11:44 am
Location: Brazil
Contact:

Re: GIMX Web API and Android application

Post by Lucashsmello » Tue Jan 08, 2019 12:06 pm

Thanks. I have some questions:
  • When does GIMX starts listening for udp packets? After or before connection with console and adapter is established?
  • I did not find any documentation about exit/return codes of gimx command line. What are the exit codes?

User avatar
Matlo
Posts: 5226
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: GIMX Web API and Android application

Post by Matlo » Thu Jan 10, 2019 8:26 am

GIMX can be cut into two stages. In the first one, it initializes all resources and, if using an adapter, synchronously detects its. In the second one, it just waits for events to happen from one of the resources. In this step most of the processing is asynchronous and non-blocking.

Following this logic, initializing a socket should be performed in the first stage, and processing received data should be performed in the second stage.
Lucashsmello wrote:
Tue Jan 08, 2019 12:06 pm
When does GIMX starts listening for udp packets? After or before connection with console and adapter is established?
It starts listening in the initialization stage, but no event gets processed before the end of the stage, which includes detecting the adapter.
Lucashsmello wrote:
Tue Jan 08, 2019 12:06 pm
I did not find any documentation about exit/return codes of gimx command line. What are the exit codes?
https://github.com/matlo/GIMX/blob/ae68 ... gimx.h#L26
GIMX creator Donate Shop

Lucashsmello
Posts: 7
Joined: Tue Nov 20, 2018 11:44 am
Location: Brazil
Contact:

Re: GIMX Web API and Android application

Post by Lucashsmello » Mon Jan 28, 2019 8:42 pm

Current state:

Post Reply