Skip to content

Don't use easy-connect, use NetworkInterface::get_default_instance() #198

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

Merged
merged 1 commit into from
Sep 27, 2018

Conversation

SeppoTakalo
Copy link
Contributor

@SeppoTakalo SeppoTakalo commented Aug 31, 2018

After Mbed OS 5.9, there is API to as a default network interface from Mbed OS.

See: https://os.mbed.com/docs/v5.9/reference/configuration-connectivity.html#selecting-the-default-network-interface

During Mbed OS 5.10 all driver should begin to support this, including external drivers.

Also, as some drivers are entering Mbed OS repository, our examples cannot anymore refer to easy-connect which would pull in those exact same drivers. Leads to duplicated code.

This is needed to get this working with 5.10

RonEld
RonEld previously requested changes Sep 3, 2018
Copy link
Contributor

@RonEld RonEld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compilation error in a debug print

return -1;
}
ret = network->connect();
if (ret != 0) {
printf("Error! network->connect() returned: %d\n", r);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

compilation error: r->ret

change to mbedtls_printf()

@RonEld RonEld mentioned this pull request Sep 3, 2018
@RonEld
Copy link
Contributor

RonEld commented Sep 3, 2018

Since using the NetworkInterface is needed for 5.10, but prior we need to use easy-connect, we should have some run-time flag \ version tag to decide whether we use NetworkInterface or easy-connect.
It is not unlikely that one will use an older version of Mbed OS on latest examples branch.

@SeppoTakalo
Copy link
Contributor Author

NetworkInterface API is already published in 5.9, so this should work on at least Ethernet enabled boards.
In 5.10 timeframe all other driver types should become supported.

So you do not necessary need flagging.

@RonEld
Copy link
Contributor

RonEld commented Sep 3, 2018

Yes, I agree, I was thinking of a more backwards compatible to older Mbed OS version, but for that, we have the specific version tags that should be used.

@Patater
Copy link
Contributor

Patater commented Sep 3, 2018

Examples get tagged for the release they go with. Do we really need a configuration flag?

@Patater
Copy link
Contributor

Patater commented Sep 3, 2018

This looks good to me as is, except for the issues Ron raised in #198 (comment)

@RonEld
Copy link
Contributor

RonEld commented Sep 3, 2018

Examples get tagged for the release they go with. Do we really need a configuration flag?

No, I agree that the tag is enough. But we should consider merging #193 prior to this PR, and create tag for 5.9.x before, and then merge this PR, and create tag for 5.10

Copy link

@andresag01 andresag01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes look good, but please address @RonEld's comment regarding print().

Copy link
Contributor

@k-stachowiak k-stachowiak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I concur with other reviewers, the changes look good, but the issue pointed out by @RonEld must be fixed.

@0xc0170
Copy link
Contributor

0xc0170 commented Sep 27, 2018

This is needed to get this working with 5.10

Please treat this with priority. 5.10 released and this example should be updated

@SeppoTakalo
Copy link
Contributor Author

Fixed the errors pointed out in this review.
Rebased on top of master.

Copy link
Contributor

@k-stachowiak k-stachowiak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, also I built it quickly with GCC_ARM and ran on a K64F, and I confirm that it builds and runs successfully.

@simonbutcher simonbutcher dismissed stale reviews from andresag01 and RonEld September 27, 2018 10:09

Review is outdated by changes.

@simonbutcher simonbutcher merged commit 086bafb into ARMmbed:master Sep 27, 2018
@SeppoTakalo
Copy link
Contributor Author

Now the application should work on WiFi boards as well.

There is example mbed_app.json in the Socket example documentation
https://github.com/ARMmbed/mbed-os-example-sockets#selecting-the-network-interface

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants