-
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
Remove string-based API usage within mbed-os #11941
Remove string-based API usage within mbed-os #11941
Conversation
@0xc0170 , again, I could not run all possible platforms, but at least I checked unittests and some combinations of UBLOX/K64F with different compilers. I'd be grateful for starting a CI, as the API is scatterred and some extra changes might be required. |
@michalpasztamobica, thank you for your changes. |
b858fad
to
19c9761
Compare
Pushed astyle fixes. |
@@ -137,6 +137,8 @@ class ESP8266Interface : public NetworkStack, public WiFiInterface { | |||
/** Get the internally stored IP address | |||
* @return IP address of the interface or null if not yet connected | |||
*/ | |||
virtual nsapi_error_t get_ip_address(SocketAddress *address); | |||
|
|||
virtual const char *get_ip_address(); |
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.
Should we mark these as deprecated as well?
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.
I pushed an update deprecating string-based API of ESP8266
driver. I think this is a matter of being consequent. We cannot forbid member function overloading, but at least we can give a good example.
Another thing is that users will most likely use NetworkInterface::get_default_instance()
rather that consciously creating EPS8266Interface
, so they should be given deprecation warnings if they use string-based APIs anyway?
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.
We might want to drop string based functions also from drivers (at least from those we have made), but that can be done later
19c9761
to
1de97e9
Compare
CI started |
Test run: FAILEDSummary: 1 of 12 test jobs failed Failed test jobs:
|
I will investigate the failure. |
With the Regarding I put the above changes into separate commits. For For the NULCEO_F429ZI failures - I don't know what is going on. I run the tests locally and they all passed. The logs also do not indicate any particular issue... |
CI started |
Test run: FAILEDSummary: 1 of 12 test jobs failed Failed test jobs:
|
OK. The only failures left are coming from |
If this needs an update like that, is this breaking change? |
@AnttiKauppila , @0xc0170 I am slightly afraid that this PR might wreak havoc in the nightly tests... Not sure how many different platform use external stacks? |
Once it's merged, lets start CI again. Set as preceding PR needed here |
CI restarted |
Test run: FAILEDSummary: 1 of 12 test jobs failed Failed test jobs:
|
@michalpasztamobica Please can you review the failures? |
@0xc0170 , I am working on it... |
Root cause: wifi-ism43362 driver's We can however proceed with the release, because after some more thinking I decided to remove If I added SocketAddress validity checks to I added an internal JIRA to find out what is the expected behavior of @0xc0170 , please restart the CI, unless you see some gap in my way of thinking? |
Updated: * netsocket classes, * unittests, stubs and mocks, * greentea tests
It tested parameter checks in the now obsoleted string-based API.
72ea0e9
to
71db612
Compare
I pushed a cleaned-up commit history and test documentation updates. |
Is everyone OK with the removal of the test? Can we move forward with this? |
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.
I'm OK with the change.
However, I did not spot, do we still have test case where we bind()
on a socket without specifying the address, just the port number?
SocketAddress port;
port.set_port(80);
socket.bind(port); // Should not require you to specify IP address.
socket.listen();
s = socket.accept();
Yes. We do have |
I started CI meanwhile |
Test run: SUCCESSSummary: 12 of 12 test jobs passed |
@AnttiKauppila , would you confirm that you're ok with the recent changes? |
Hi @0xc0170 , just to sum up the situation, as it got a bit complex with all the CI failures: If there is anything more that I can do to improve this PR, please let me know :). |
@michalpasztamobica Thanks for the updates, keeps us all update about the progress 👍 |
@@ -92,6 +92,41 @@ const char *PPPInterface::get_ip_address() | |||
return NULL; | |||
} | |||
|
|||
nsapi_error_t PPPInterface::get_ip_address(SocketAddress *address) | |||
{ | |||
if (address) { |
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.
Sorry, I didn't notice this earlier, but there's a bug in here. Should be if (!address) {
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.
Description
Summary of change
Remove internal usage of deprecated string-based APIs.
The APIs were deprecated in #11914
This is still NOT a breaking change. The existing code was updated not to use the deprecated API functions, but the deprecated functions themselves are still available.
Documentation
The documentation was updated in the deprecation PR. Wherever new API had to be added I adjusted existing documentation.
Pull request type
Test results
Reviewers
@AnttiKauppila
@SeppoTakalo
@mikter
@AriParkkila
Release Notes
See #11914 for deprecation information, this PR provides
SocketAddress
-based APIs if they were missing after previous changes, but still does not remove the old APIs.Summary of changes
New
SocketAddress
based API added toESP8266
module, anticipating future string-based API removal.Impact of changes
Migration actions required