mirror of
https://github.com/cesanta/mongoose.git
synced 2026-12-04 21:58:22 +00:00
remove PHY_TX/RX
This commit is contained in:
1 parent
948f16bab3
commit
39bfa22037
5 files changed
+17
-36
No files matched your search
+3
-7
@@ -206,11 +206,9 @@ static void mgi_radio_frame_header(uint8_t *frame, uint16_t dst, uint16_t src,
|
||||
frame[MGI_RADIO_HDR_LEN] = type, frame[MGI_RADIO_HDR_LEN + 1] = burst;
|
||||
}
|
||||
|
||||
// Hand a radio frame to the hardware. The interface's fn sees it first
|
||||
// Hand a radio frame to the hardware.
|
||||
static bool mgi_radio_send(struct mg_radio_node *node, const void *frame,
|
||||
size_t len) {
|
||||
struct mg_str s = mg_str_n((const char *) frame, len);
|
||||
mg_tcpip_call(node->ifp, MG_TCPIP_EV_PHY_TX, &s);
|
||||
return node->hw_tx(node->ifp, frame, len) == len;
|
||||
}
|
||||
|
||||
@@ -731,12 +729,10 @@ bool mg_radio_poll(struct mg_tcpip_if *ifp, bool s1) {
|
||||
while (node->rx_len == 0 &&
|
||||
(len = mg_queue_next(&node->frames, &record)) != 0) {
|
||||
if (len > MGI_RX_STAMP_LEN) {
|
||||
struct mg_str s =
|
||||
mg_str_n(record + MGI_RX_STAMP_LEN, len - MGI_RX_STAMP_LEN);
|
||||
uint64_t arrived;
|
||||
memcpy(&arrived, record, MGI_RX_STAMP_LEN);
|
||||
mg_tcpip_call(ifp, MG_TCPIP_EV_PHY_RX, &s);
|
||||
mgi_radio_input(node, arrived, s.buf, s.len);
|
||||
mgi_radio_input(node, arrived, record + MGI_RX_STAMP_LEN,
|
||||
len - MGI_RX_STAMP_LEN);
|
||||
}
|
||||
mg_queue_del(&node->frames, len);
|
||||
}
|
||||
|
||||
@@ -40,8 +40,6 @@ enum {
|
||||
MG_TCPIP_EV_WIFI_CONNECT_ERR, // Wi-Fi connection failed driver and chip specific
|
||||
MG_TCPIP_EV_DRIVER, // Driver-defined event driver specific
|
||||
MG_TCPIP_EV_STATE6_CHANGE, // IPv6 link state changed uint8_t *(&ifp->state6)
|
||||
MG_TCPIP_EV_PHY_RX, // Radio frame received struct mg_str *
|
||||
MG_TCPIP_EV_PHY_TX, // Radio frame about to be sent struct mg_str *
|
||||
MG_TCPIP_EV_PHY_INIT, // PHY initialised struct mg_phy *
|
||||
MG_TCPIP_EV_USER // Starting ID for user-defined events
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user