mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-30 21:18:25 +00:00
remove PHY_TX/RX
This commit is contained in:
1 parent
3322a119eb
commit
3d116475af
5 files changed
+17
-36
No files matched your search
+2
-7
@@ -34596,11 +34596,8 @@ 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
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -35121,12 +35118,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);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user