vrahane commented on a change in pull request #1917: Use SMP/OMP/MCUmgr, remove
newtmgr and change OICMGR to use OMP
URL: https://github.com/apache/mynewt-core/pull/1917#discussion_r332302101
##########
File path: mgmt/smp/transport/smp_uart/src/smp_uart.c
##########
@@ -296,56 +296,56 @@ nmgr_uart_rx_pkt(struct nmgr_uart_state *nus, struct
os_mbuf_pkthdr *rxm)
* Callback from mgmt task context.
*/
static void
-nmgr_uart_rx_frame(struct os_event *ev)
+smp_uart_rx_frame(struct os_event *ev)
{
- struct nmgr_uart_state *nus = NUS_EV_TO_STATE(ev);
+ struct smp_uart_state *sus = NUS_EV_TO_STATE(ev);
struct os_mbuf_pkthdr *m;
int sr;
OS_ENTER_CRITICAL(sr);
- m = nus->nus_rx_q;
- nus->nus_rx_q = NULL;
+ m = sus->sus_rx_q;
+ sus->sus_rx_q = NULL;
OS_EXIT_CRITICAL(sr);
if (m) {
- nmgr_uart_rx_pkt(nus, m);
+ smp_uart_rx_pkt(sus, m);
}
}
/**
* Receive a character from UART.
*/
static int
-nmgr_uart_rx_char(void *arg, uint8_t data)
+smp_uart_rx_char(void *arg, uint8_t data)
{
- struct nmgr_uart_state *nus = (struct nmgr_uart_state *)arg;
+ struct smp_uart_state *sus = (struct smp_uart_state *)arg;
struct os_mbuf *m;
int rc;
- if (!nus->nus_rx) {
+ if (!sus->sus_rx) {
m = os_msys_get_pkthdr(MGMT_NLIP_MAX_FRAME, 0);
if (!m) {
return 0;
}
- nus->nus_rx = OS_MBUF_PKTHDR(m);
+ sus->sus_rx = OS_MBUF_PKTHDR(m);
if (OS_MBUF_TRAILINGSPACE(m) < MGMT_NLIP_MAX_FRAME) {
/*
* mbuf is too small.
*/
os_mbuf_free_chain(m);
- nus->nus_rx = NULL;
+ sus->sus_rx = NULL;
return 0;
}
}
- m = OS_MBUF_PKTHDR_TO_MBUF(nus->nus_rx);
+ m = OS_MBUF_PKTHDR_TO_MBUF(sus->sus_rx);
if (data == '\n') {
/*
* Full line of input. Process it outside interrupt context.
*/
- assert(!nus->nus_rx_q);
- nus->nus_rx_q = nus->nus_rx;
- nus->nus_rx = NULL;
- os_eventq_put(mgmt_evq_get(), &nus->nus_cb_ev);
+ assert(!sus->sus_rx_q);
+ sus->sus_rx_q = sus->sus_rx;
+ sus->sus_rx = NULL;
+ os_eventq_put(mgmt_evq_get(), &sus->sus_cb_ev);
Review comment:
added in smp.h
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services