Skip to content
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

applications: serial_lte_mondem: NCSIDB-138 Serial LTE Modem two feat… #2508

Merged
merged 1 commit into from
Jun 23, 2020

Conversation

junqingzou
Copy link
Contributor

Customer engineering, new features added to SLM TCP Proxy

Feature #1 is handled by new unsolicited notification of "#XTCPDATA",
then client could fetch all data with "AT#XTCPRECV" command. If
received data cannot be reserved inside SLM, an OVERRUN unsolicited
notification is sent then data is dropped.

Feature #2 is handled by returning socket handles. Also added an
unsolicited notification when TCP Server close client connection due to
connection time-out.

Signed-off-by: Jun Qing Zou jun.qing.zou@nordicsemi.no

@NordicBuilder
Copy link
Contributor

NordicBuilder commented Jun 20, 2020

All checks are passing now.

Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages.

@@ -19,6 +19,7 @@ LOG_MODULE_REGISTER(tcp_proxy, CONFIG_SLM_LOG_LEVEL);
#define THREAD_STACK_SIZE (KB(1) + NET_IPV4_MTU)
#define THREAD_PRIORITY K_LOWEST_APPLICATION_THREAD_PRIO
#define DATA_HEX_MAX_SIZE (2 * NET_IPV4_MTU)
#define data_buf_SIZE CONFIG_AT_CMD_RESPONSE_MAX_LEN/2
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use upper case for defines. Spaces around /.

@@ -344,6 +350,33 @@ static int do_tcp_send(const u8_t *data, int datalen)
}
}

static int tcp_data_save(u8_t *data, u16_t length)
{
u16_t sz_avail;
Copy link
Contributor

Choose a reason for hiding this comment

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

Zephyr provides a ring buffer implementation, have you considered using it instead of implementing it on your own? Should be less error-prone:
https://github.com/zephyrproject-rtos/zephyr/blob/master/include/sys/ring_buffer.h#L346
From what I understand all we need is to declare a ring buffer and then call ring_buf_put()/ring_buf_get() when needed.

…ures

Customer engineering, new features added to SLM TCP Proxy
Feature nrfconnect#1 is handled by new unsolicited notification of "#XTCPDATA",
then client could fetch all data with "AT#XTCPRECV" command. If
received data cannot be reserved inside SLM, an OVERRUN unsolicited
notification is sent then data is dropped.
Feature nrfconnect#2 is handled by returning socket handles. Also added an
unsolicited notification when TCP Server close client connection due to
connection time-out.

Signed-off-by: Jun Qing Zou <jun.qing.zou@nordicsemi.no>
Copy link
Contributor

@rlubos rlubos left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@martiles martiles left a comment

Choose a reason for hiding this comment

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

LGTM

@rlubos rlubos merged commit 336e77c into nrfconnect:master Jun 23, 2020
@junqingzou junqingzou deleted the pr_ncsidb_138 branch June 29, 2020 23:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants