-
Notifications
You must be signed in to change notification settings - Fork 3k
Cellular: UBLOX_C030_N211 Cellular API's #9637
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
Conversation
@mudassar-ublox, thank you for your changes. |
Will this conflict with #9568 ? |
@ARMmbed/mbed-os-wan Can you please review and advice how to resolve conflicts here?
|
Pull request is getting updated but any advice to resolve conflicts will be better. Thanks |
@fahim-ublox To resolve the conflicts, this PR needs to be rebased against master. It's possible that @ARMmbed/mbed-os-wan might need to help. |
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.
Unfortunately feature-cellular-refactor
introduced quite many (breaking) changes that need to be resolved here, but the changes seem to be quite straight forward. Note that after SupportedFeature
was changed to CellularProperty
it requires that every modem driver must have a complete property map and thus need to be updated when adding new properties like AT_CellularSMSMmodeText
.
@@ -81,7 +81,7 @@ static void test_power_interface() | |||
TEST_ASSERT(err == NSAPI_ERROR_OK || err == NSAPI_ERROR_UNSUPPORTED); | |||
wait_for_power(pwr); | |||
|
|||
TEST_ASSERT(pwr->set_power_level(1, 0) == NSAPI_ERROR_OK); | |||
TEST_ASSERT(pwr->set_power_level(1, 0, MBED_CONF_APP_CELLULAR_SIM_PIN) == NSAPI_ERROR_OK); |
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.
Test was removed.
@@ -93,7 +93,7 @@ class CellularPower { | |||
* @return NSAPI_ERROR_OK on success | |||
* NSAPI_ERROR_DEVICE_ERROR on failure | |||
*/ | |||
virtual nsapi_error_t set_power_level(int func_level, int do_reset = 0) = 0; | |||
virtual nsapi_error_t set_power_level(int func_level, int do_reset = 0, const char *sim_pin = NULL) = 0; |
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.
CellularPower API was removed.
{ | ||
} | ||
|
||
nsapi_error_t UBLOX_N2XX_CellularPower::on() |
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.
on()
was split to soft/hard_power_on
hard_power_on to call ::onboard_modem_init()
hard_power_off to call ::onboard_modem_deinit()
soft_power_on to call ::onboard_modem_power_up()
soft_power_off to call ::onboard_modem_power_down()
@@ -56,7 +56,7 @@ nsapi_error_t AT_CellularPower::set_at_mode() | |||
return _at.unlock_return_error(); | |||
} | |||
|
|||
nsapi_error_t AT_CellularPower::set_power_level(int func_level, int do_reset) | |||
nsapi_error_t AT_CellularPower::set_power_level(int func_level, int do_reset, const char *sim_pin) |
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.
File was removed.
@@ -40,7 +40,7 @@ class AT_CellularPower : public CellularPower, public AT_CellularBase { | |||
|
|||
virtual nsapi_error_t set_at_mode(); | |||
|
|||
virtual nsapi_error_t set_power_level(int func_level, int do_reset = 0); | |||
virtual nsapi_error_t set_power_level(int func_level, int do_reset = 0, const char *sim_pin = NULL); |
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.
File was removed.
@@ -0,0 +1,45 @@ | |||
/* |
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.
CellularPower api was removed, remove this file.
} | ||
|
||
|
||
nsapi_error_t UBLOX_N2XX_CellularPower::set_power_level(int func_level, int do_reset, const char *sim_pin) |
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.
Function was removed.
return NSAPI_ERROR_OK; | ||
} | ||
|
||
nsapi_error_t UBLOX_N2XX_CellularPower::set_at_mode() |
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.
Function was changed to CellularDevice::init
.
@@ -0,0 +1,92 @@ | |||
/* |
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.
CellularPower api was removed, remove this file.
@@ -0,0 +1,43 @@ | |||
/* |
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.
This file can likely be removed.
@mudassar-ublox Do you need any assistance for updating this PR? |
There are few other commands which are also not supported for this target. So I am adding them in
|
This is probably not needed, but you should simply override APN authentication similar to |
you mean to override |
@mudassar-ublox if the modem supports And yes, it's fine to add new AT commands you mentioned (you just need to add those in all modem drivers). |
For other modem drivers, I have not idea whether these commands are supported for them or not. Can you please do that accordingly after my PR. For other UBLOX drivers I will update it. |
@mudassar-ublox unfortunately your PR will never pass without adding properties to each driver, but you can define them all simply supported due to that won't change any current behavior. |
Removing 5.12 release label as this needs further work and review |
a99ca29
to
389d503
Compare
I have updated PR, please review now. |
@mudassar-ublox cellular properties look good. but still need to refactor power and SMS classes. |
389d503
to
c85b12f
Compare
I have updated PR, power classes are removed and SMS classes are already updated. Please review and let me know if anything else is required. |
I think |
I noticed that |
Yes, in Ublox api's |
@AriParkkila you shared Astyle.exe on my previous pull request. Can I use that on this PR for Astyling issuse? |
Updated api and removed Astyle issue. Please review now. |
@mudassar-ublox There are still astyle issues. Please review. Astyle Quickfix: Feel free to run the following script to correct this PR's astyle issues identified by Travis CI. git apply -3 <<'PATCH' && git commit -am "Applied suggested astyle fixes" && git push
diff --git a/features/cellular/TESTS/api/cellular_sms/main.cpp b/features/cellular/TESTS/api/cellular_sms/main.cpp
index 7947696dd1..79390bc0d6 100644
--- a/features/cellular/TESTS/api/cellular_sms/main.cpp
+++ b/features/cellular/TESTS/api/cellular_sms/main.cpp
@@ -111,20 +111,20 @@ static void test_sms_initialize_pdu_mode()
{
nsapi_error_t err = sms->initialize(CellularSMS::CellularSMSMmodePDU);
TEST_ASSERT(err == NSAPI_ERROR_OK || err == NSAPI_ERROR_UNSUPPORTED || (err == NSAPI_ERROR_DEVICE_ERROR &&
- ((AT_CellularSMS *)sms)->get_device_error().errCode == SIM_BUSY));
+ ((AT_CellularSMS *)sms)->get_device_error().errCode == SIM_BUSY));
}
static void test_set_cscs()
{
nsapi_error_t err = sms->set_cscs("IRA");
TEST_ASSERT(err == NSAPI_ERROR_OK || err == NSAPI_ERROR_UNSUPPORTED || (err == NSAPI_ERROR_DEVICE_ERROR &&
- ((AT_CellularSMS *)sms)->get_device_error().errCode == SIM_BUSY));
+ ((AT_CellularSMS *)sms)->get_device_error().errCode == SIM_BUSY));
err = sms->set_cscs("UCS2");
TEST_ASSERT(err == NSAPI_ERROR_OK || err == NSAPI_ERROR_UNSUPPORTED || (err == NSAPI_ERROR_DEVICE_ERROR &&
- ((AT_CellularSMS *)sms)->get_device_error().errCode == SIM_BUSY));
+ ((AT_CellularSMS *)sms)->get_device_error().errCode == SIM_BUSY));
err = sms->set_cscs("GSM");
TEST_ASSERT(err == NSAPI_ERROR_OK || err == NSAPI_ERROR_UNSUPPORTED || (err == NSAPI_ERROR_DEVICE_ERROR &&
- ((AT_CellularSMS *)sms)->get_device_error().errCode == SIM_BUSY));
+ ((AT_CellularSMS *)sms)->get_device_error().errCode == SIM_BUSY));
}
static void test_set_csca()
@@ -144,7 +144,7 @@ static void test_set_cpms_me()
{
nsapi_error_t err = sms->set_cpms("ME", "ME", "ME");
TEST_ASSERT(err == NSAPI_ERROR_OK || err == NSAPI_ERROR_UNSUPPORTED || (err == NSAPI_ERROR_DEVICE_ERROR &&
- ((AT_CellularSMS *)sms)->get_device_error().errCode == SIM_BUSY));
+ ((AT_CellularSMS *)sms)->get_device_error().errCode == SIM_BUSY));
}
#ifdef MBED_CONF_APP_CELLULAR_PHONE_NUMBER
PATCH |
@cmonr suggested patch is applied, please review now. |
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.
LGTM.
@AriParkkila Happy with it now? |
CI started |
Test run: SUCCESSSummary: 13 of 13 test jobs passed |
Description
This PR updates the cellular API's for UBLOX target
UBLOX_C030_N211
. It has target typeUBLOX_N2XX
. These API support only UDP operations.Supported Targets: UBLOX_C030_N211
Tool Chains: ARM, GCC_ARM, IAR
ARM_Build.txt
GCC_Build.txt
IAR_Build.txt
Pull request type
Reviewers