Loading...
Searching...
No Matches
gomach_internal.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2017 INRIA
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
19#ifndef GOMACH_INTERNAL_H
20#define GOMACH_INTERNAL_H
21
22#include <stdint.h>
23
24#include "periph/rtt.h"
25#include "net/gnrc/netif.h"
26
27#ifdef __cplusplus
28extern "C" {
29#endif
30
34#define GNRC_GOMACH_INFO_TX_FINISHED (0x0008U)
35
39#define GNRC_GOMACH_INFO_PKT_RECEIVED (0x0010U)
40
44#define GNRC_GOMACH_INTERNAL_INFO_ND_UPDATE (0x0001U)
45
49#define GNRC_GOMACH_INTERNAL_INFO_QUIT_CYCLE (0x0002U)
50
54#define GNRC_GOMACH_INTERNAL_INFO_CP_END (0x0004U)
55
59#define GNRC_GOMACH_INTERNAL_INFO_VTDMA_END (0x0008U)
60
64#define GNRC_GOMACH_INTERNAL_INFO_UNINTD_PREAMBLE (0x0010U)
65
69#define GNRC_GOMACH_INTERNAL_INFO_GOT_PREAMBLE (0x0020U)
70
74#define GNRC_GOMACH_INTERNAL_INFO_DUTY_CYCLE_START (0x0040U)
75
79#define GNRC_GOMACH_INTERNAL_INFO_PHASE_BACKOFF (0x0080U)
80
84#define GNRC_GOMACH_INTERNAL_INFO_BEACON_FAIL (0x0200U)
85
89#define GNRC_GOMACH_INTERNAL_INFO_BUFFER_FULL (0x0400U)
90
94#define GNRC_GOMACH_INTERNAL_INFO_ENTER_NEW_CYCLE (0x0800U)
95
99#define GNRC_GOMACH_INTERNAL_INFO_GOT_PREAMBLEACK (0x1000U)
100
104#define GNRC_GOMACH_INTERNAL_INFO_ON_PUBCHAN_1 (0x2000U)
105
109#define GNRC_GOMACH_INTERNAL_INFO_MAX_PREAM_INTERV (0x4000U)
110
114#define GNRC_GOMACH_INTERNAL_INFO_RADIO_IS_ON (0x8000U)
115
124static inline void gnrc_gomach_set_tx_finish(gnrc_netif_t *netif, bool tx_finish)
125{
126 if (tx_finish) {
128 }
129 else {
130 netif->mac.mac_info &= ~GNRC_GOMACH_INFO_TX_FINISHED;
131 }
132}
133
142static inline bool gnrc_gomach_get_tx_finish(gnrc_netif_t *netif)
143{
144 return (netif->mac.mac_info & GNRC_GOMACH_INFO_TX_FINISHED);
145}
146
155static inline void gnrc_gomach_set_pkt_received(gnrc_netif_t *netif, bool received)
156{
157 if (received) {
159 }
160 else {
161 netif->mac.mac_info &= ~GNRC_GOMACH_INFO_PKT_RECEIVED;
162 }
163}
164
174{
176}
177
186static inline void gnrc_gomach_set_quit_cycle(gnrc_netif_t *netif, bool quit)
187{
188 if (quit) {
189 netif->mac.prot.gomach.gomach_info |= GNRC_GOMACH_INTERNAL_INFO_QUIT_CYCLE;
190 }
191 else {
192 netif->mac.prot.gomach.gomach_info &= ~GNRC_GOMACH_INTERNAL_INFO_QUIT_CYCLE;
193 }
194}
195
204static inline bool gnrc_gomach_get_quit_cycle(gnrc_netif_t *netif)
205{
206 return (netif->mac.prot.gomach.gomach_info & GNRC_GOMACH_INTERNAL_INFO_QUIT_CYCLE);
207}
208
217static inline void gnrc_gomach_set_got_preamble(gnrc_netif_t *netif, bool got_preamble)
218{
219 if (got_preamble) {
220 netif->mac.prot.gomach.gomach_info |= GNRC_GOMACH_INTERNAL_INFO_GOT_PREAMBLE;
221 }
222 else {
223 netif->mac.prot.gomach.gomach_info &= ~GNRC_GOMACH_INTERNAL_INFO_GOT_PREAMBLE;
224 }
225}
226
236{
237 return (netif->mac.prot.gomach.gomach_info & GNRC_GOMACH_INTERNAL_INFO_GOT_PREAMBLE);
238}
239
248static inline void gnrc_gomach_set_cp_end(gnrc_netif_t *netif, bool cp_end)
249{
250 if (cp_end) {
251 netif->mac.prot.gomach.gomach_info |= GNRC_GOMACH_INTERNAL_INFO_CP_END;
252 }
253 else {
254 netif->mac.prot.gomach.gomach_info &= ~GNRC_GOMACH_INTERNAL_INFO_CP_END;
255 }
256}
257
266static inline bool gnrc_gomach_get_cp_end(gnrc_netif_t *netif)
267{
268 return (netif->mac.prot.gomach.gomach_info & GNRC_GOMACH_INTERNAL_INFO_CP_END);
269}
270
279static inline void gnrc_gomach_set_vTDMA_end(gnrc_netif_t *netif, bool vtdma_end)
280{
281 if (vtdma_end) {
282 netif->mac.prot.gomach.gomach_info |= GNRC_GOMACH_INTERNAL_INFO_VTDMA_END;
283 }
284 else {
285 netif->mac.prot.gomach.gomach_info &= ~GNRC_GOMACH_INTERNAL_INFO_VTDMA_END;
286 }
287}
288
297static inline bool gnrc_gomach_get_vTDMA_end(gnrc_netif_t *netif)
298{
299 return (netif->mac.prot.gomach.gomach_info & GNRC_GOMACH_INTERNAL_INFO_VTDMA_END);
300}
301
310static inline void gnrc_gomach_set_unintd_preamble(gnrc_netif_t *netif, bool uintd_preamble)
311{
312 if (uintd_preamble) {
313 netif->mac.prot.gomach.gomach_info |= GNRC_GOMACH_INTERNAL_INFO_UNINTD_PREAMBLE;
314 }
315 else {
316 netif->mac.prot.gomach.gomach_info &= ~GNRC_GOMACH_INTERNAL_INFO_UNINTD_PREAMBLE;
317 }
318}
319
329{
330 return (netif->mac.prot.gomach.gomach_info & GNRC_GOMACH_INTERNAL_INFO_UNINTD_PREAMBLE);
331}
332
341static inline void gnrc_gomach_set_update(gnrc_netif_t *netif, bool update)
342{
343 if (update) {
344 netif->mac.prot.gomach.gomach_info |= GNRC_GOMACH_INTERNAL_INFO_ND_UPDATE;
345 }
346 else {
347 netif->mac.prot.gomach.gomach_info &= ~GNRC_GOMACH_INTERNAL_INFO_ND_UPDATE;
348 }
349}
350
359static inline bool gnrc_gomach_get_update(gnrc_netif_t *netif)
360{
361 return (netif->mac.prot.gomach.gomach_info & GNRC_GOMACH_INTERNAL_INFO_ND_UPDATE);
362}
363
372static inline void gnrc_gomach_set_duty_cycle_start(gnrc_netif_t *netif, bool start)
373{
374 if (start) {
375 netif->mac.prot.gomach.gomach_info |= GNRC_GOMACH_INTERNAL_INFO_DUTY_CYCLE_START;
376 }
377 else {
378 netif->mac.prot.gomach.gomach_info &= ~GNRC_GOMACH_INTERNAL_INFO_DUTY_CYCLE_START;
379 }
380}
381
391{
392 return (netif->mac.prot.gomach.gomach_info & GNRC_GOMACH_INTERNAL_INFO_DUTY_CYCLE_START);
393}
394
403static inline void gnrc_gomach_set_phase_backoff(gnrc_netif_t *netif, bool backoff)
404{
405 if (backoff) {
406 netif->mac.prot.gomach.gomach_info |= GNRC_GOMACH_INTERNAL_INFO_PHASE_BACKOFF;
407 }
408 else {
409 netif->mac.prot.gomach.gomach_info &= ~GNRC_GOMACH_INTERNAL_INFO_PHASE_BACKOFF;
410 }
411}
412
422{
423 return (netif->mac.prot.gomach.gomach_info & GNRC_GOMACH_INTERNAL_INFO_PHASE_BACKOFF);
424}
425
434static inline void gnrc_gomach_set_beacon_fail(gnrc_netif_t *netif, bool fail)
435{
436 if (fail) {
437 netif->mac.prot.gomach.gomach_info |= GNRC_GOMACH_INTERNAL_INFO_BEACON_FAIL;
438 }
439 else {
440 netif->mac.prot.gomach.gomach_info &= ~GNRC_GOMACH_INTERNAL_INFO_BEACON_FAIL;
441 }
442}
443
453{
454 return (netif->mac.prot.gomach.gomach_info & GNRC_GOMACH_INTERNAL_INFO_BEACON_FAIL);
455}
456
465static inline void gnrc_gomach_set_buffer_full(gnrc_netif_t *netif, bool full)
466{
467 if (full) {
468 netif->mac.prot.gomach.gomach_info |= GNRC_GOMACH_INTERNAL_INFO_BUFFER_FULL;
469 }
470 else {
471 netif->mac.prot.gomach.gomach_info &= ~GNRC_GOMACH_INTERNAL_INFO_BUFFER_FULL;
472 }
473}
474
484{
485 return (netif->mac.prot.gomach.gomach_info & GNRC_GOMACH_INTERNAL_INFO_BUFFER_FULL);
486}
487
496static inline void gnrc_gomach_set_enter_new_cycle(gnrc_netif_t *netif, bool enter)
497{
498 if (enter) {
499 netif->mac.prot.gomach.gomach_info |= GNRC_GOMACH_INTERNAL_INFO_ENTER_NEW_CYCLE;
500 }
501 else {
502 netif->mac.prot.gomach.gomach_info &= ~GNRC_GOMACH_INTERNAL_INFO_ENTER_NEW_CYCLE;
503 }
504}
505
515{
516 return (netif->mac.prot.gomach.gomach_info & GNRC_GOMACH_INTERNAL_INFO_ENTER_NEW_CYCLE);
517}
518
527static inline void gnrc_gomach_set_got_preamble_ack(gnrc_netif_t *netif, bool got)
528{
529 if (got) {
530 netif->mac.prot.gomach.gomach_info |= GNRC_GOMACH_INTERNAL_INFO_GOT_PREAMBLEACK;
531 }
532 else {
533 netif->mac.prot.gomach.gomach_info &= ~GNRC_GOMACH_INTERNAL_INFO_GOT_PREAMBLEACK;
534 }
535}
536
546{
547 return (netif->mac.prot.gomach.gomach_info & GNRC_GOMACH_INTERNAL_INFO_GOT_PREAMBLEACK);
548}
549
558static inline void gnrc_gomach_set_on_pubchan_1(gnrc_netif_t *netif, bool on_pubchan_1)
559{
560 if (on_pubchan_1) {
561 netif->mac.prot.gomach.gomach_info |= GNRC_GOMACH_INTERNAL_INFO_ON_PUBCHAN_1;
562 }
563 else {
564 netif->mac.prot.gomach.gomach_info &= ~GNRC_GOMACH_INTERNAL_INFO_ON_PUBCHAN_1;
565 }
566}
567
577{
578 return (netif->mac.prot.gomach.gomach_info & GNRC_GOMACH_INTERNAL_INFO_ON_PUBCHAN_1);
579}
580
589static inline void gnrc_gomach_set_max_pream_interv(gnrc_netif_t *netif, bool max)
590{
591 if (max) {
592 netif->mac.prot.gomach.gomach_info |= GNRC_GOMACH_INTERNAL_INFO_MAX_PREAM_INTERV;
593 }
594 else {
595 netif->mac.prot.gomach.gomach_info &= ~GNRC_GOMACH_INTERNAL_INFO_MAX_PREAM_INTERV;
596 }
597}
598
608{
609 return (netif->mac.prot.gomach.gomach_info & GNRC_GOMACH_INTERNAL_INFO_MAX_PREAM_INTERV);
610}
611
620
628
636static inline void gnrc_gomach_set_autoack(gnrc_netif_t *netif, netopt_enable_t autoack)
637{
638 assert(netif != NULL);
639
640 netif->dev->driver->set(netif->dev,
642 &autoack,
643 sizeof(autoack));
644}
645
653static inline void gnrc_gomach_set_ack_req(gnrc_netif_t *netif, netopt_enable_t ack_req)
654{
655 assert(netif != NULL);
656
657 netif->dev->driver->set(netif->dev,
659 &ack_req,
660 sizeof(ack_req));
661}
662
672{
673 assert(netif != NULL);
674
675 netopt_state_t state;
676
677 if (0 < netif->dev->driver->get(netif->dev,
679 &state,
680 sizeof(state))) {
681 return state;
682 }
683 return -ENOSYS;
684}
685
693static inline void gnrc_gomach_turn_channel(gnrc_netif_t *netif, uint16_t channel_num)
694{
695 assert(netif != NULL);
696
697 netif->dev->driver->set(netif->dev,
699 &channel_num,
700 sizeof(channel_num));
701}
702
726
737
749
760
770
781
792
800
808
819
830
839
847
858
869
878
887
895
903
911
912#ifdef __cplusplus
913}
914#endif
915
916#endif /* GOMACH_INTERNAL_H */
#define assert(cond)
abort the program if assertion is false
Definition assert.h:136
Definition for GNRC's network interfaces.
static void gnrc_gomach_set_unintd_preamble(gnrc_netif_t *netif, bool uintd_preamble)
Set the GNRC_GOMACH_INTERNAL_INFO_UNINTD_PREAMBLE flag of the device.
static bool gnrc_gomach_get_got_preamble_ack(gnrc_netif_t *netif)
Get the GNRC_GOMACH_INTERNAL_INFO_GOT_PREAMBLEACK flag of the device.
static bool gnrc_gomach_get_update(gnrc_netif_t *netif)
Get the GNRC_GOMACH_INTERNAL_INFO_ND_UPDATE flag of the device.
static bool gnrc_gomach_get_vTDMA_end(gnrc_netif_t *netif)
Get the GNRC_GOMACH_INTERNAL_INFO_VTDMA_END flag of the device.
int gnrc_gomach_send(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt, netopt_enable_t csma_enable)
Send a pktsnip in GoMacH.
static bool gnrc_gomach_get_enter_new_cycle(gnrc_netif_t *netif)
Get the GNRC_GOMACH_INTERNAL_INFO_ENTER_NEW_CYCLE flag of the device.
#define GNRC_GOMACH_INTERNAL_INFO_PHASE_BACKOFF
Flag to track if node need to backoff its phase in GoMacH.
#define GNRC_GOMACH_INTERNAL_INFO_ENTER_NEW_CYCLE
Flag to track if node has entered a new cycle in GoMacH.
#define GNRC_GOMACH_INTERNAL_INFO_GOT_PREAMBLE
Flag to track if need to quit the current cycle in GoMacH.
int gnrc_gomach_send_preamble_ack(gnrc_netif_t *netif, gnrc_gomach_packet_info_t *info)
Reply a preamble-ACK packet in GoMacH.
int gnrc_gomach_dispatch_defer(gnrc_pktsnip_t *buffer[], gnrc_pktsnip_t *pkt)
Store the received packet to the dispatch buffer.
void gnrc_gomach_packet_process_in_wait_beacon(gnrc_netif_t *netif)
Process the received packets when waiting for the beacon during t2k procedure in GoMacH.
static bool gnrc_gomach_get_unintd_preamble(gnrc_netif_t *netif)
Get the GNRC_GOMACH_INTERNAL_INFO_UNINTD_PREAMBLE flag of the device.
static bool gnrc_gomach_get_phase_backoff(gnrc_netif_t *netif)
Get the GNRC_GOMACH_INTERNAL_INFO_PHASE_BACKOFF flag of the device.
void gnrc_gomach_indicator_update(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt, gnrc_gomach_packet_info_t *pa_info)
Update the queue-length indicator of the packet sender.
void gnrc_gomach_update_neighbor_phase(gnrc_netif_t *netif)
Update the TX neighbors' phases in GoMacH.
void gnrc_gomach_process_preamble_ack(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt)
Process the received preamble-ACK packet to get phase-locked with the sender.
static netopt_state_t gnrc_gomach_get_netdev_state(gnrc_netif_t *netif)
Shortcut to get the state of netdev.
static void gnrc_gomach_set_on_pubchan_1(gnrc_netif_t *netif, bool on_pubchan_1)
Set the GNRC_GOMACH_INTERNAL_INFO_ON_PUBCHAN_1 flag of the device.
bool gnrc_gomach_find_next_tx_neighbor(gnrc_netif_t *netif)
Find a neighbor that is next to send packet to.
static bool gnrc_gomach_get_duty_cycle_start(gnrc_netif_t *netif)
Get the GNRC_GOMACH_INTERNAL_INFO_DUTY_CYCLE_START flag of the device.
int gnrc_gomach_send_preamble(gnrc_netif_t *netif, netopt_enable_t csma_enable)
Send a preamble packet to the targeted neighbor.
static void gnrc_gomach_set_enter_new_cycle(gnrc_netif_t *netif, bool enter)
Set the GNRC_GOMACH_INTERNAL_INFO_ENTER_NEW_CYCLE flag of the device.
bool gnrc_gomach_check_duplicate(gnrc_netif_t *netif, gnrc_gomach_packet_info_t *pa_info)
Check if the received packet is a duplicate packet.
#define GNRC_GOMACH_INTERNAL_INFO_MAX_PREAM_INTERV
Flag to track if node has reached maximum preamble interval.
static void gnrc_gomach_set_ack_req(gnrc_netif_t *netif, netopt_enable_t ack_req)
Set the ACK-require parameter of the device.
#define GNRC_GOMACH_INTERNAL_INFO_QUIT_CYCLE
Flag to track if need to quit the current cycle in GoMacH.
static bool gnrc_gomach_get_cp_end(gnrc_netif_t *netif)
Get the GNRC_GOMACH_INTERNAL_INFO_CP_END flag of the device.
static void gnrc_gomach_set_pkt_received(gnrc_netif_t *netif, bool received)
Set the GNRC_GOMACH_INFO_PKT_RECEIVED flag of the device.
static bool gnrc_gomach_get_on_pubchan_1(gnrc_netif_t *netif)
Get the GNRC_GOMACH_INTERNAL_INFO_ON_PUBCHAN_1 flag of the device.
static void gnrc_gomach_set_buffer_full(gnrc_netif_t *netif, bool full)
Set the GNRC_GOMACH_INTERNAL_INFO_BUFFER_FULL flag of the device.
void gnrc_gomach_cp_packet_process(gnrc_netif_t *netif)
Process packets received during the CP (wake-up) period of GoMacH.
static void gnrc_gomach_set_duty_cycle_start(gnrc_netif_t *netif, bool start)
Set the GNRC_GOMACH_INTERNAL_INFO_DUTY_CYCLE_START flag of the device.
uint64_t gnrc_gomach_phase_now(gnrc_netif_t *netif)
Get device's current phase.
static void gnrc_gomach_set_got_preamble_ack(gnrc_netif_t *netif, bool got)
Set the GNRC_GOMACH_INTERNAL_INFO_GOT_PREAMBLEACK flag of the device.
static void gnrc_gomach_set_phase_backoff(gnrc_netif_t *netif, bool backoff)
Set the GNRC_GOMACH_INTERNAL_INFO_PHASE_BACKOFF flag of the device.
void gnrc_gomach_set_netdev_state(gnrc_netif_t *netif, netopt_state_t devstate)
Shortcut to set the state of netdev.
void gnrc_gomach_packet_process_in_vtdma(gnrc_netif_t *netif)
Process the received packets in the vTDMA period in GoMacH.
static bool gnrc_gomach_get_got_preamble(gnrc_netif_t *netif)
Get the GNRC_GOMACH_INTERNAL_INFO_GOT_PREAMBLE flag of the device.
static bool gnrc_gomach_get_tx_finish(gnrc_netif_t *netif)
Get the GNRC_GOMACH_INFO_TX_FINISHED flag of the device.
int _gnrc_gomach_transmit(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt)
send a packet over the network interface in GoMacH
static void gnrc_gomach_set_tx_finish(gnrc_netif_t *netif, bool tx_finish)
Set the GNRC_GOMACH_INFO_TX_FINISHED flag of the device.
static bool gnrc_gomach_get_beacon_fail(gnrc_netif_t *netif)
Get the GNRC_GOMACH_INTERNAL_INFO_BEACON_FAIL flag of the device.
int gnrc_gomach_send_beacon(gnrc_netif_t *netif)
Broadcast a beacon packet in GoMacH.
void gnrc_gomach_init_choose_subchannel(gnrc_netif_t *netif)
Choose a sub-channel for a device running GoMacH.
int gnrc_gomach_bcast_subchann_seq(gnrc_netif_t *netif, netopt_enable_t use_csma)
Broadcast the chosen sub-channel sequence to the device's neighbors.
#define GNRC_GOMACH_INTERNAL_INFO_ND_UPDATE
Flag to track if need to update GoMacH.
#define GNRC_GOMACH_INTERNAL_INFO_DUTY_CYCLE_START
Flag to track if node's duty-cycle has started in GoMacH.
static void gnrc_gomach_set_got_preamble(gnrc_netif_t *netif, bool got_preamble)
Set the GNRC_GOMACH_INTERNAL_INFO_GOT_PREAMBLE flag of the device.
static bool gnrc_gomach_get_pkt_received(gnrc_netif_t *netif)
Get the GNRC_GOMACH_INFO_PKT_RECEIVED flag of the device.
#define GNRC_GOMACH_INTERNAL_INFO_UNINTD_PREAMBLE
Flag to track if the node has received unintended preamble.
static void gnrc_gomach_set_beacon_fail(gnrc_netif_t *netif, bool fail)
Set the GNRC_GOMACH_INTERNAL_INFO_BEACON_FAIL flag of the device.
void gnrc_gomach_update_neighbor_pubchan(gnrc_netif_t *netif)
Update the TX neighbors' public channel phase in GoMacH.
#define GNRC_GOMACH_INFO_PKT_RECEIVED
Flag to track if a packet has been successfully received.
static void gnrc_gomach_turn_channel(gnrc_netif_t *netif, uint16_t channel_num)
Turn the radio to a specific channel.
#define GNRC_GOMACH_INTERNAL_INFO_VTDMA_END
Flag to track if vTDMA has ended in GoMacH.
void gnrc_gomach_process_pkt_in_wait_preamble_ack(gnrc_netif_t *netif)
Process the received packets to when waiting for the preamble-ACK packet.
static bool gnrc_gomach_get_quit_cycle(gnrc_netif_t *netif)
Get the GNRC_GOMACH_INTERNAL_INFO_QUIT_CYCLE flag of the device.
static void gnrc_gomach_set_update(gnrc_netif_t *netif, bool update)
Set the GNRC_GOMACH_INTERNAL_INFO_ND_UPDATE flag of the device.
#define GNRC_GOMACH_INTERNAL_INFO_ON_PUBCHAN_1
Flag to track if node's radio is on public-channel-1.
static bool gnrc_gomach_get_buffer_full(gnrc_netif_t *netif)
Get the GNRC_GOMACH_INTERNAL_INFO_BUFFER_FULL flag of the device.
#define GNRC_GOMACH_INTERNAL_INFO_BEACON_FAIL
Flag to track if beacon transmission fail in GoMacH.
static void gnrc_gomach_set_quit_cycle(gnrc_netif_t *netif, bool quit)
Set the GNRC_GOMACH_INTERNAL_INFO_QUIT_CYCLE flag of the device.
#define GNRC_GOMACH_INFO_TX_FINISHED
Flag to track if the transmission has finished.
#define GNRC_GOMACH_INTERNAL_INFO_CP_END
Flag to track if CP period has ended in GoMacH.
#define GNRC_GOMACH_INTERNAL_INFO_GOT_PREAMBLEACK
Flag to track if node has got preamble-ACK in GoMacH.
int gnrc_gomach_send_data(gnrc_netif_t *netif, netopt_enable_t csma_enable)
Send a data packet to the targeted neighbor.
static bool gnrc_gomach_get_max_pream_interv(gnrc_netif_t *netif)
Get the GNRC_GOMACH_INTERNAL_INFO_MAX_PREAM_INTERV flag of the device.
static void gnrc_gomach_set_autoack(gnrc_netif_t *netif, netopt_enable_t autoack)
Set the auto-ACK parameter of the device.
void gnrc_gomach_beacon_process(gnrc_netif_t *netif, gnrc_pktsnip_t *pkt)
Process the received beacon packet.
#define GNRC_GOMACH_INTERNAL_INFO_BUFFER_FULL
Flag to track if node's packet buffer is full in GoMacH.
static void gnrc_gomach_set_vTDMA_end(gnrc_netif_t *netif, bool vtdma_end)
Set the GNRC_GOMACH_INTERNAL_INFO_VTDMA_END flag of the device.
static void gnrc_gomach_set_max_pream_interv(gnrc_netif_t *netif, bool max)
Set the GNRC_GOMACH_INTERNAL_INFO_MAX_PREAM_INTERV flag of the device.
static void gnrc_gomach_set_cp_end(gnrc_netif_t *netif, bool cp_end)
Set the GNRC_GOMACH_INTERNAL_INFO_CP_END flag of the device.
#define ENOSYS
Function not supported.
Definition errno.h:124
netopt_enable_t
Binary parameter for enabling and disabling options.
Definition netopt.h:885
netopt_state_t
Option parameter to be used with NETOPT_STATE to set or get the state of a network device or protocol...
Definition netopt.h:894
@ NETOPT_STATE
(netopt_state_t) state of network device
Definition netopt.h:241
@ NETOPT_ACK_REQ
(netopt_enable_t) acknowledgement request on outgoing frames
Definition netopt.h:229
@ NETOPT_AUTOACK
(netopt_enable_t) automatic link layer ACKs
Definition netopt.h:215
@ NETOPT_CHANNEL
(uint16_t) channel number
Definition netopt.h:49
Low-level RTT (Real Time Timer) peripheral driver interface definitions.
Type to pass information about packet parsing.
Definition types.h:241
uint16_t mac_info
general information for the MAC protocol
Definition mac.h:76
Representation of a network interface.
Definition netif.h:135
gnrc_netif_mac_t mac
Common MAC module component
Definition netif.h:150
netdev_t * dev
Network device of the network interface.
Definition netif.h:138
Type to represent parts (either headers or payload) of a packet, called snips.
Definition pkt.h:108
int(* get)(netdev_t *dev, netopt_t opt, void *value, size_t max_len)
Get an option value from a given network device.
Definition netdev.h:574
int(* set)(netdev_t *dev, netopt_t opt, const void *value, size_t value_len)
Set an option value for a given network device.
Definition netdev.h:600
const struct netdev_driver * driver
ptr to that driver's interface.
Definition netdev.h:364