-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Cellular refactor power and get_default_instance, also remove deprecated #9273
Cellular refactor power and get_default_instance, also remove deprecated #9273
Conversation
Moved methods to classes CellularDevice and CellularInformation. SIM interface was removed to simplify cellular usage and methods better suite new classes. Updated greentea and unit tests.
-added an API for checking network eps ciot optimization support -renamed the API for getting the UE parameters -the API for setting the UE parameters includes now a callback, which will be called once network support for eps ciot optimization is known
Cellular: Remove sim interface
…n_feature_branch Cellular ciot eps on feature branch
Cell refactor power api
Cellular: changed support features to CellularProperty array.
After this change we were able to change methods ATHandler::set_urc_handler and CellularDevice::set_ready_cb to void and simplify error handling.
Cellular: Removed unnecessary checks after new
This change enables removing function has_registration from class AT_CellularNetwork and all targets inheriting AT_CellularNetwork.
After AT_CellularNetwork::has_registration was replaced with CellularProperties and better AT_CellularNetwork::set_access_technology_impl default implementation we can delete most of the target specific classes that inherit AT_CellularNetwork.
Change usage of AT_CellularContext::stack_type_supported to AT_CellularBase::get_property. This way we can rid of targets overriding stack_type_supported and delete unnecessary classes and simplify new targets.
Generic cellular module (GENERIC_AT3GPP) can by used as a default module when porting new cellular module. It's a good starting point and eases porting of new modules. GENERIC_AT3GPP uses only standard 3GPP AT commands when communicating with the modem.
_sim_pin was changed to pointer from array and length was checked with strlen. If _sim_pin was null it caused crash. Fix by checking _sim_pin against NULL. Power class could have been called without checking if power is NULL. Fix by checking that power class is not null. Fix state machine to return correct states when queried.
Cellular: Add generic cellular modem
Cellular: added setting of data carrier support for UART.
@AriParkkila, thank you for your changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As discussed offline, I think it would be good to pin down exactly what the power calls do as we're making this API change - make sure we don't need to make another one.
Aligning with the 4-call model from the original 5.7 design, your power_on and power_off could be the "power rail" "init" and "deinit" from there.
The "button" power on could be hidden inside "init", but not clear that the button-off call can be neatly hidden inside "shutdown".
I would suggest exposing all 4 calls, and then the state machine can be in control of them all: "button on" calls interleaved with its "device init"s, and could in future choose when to try the "button off" if it ever did shutdown.
targets/TARGET_STM/TARGET_STM32L4/TARGET_MTS_DRAGONFLY_L471QG/ONBOARD_SARA4_PPP.cpp
Outdated
Show resolved
Hide resolved
...RGET_STM/TARGET_STM32L4/TARGET_STM32L486xG/TARGET_MTB_ADV_WISE_1570/ONBOARD_QUECTEL_BC95.cpp
Show resolved
Hide resolved
features/cellular/framework/targets/GEMALTO/CINTERION/mbed_lib.json
Outdated
Show resolved
Hide resolved
features/cellular/framework/targets/GENERIC/GENERIC_AT3GPP/GENERIC_AT3GPP.h
Show resolved
Hide resolved
targets/TARGET_STM/TARGET_STM32F4/TARGET_MTB_MTS_DRAGONFLY/ONBOARD_TELIT_HE910.cpp
Outdated
Show resolved
Hide resolved
@kjbracey-arm please re-review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, thanks - I'd just like a bit more text in the power calls to help people get a mental image.
features/cellular/framework/targets/TELIT/HE910/TELIT_HE910.cpp
Outdated
Show resolved
Hide resolved
targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F439xI/TARGET_WIO_3G/ONBOARD_QUECTEL_BG96.cpp
Outdated
Show resolved
Hide resolved
Note: feature-cellular-refactor will need a rebase from master, to resolve tools travis (fixed on master) |
I am wondering is it possible to change the baudrate for e.g. MTB_ADV_WISE_1570 in mbed_app.json after this change goes through? From what I am hearing this value will be hardcoded in the future. I feel we should not limit ourselves to one value. It is because how the modem stack operates on this device that if one reads the data out too slowly incoming data will be lost. Thus in these situations I would like to still be able to configure the baudrate. |
Why would you ever want to configure it slow? If it can go faster, then we can just make it fixed at that faster speed, I would have thought. Going faster should save power - reducing our active time. There's usually no need to make internal bus speeds configurable. (Not that setting the baud rate fast is sufficient to cover your modem problem, as I understand it) Oh, and note that the speed is only fixed for devices where it's "onboard", which suggests we know everything about the wiring. If you're a plug-in module, speed can be set in the constructor or JSON as usual. |
@kjbracey-arm I copied some more docs from onboard_modem_api to here, and decreased trace levels from info to debug. |
@0xc0170 can I merge this branch to master - rebase seems quite tricky... Another option would be to close this feature branch and merge commits from my fork that is up to date with master https://github.com/AriParkkila/mbed-os/tree/rebase-feature-cellular-refactor |
990ca98
to
a42aa44
Compare
Which branch? There's another travis fix t hat is landing on master within a hour. To progress, either cherry pick it here to fix it or rebase the feature branch |
@0xc0170 this commit is going to feature-cellular-refactor branch. Can I use |
Fast is good, I do prefer to have it that way. However, in this case the FW just comes with 9600 bps as default. At least in versions that we have available. Maybe that will change in the future FW version, who knows. I don't know how likely that is, but this is one example where configuration might be needed (unless the driver would be so smart as to "autosense" baudrate based on FW version or by trial&error).
You are correct it does not fix all problems. For some problems it seems to help though, which is why I configured it to 115200 instead of the factory default 9600. I was not able to download the 100kB+ file without doing that (and adjusting the amount of bytes read with one call to closer to the modem maximum).
Noted, but I believe the device I am working with falls into that category. |
6b0639d
to
007caa0
Compare
Description
This PR has the following related changes:
CELLULAR_DEVICE macro and
onboard_modem_api
(see review comments) is still left to be removed after these changes can be approved.Pull request type
Reviewers
@jarvte
@mirelachirica
@kjbracey-arm