Skip to content

Commit 13d3528

Browse files
JordanYateskartben
authored andcommitted
net: l2: ppp: expose the peer ACCM
Expose the currently configured value for the PPP peers Asynchronous Control Character Map through a public function. Signed-off-by: Jordan Yates <[email protected]>
1 parent d64f570 commit 13d3528

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

include/zephyr/net/ppp.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,15 @@ struct net_if;
597597

598598
/** @endcond */
599599

600+
/**
601+
* @brief Retrieve the PPP peers Asynchronous Control Character Map
602+
*
603+
* @param iface PPP network interface.
604+
*
605+
* @return uint32_t Current bitmask for the Asynchronous Control Character Map
606+
*/
607+
uint32_t ppp_peer_async_control_character_map(struct net_if *iface);
608+
600609
/** Event emitted when PPP carrier is on */
601610
#define NET_EVENT_PPP_CARRIER_ON \
602611
(NET_PPP_EVENT | NET_EVENT_PPP_CMD_CARRIER_ON)

subsys/net/l2/ppp/ppp_l2.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ LOG_MODULE_REGISTER(net_l2_ppp, CONFIG_NET_L2_PPP_LOG_LEVEL);
1515
#include <zephyr/net/net_pkt.h>
1616
#include <zephyr/net/net_mgmt.h>
1717
#include <zephyr/net/ppp.h>
18+
#include <zephyr/sys/__assert.h>
1819
#include <zephyr/sys/iterable_sections.h>
1920

2021
#include "net_private.h"
@@ -345,6 +346,15 @@ static int ppp_enable(struct net_if *iface, bool state)
345346
return ret;
346347
}
347348

349+
uint32_t ppp_peer_async_control_character_map(struct net_if *iface)
350+
{
351+
struct ppp_context *ctx;
352+
353+
__ASSERT(net_if_l2(iface) == &NET_L2_GET_NAME(PPP), "Not PPP L2");
354+
ctx = net_if_l2_data(iface);
355+
return ctx->lcp.peer_options.async_map;
356+
}
357+
348358
NET_L2_INIT(PPP_L2, ppp_recv, ppp_send, ppp_enable, ppp_flags);
349359

350360
#if defined(CONFIG_NET_SHELL)

0 commit comments

Comments
 (0)