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

Added M118 message forwarding #2678

Merged
merged 28 commits into from
Feb 15, 2023

Conversation

digant73
Copy link
Contributor

@digant73 digant73 commented Jan 17, 2023

IMPROVEMENTS:

  • Added M118 message forwarding: Any M118 command read by TFT (e.g. printing from TFT or from remote host (e.g. OctoPrint etc.)) is parsed and forwarded to the provided TFT destination port/s, if enabled.
    This feature allowed an easy implementation (just an M118 message) for:

    The new Serial_Forward function was added to the existing SerialConnection API

  • Implemented [FR] Send Pause and Stop Command While Remote Printing #2572: Now, as also reported in README.md, when on Printing menu, pressing on the pause, resume and stop buttons will trigger to the remote host the following notifications, respectively:

    NOTIFICATION ACK MESSAGE
    pause //action:notification remote pause
    resume //action:notification remote resume
    cancel //action:notification remote cancel

    The remote host must properly handle the received notifications. For example, if //action:notification remote pause is received then the remote host must effectively pause the print and send M118 P0 A1 action:pause in order to trigger the pause action to the TFT.

  • Serial functions syncL2CacheFromL1 and parseRcvGcode moved from parseAck.c API to SerialConnection.c API and renamed as the following, respectively:

    • Serial_Get (retrieve a message)
    • Serial_GetFromUART (retrieve messages from all the enabled supplementary ports storing them in the command queue (in interfaceCmd.c) for further processing)
  • Serial functions in HAL's Serial API properly renamed (common naming convention) as:

    • Serial_Put (send a message)
    • Serial_PutChar (send only a char)
  • Beeing part of the main changes of the PR, some code reduction and cleanup has been also provided in interfaceCmd.c:

    • infoCmd data queue renamed to cmdQueue (by definition the word cmd (command) means a set of info). Used cmdQueue instead on cmd_queue due it is not a primitive type (e.g. an array of chars) but a data structure (the use of _ and further . (for an attribute) would result in a less readable text
    • Grouped M25, M125 and M524 (code reduction)
    • Grouped M105 and M155 (code reduction)
    • Some code sharing, reduction and fixes applied on top of last merged PR Handle emergency commands #2607. Also, no need to handle M108, M112 etc. as emergency commands when sent from command queue (Marlin will always replies with an "ok")
  • Beeing part of the main changes of the PR, some code reduction and cleanup has been also provided in parseAck.c (e.g. dmaL2Cache buffer renamed to a more understandable ack_cache (an array of chars) etc.).

fixes #2640
resolve #2572
resolve #2618
resolve #2638

PR STATE: Ready for merge

@kisslorand kisslorand mentioned this pull request Jan 19, 2023
@digant73
Copy link
Contributor Author

digant73 commented Jan 20, 2023

@kisslorand Please, have a break with such kind of meaningless complaints. They contribute only to damage the project and the community. Thanks!

@kisslorand
Copy link
Contributor

@bigtreetech
Please check #2685. Thank you!

@digant73
Copy link
Contributor Author

Closing just to avoid any infinite loop. This PR will be eventually submitted/adapted in the future once kisslorand's constraints will be satisfied or rejected

@digant73
Copy link
Contributor Author

digant73 commented Feb 6, 2023

Reopened after removal/solving all kisslorand's comments from code

@digant73 digant73 reopened this Feb 6, 2023
@bigtreetech bigtreetech merged commit 63d7911 into bigtreetech:master Feb 15, 2023
@kisslorand kisslorand mentioned this pull request Mar 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants