-
Notifications
You must be signed in to change notification settings - Fork 51
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
Conversation
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.
compilation error in a debug print
tls-client/HelloHttpsClient.cpp
Outdated
return -1; | ||
} | ||
ret = network->connect(); | ||
if (ret != 0) { | ||
printf("Error! network->connect() returned: %d\n", r); |
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.
compilation error: r->ret
change to mbedtls_printf()
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. |
NetworkInterface API is already published in 5.9, so this should work on at least Ethernet enabled boards. So you do not necessary need flagging. |
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. |
Examples get tagged for the release they go with. Do we really need a configuration flag? |
This looks good to me as is, except for the issues Ron raised in #198 (comment) |
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 |
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.
The changes look good, but please address @RonEld's comment regarding print().
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 concur with other reviewers, the changes look good, but the issue pointed out by @RonEld must be fixed.
Please treat this with priority. 5.10 released and this example should be updated |
Fixed the errors pointed out in this 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.
LGTM, also I built it quickly with GCC_ARM and ran on a K64F, and I confirm that it builds and runs successfully.
Review is outdated by changes.
Now the application should work on WiFi boards as well. There is example |
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