Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: Serial stop/start does not restore all functionalities #27

Closed
PBechon opened this issue Dec 17, 2020 · 3 comments
Closed

[BUG]: Serial stop/start does not restore all functionalities #27

PBechon opened this issue Dec 17, 2020 · 3 comments

Comments

@PBechon
Copy link
Collaborator

PBechon commented Dec 17, 2020

Description of the bug

Mod version: current develop branch

Game version: 1.10

Operating system: Windows

A clear and concise description of what the bug is

When using '/sim serial stop' and then '/sim serial stop', the function initPorts is called. This function redefine all the elements of onSerialReceivedArray. This mean that all the callback that are defined are erased. This break the SimPit functions that listen for input from Arduino. We need to reload the game to restore those functionalities.

To Reproduce

  1. Launch KSP and load a mission
  2. Type '/sim serial stop'
  3. Type '/sim serial start'
  4. Restart the Arduino
  5. Try to use functions to send data to KSP : it is not registered. Reloading the game solve the issue.

To Solve

When stopping and restarting serial connection, the connection itself should be reset but all the callbacks should not be erased.

@PBechon PBechon changed the title [BUG]: [BUG]: Serial stop/start does not restore all functionalities Dec 17, 2020
@LRTNZ
Copy link
Collaborator

LRTNZ commented Dec 22, 2020

I have pushed the branch fix/fix-serial-reconnection that should do the trick. There were a couple of things in there that I needed to tweak that prevented the reconnecting controller from binding as intended.

Let me know if it works, and I will merge it in!

@LRTNZ
Copy link
Collaborator

LRTNZ commented Jan 3, 2021

Fixed!

If it is not, feel free to reopen this issue.

@LRTNZ LRTNZ closed this as completed Jan 3, 2021
@CallumDixon
Copy link

This may be why i got a unity crash a while ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants