-
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
BG96: Add correct get_ip_address implementation #14814
Conversation
The default get_ip_address implementation was not working for BG9x. Furthermore the cellular connect routine tries to get the address multiple times, which added around 2 seconds of unnecessary delay to the connection. This commit adds the correct implementation using the AT+QIACT? command.
@boraozgen, thank you for your changes. |
_stack_type = IPV4_STACK; | ||
} else if (context_type == 2) { | ||
_stack_type = IPV6_STACK; | ||
} |
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.
either it's physically impossible for other values to be here or there should be an else clause
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.
Only allowed values are 1 and 2 according to the BG96 TCP/IP application note.
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.
in which case the second else if
is redundant and could just be an else
, would also make my comment below moot as well but it's all nitpicking really
_stack_type = IPV6_STACK; | ||
} | ||
|
||
if (_at.read_string(_ip, PDP_IPV6_SIZE) != -1) { |
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 guess this should only run if context_type != 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.
context_type is always 1 or 2, would only make sense to run if context_state = 1 (activated)
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.
BTW, read_string would return -1 if there is no such string, so I believe it is fine like this. The overridden get_ip_address is also implemented this way.
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 code looks sensible but I cannot test on the board myself, I trust the @boraozgen did.
_stack_type = IPV4_STACK; | ||
} else if (context_type == 2) { | ||
_stack_type = IPV6_STACK; | ||
} |
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.
in which case the second else if
is redundant and could just be an else
, would also make my comment below moot as well but it's all nitpicking really
This pull request has automatically been marked as stale because it has had no recent activity. @ARMmbed/mbed-os-maintainers, please start CI to get the PR merged. |
CI started |
Jenkins CI Test : ✔️ SUCCESSBuild Number: 1 | 🔒 Jenkins CI Job | 🌐 Logs & ArtifactsCLICK for Detailed Summary
|
Opened again since #14761 was closed unintentionally.
The default get_ip_address implementation was not working for
BG9x. Furthermore the cellular connect routine tries to get the
address multiple times, which added around 2 seconds of
unnecessary delay to the connection. This commit adds the correct
implementation using the AT+QIACT? command.
Summary of changes
Impact of changes
Migration actions required
Documentation
Pull request type
Test results
Reviewers