Skip to content

Support ubx cfg pm2 message #78

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

Closed
wants to merge 7 commits into from

Conversation

nabelekt
Copy link
Contributor

Adding support for UBX-CFG-PM2 messages

@PaulZC
Copy link
Collaborator

PaulZC commented Nov 16, 2021

Hi Thomas ( @nabelekt ),

Thank you for submitting this PR.

I will not be able to merge it as it does not follow the structure and style of the existing library. Also there are some code changes you will need to make.

You use Serial.println in several places. Those need to be changed to:

    if (_printDebug == true)
    {
      _debugSerial->println(F("getPowerManagementConfiguration: PM2 configuration:"));
    }

Serial.println(payloadCfg[]) will print decimal values which is really not very useful. Please change those to something which indicates how the flags and updatePeriod etc. are configured.

Your typedef struct for UBX_CFG_PM2_data_t does not follow the structure and style of the other message structure definitions. Please change it so it matches the structure used by (e.g.) UBX_CFG_TP5_data_t.

Your code will need to support all three versions of the UBX-CFG-PM2 message - otherwise modules with different protocol versions will reject the message. You will need to use a read-modify-write approach. First get (poll) the PM2 message. Then look at the message version. Then update the fields and flags according to the protocol version. Then write it back again. Also, modules like the ZED-F9P do not support UBX_CFG_PM2, so your code will need to cope with the get (poll) being rejected.

Thank you.

Best wishes,
Paul

@PaulZC
Copy link
Collaborator

PaulZC commented Nov 18, 2021

Hi Thomas (@nabelekt ),

I've just released v2.0.18 of the library. It includes some important changes to let the code run correctly on ESP32 v2.0.1. I have included some parts from this pull request. Please see the release notes for more details. Please do pull the latest code and use that for the rest of your changes.

Please also see CONTRIBUTING.md. If possible, please target your pull request at the release_candidate branch instead of the main branch. That way, I can test your changes before merging them into the main branch.

Thank you.

Best wishes,
Paul

@nabelekt
Copy link
Contributor Author

Hi, @PaulZC.

Thanks for the information and comments. I have merged in your master branch and made some other updates. However, I haven't reworked the struct, supported other message versions, or handled the message being rejected. My understanding is that any module that supports PM2 will support version 0x01 of the message; that's why I implemented that version. Unfortunately, I don't have the capacity right now to complete your suggestions. I'd welcome anyone else to do that. If I am able to later on, I'll come back to do that.

Thanks!

@PaulZC
Copy link
Collaborator

PaulZC commented Dec 1, 2021

Hi Thomas (@nabelekt ),

Please be aware that I have just released v2.1.0 of the library. It adds a lot of new code to support AssistNow Online, Offline and Autonomous. Please do merge the new main branch when you have time.

Best wishes,
Paul

@PaulZC
Copy link
Collaborator

PaulZC commented Dec 8, 2021

Hi Thomas,

I am going to close this PR. Please open a new pull request when you are ready to submit your code changes. Thank you.

Best wishes,
Paul

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

Successfully merging this pull request may close these issues.

2 participants