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 
9 #pragma once
10 
21 #include <stdint.h>
22 
23 #include "periph/rtt.h"
24 #include "net/gnrc/netif.h"
25 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
33 #define GNRC_GOMACH_INFO_TX_FINISHED (0x0008U)
34 
38 #define GNRC_GOMACH_INFO_PKT_RECEIVED (0x0010U)
39 
43 #define GNRC_GOMACH_INTERNAL_INFO_ND_UPDATE (0x0001U)
44 
48 #define GNRC_GOMACH_INTERNAL_INFO_QUIT_CYCLE (0x0002U)
49 
53 #define GNRC_GOMACH_INTERNAL_INFO_CP_END (0x0004U)
54 
58 #define GNRC_GOMACH_INTERNAL_INFO_VTDMA_END (0x0008U)
59 
63 #define GNRC_GOMACH_INTERNAL_INFO_UNINTD_PREAMBLE (0x0010U)
64 
68 #define GNRC_GOMACH_INTERNAL_INFO_GOT_PREAMBLE (0x0020U)
69 
73 #define GNRC_GOMACH_INTERNAL_INFO_DUTY_CYCLE_START (0x0040U)
74 
78 #define GNRC_GOMACH_INTERNAL_INFO_PHASE_BACKOFF (0x0080U)
79 
83 #define GNRC_GOMACH_INTERNAL_INFO_BEACON_FAIL (0x0200U)
84 
88 #define GNRC_GOMACH_INTERNAL_INFO_BUFFER_FULL (0x0400U)
89 
93 #define GNRC_GOMACH_INTERNAL_INFO_ENTER_NEW_CYCLE (0x0800U)
94 
98 #define GNRC_GOMACH_INTERNAL_INFO_GOT_PREAMBLEACK (0x1000U)
99 
103 #define GNRC_GOMACH_INTERNAL_INFO_ON_PUBCHAN_1 (0x2000U)
104 
108 #define GNRC_GOMACH_INTERNAL_INFO_MAX_PREAM_INTERV (0x4000U)
109 
113 #define GNRC_GOMACH_INTERNAL_INFO_RADIO_IS_ON (0x8000U)
114 
123 static inline void gnrc_gomach_set_tx_finish(gnrc_netif_t *netif, bool tx_finish)
124 {
125  if (tx_finish) {
127  }
128  else {
130  }
131 }
132 
141 static inline bool gnrc_gomach_get_tx_finish(gnrc_netif_t *netif)
142 {
143  return (netif->mac.mac_info & GNRC_GOMACH_INFO_TX_FINISHED);
144 }
145 
154 static inline void gnrc_gomach_set_pkt_received(gnrc_netif_t *netif, bool received)
155 {
156  if (received) {
158  }
159  else {
161  }
162 }
163 
172 static inline bool gnrc_gomach_get_pkt_received(gnrc_netif_t *netif)
173 {
174  return (netif->mac.mac_info & GNRC_GOMACH_INFO_PKT_RECEIVED);
175 }
176 
185 static inline void gnrc_gomach_set_quit_cycle(gnrc_netif_t *netif, bool quit)
186 {
187  if (quit) {
188  netif->mac.prot.gomach.gomach_info |= GNRC_GOMACH_INTERNAL_INFO_QUIT_CYCLE;
189  }
190  else {
191  netif->mac.prot.gomach.gomach_info &= ~GNRC_GOMACH_INTERNAL_INFO_QUIT_CYCLE;
192  }
193 }
194 
203 static inline bool gnrc_gomach_get_quit_cycle(gnrc_netif_t *netif)
204 {
205  return (netif->mac.prot.gomach.gomach_info & GNRC_GOMACH_INTERNAL_INFO_QUIT_CYCLE);
206 }
207 
216 static inline void gnrc_gomach_set_got_preamble(gnrc_netif_t *netif, bool got_preamble)
217 {
218  if (got_preamble) {
219  netif->mac.prot.gomach.gomach_info |= GNRC_GOMACH_INTERNAL_INFO_GOT_PREAMBLE;
220  }
221  else {
222  netif->mac.prot.gomach.gomach_info &= ~GNRC_GOMACH_INTERNAL_INFO_GOT_PREAMBLE;
223  }
224 }
225 
234 static inline bool gnrc_gomach_get_got_preamble(gnrc_netif_t *netif)
235 {
236  return (netif->mac.prot.gomach.gomach_info & GNRC_GOMACH_INTERNAL_INFO_GOT_PREAMBLE);
237 }
238 
247 static inline void gnrc_gomach_set_cp_end(gnrc_netif_t *netif, bool cp_end)
248 {
249  if (cp_end) {
250  netif->mac.prot.gomach.gomach_info |= GNRC_GOMACH_INTERNAL_INFO_CP_END;
251  }
252  else {
253  netif->mac.prot.gomach.gomach_info &= ~GNRC_GOMACH_INTERNAL_INFO_CP_END;
254  }
255 }
256 
265 static inline bool gnrc_gomach_get_cp_end(gnrc_netif_t *netif)
266 {
267  return (netif->mac.prot.gomach.gomach_info & GNRC_GOMACH_INTERNAL_INFO_CP_END);
268 }
269 
278 static inline void gnrc_gomach_set_vTDMA_end(gnrc_netif_t *netif, bool vtdma_end)
279 {
280  if (vtdma_end) {
281  netif->mac.prot.gomach.gomach_info |= GNRC_GOMACH_INTERNAL_INFO_VTDMA_END;
282  }
283  else {
284  netif->mac.prot.gomach.gomach_info &= ~GNRC_GOMACH_INTERNAL_INFO_VTDMA_END;
285  }
286 }
287 
296 static inline bool gnrc_gomach_get_vTDMA_end(gnrc_netif_t *netif)
297 {
298  return (netif->mac.prot.gomach.gomach_info & GNRC_GOMACH_INTERNAL_INFO_VTDMA_END);
299 }
300 
309 static inline void gnrc_gomach_set_unintd_preamble(gnrc_netif_t *netif, bool uintd_preamble)
310 {
311  if (uintd_preamble) {
312  netif->mac.prot.gomach.gomach_info |= GNRC_GOMACH_INTERNAL_INFO_UNINTD_PREAMBLE;
313  }
314  else {
315  netif->mac.prot.gomach.gomach_info &= ~GNRC_GOMACH_INTERNAL_INFO_UNINTD_PREAMBLE;
316  }
317 }
318 
328 {
329  return (netif->mac.prot.gomach.gomach_info & GNRC_GOMACH_INTERNAL_INFO_UNINTD_PREAMBLE);
330 }
331 
340 static inline void gnrc_gomach_set_update(gnrc_netif_t *netif, bool update)
341 {
342  if (update) {
343  netif->mac.prot.gomach.gomach_info |= GNRC_GOMACH_INTERNAL_INFO_ND_UPDATE;
344  }
345  else {
346  netif->mac.prot.gomach.gomach_info &= ~GNRC_GOMACH_INTERNAL_INFO_ND_UPDATE;
347  }
348 }
349 
358 static inline bool gnrc_gomach_get_update(gnrc_netif_t *netif)
359 {
360  return (netif->mac.prot.gomach.gomach_info & GNRC_GOMACH_INTERNAL_INFO_ND_UPDATE);
361 }
362 
371 static inline void gnrc_gomach_set_duty_cycle_start(gnrc_netif_t *netif, bool start)
372 {
373  if (start) {
374  netif->mac.prot.gomach.gomach_info |= GNRC_GOMACH_INTERNAL_INFO_DUTY_CYCLE_START;
375  }
376  else {
377  netif->mac.prot.gomach.gomach_info &= ~GNRC_GOMACH_INTERNAL_INFO_DUTY_CYCLE_START;
378  }
379 }
380 
390 {
391  return (netif->mac.prot.gomach.gomach_info & GNRC_GOMACH_INTERNAL_INFO_DUTY_CYCLE_START);
392 }
393 
402 static inline void gnrc_gomach_set_phase_backoff(gnrc_netif_t *netif, bool backoff)
403 {
404  if (backoff) {
405  netif->mac.prot.gomach.gomach_info |= GNRC_GOMACH_INTERNAL_INFO_PHASE_BACKOFF;
406  }
407  else {
408  netif->mac.prot.gomach.gomach_info &= ~GNRC_GOMACH_INTERNAL_INFO_PHASE_BACKOFF;
409  }
410 }
411 
420 static inline bool gnrc_gomach_get_phase_backoff(gnrc_netif_t *netif)
421 {
422  return (netif->mac.prot.gomach.gomach_info & GNRC_GOMACH_INTERNAL_INFO_PHASE_BACKOFF);
423 }
424 
433 static inline void gnrc_gomach_set_beacon_fail(gnrc_netif_t *netif, bool fail)
434 {
435  if (fail) {
436  netif->mac.prot.gomach.gomach_info |= GNRC_GOMACH_INTERNAL_INFO_BEACON_FAIL;
437  }
438  else {
439  netif->mac.prot.gomach.gomach_info &= ~GNRC_GOMACH_INTERNAL_INFO_BEACON_FAIL;
440  }
441 }
442 
451 static inline bool gnrc_gomach_get_beacon_fail(gnrc_netif_t *netif)
452 {
453  return (netif->mac.prot.gomach.gomach_info & GNRC_GOMACH_INTERNAL_INFO_BEACON_FAIL);
454 }
455 
464 static inline void gnrc_gomach_set_buffer_full(gnrc_netif_t *netif, bool full)
465 {
466  if (full) {
467  netif->mac.prot.gomach.gomach_info |= GNRC_GOMACH_INTERNAL_INFO_BUFFER_FULL;
468  }
469  else {
470  netif->mac.prot.gomach.gomach_info &= ~GNRC_GOMACH_INTERNAL_INFO_BUFFER_FULL;
471  }
472 }
473 
482 static inline bool gnrc_gomach_get_buffer_full(gnrc_netif_t *netif)
483 {
484  return (netif->mac.prot.gomach.gomach_info & GNRC_GOMACH_INTERNAL_INFO_BUFFER_FULL);
485 }
486 
495 static inline void gnrc_gomach_set_enter_new_cycle(gnrc_netif_t *netif, bool enter)
496 {
497  if (enter) {
498  netif->mac.prot.gomach.gomach_info |= GNRC_GOMACH_INTERNAL_INFO_ENTER_NEW_CYCLE;
499  }
500  else {
501  netif->mac.prot.gomach.gomach_info &= ~GNRC_GOMACH_INTERNAL_INFO_ENTER_NEW_CYCLE;
502  }
503 }
504 
514 {
515  return (netif->mac.prot.gomach.gomach_info & GNRC_GOMACH_INTERNAL_INFO_ENTER_NEW_CYCLE);
516 }
517 
526 static inline void gnrc_gomach_set_got_preamble_ack(gnrc_netif_t *netif, bool got)
527 {
528  if (got) {
529  netif->mac.prot.gomach.gomach_info |= GNRC_GOMACH_INTERNAL_INFO_GOT_PREAMBLEACK;
530  }
531  else {
532  netif->mac.prot.gomach.gomach_info &= ~GNRC_GOMACH_INTERNAL_INFO_GOT_PREAMBLEACK;
533  }
534 }
535 
545 {
546  return (netif->mac.prot.gomach.gomach_info & GNRC_GOMACH_INTERNAL_INFO_GOT_PREAMBLEACK);
547 }
548 
557 static inline void gnrc_gomach_set_on_pubchan_1(gnrc_netif_t *netif, bool on_pubchan_1)
558 {
559  if (on_pubchan_1) {
560  netif->mac.prot.gomach.gomach_info |= GNRC_GOMACH_INTERNAL_INFO_ON_PUBCHAN_1;
561  }
562  else {
563  netif->mac.prot.gomach.gomach_info &= ~GNRC_GOMACH_INTERNAL_INFO_ON_PUBCHAN_1;
564  }
565 }
566 
575 static inline bool gnrc_gomach_get_on_pubchan_1(gnrc_netif_t *netif)
576 {
577  return (netif->mac.prot.gomach.gomach_info & GNRC_GOMACH_INTERNAL_INFO_ON_PUBCHAN_1);
578 }
579 
588 static inline void gnrc_gomach_set_max_pream_interv(gnrc_netif_t *netif, bool max)
589 {
590  if (max) {
591  netif->mac.prot.gomach.gomach_info |= GNRC_GOMACH_INTERNAL_INFO_MAX_PREAM_INTERV;
592  }
593  else {
594  netif->mac.prot.gomach.gomach_info &= ~GNRC_GOMACH_INTERNAL_INFO_MAX_PREAM_INTERV;
595  }
596 }
597 
607 {
608  return (netif->mac.prot.gomach.gomach_info & GNRC_GOMACH_INTERNAL_INFO_MAX_PREAM_INTERV);
609 }
610 
619 
627 
635 static inline void gnrc_gomach_set_autoack(gnrc_netif_t *netif, netopt_enable_t autoack)
636 {
637  assert(netif != NULL);
638 
639  netif->dev->driver->set(netif->dev,
641  &autoack,
642  sizeof(autoack));
643 }
644 
652 static inline void gnrc_gomach_set_ack_req(gnrc_netif_t *netif, netopt_enable_t ack_req)
653 {
654  assert(netif != NULL);
655 
656  netif->dev->driver->set(netif->dev,
658  &ack_req,
659  sizeof(ack_req));
660 }
661 
671 {
672  assert(netif != NULL);
673 
674  netopt_state_t state;
675 
676  if (0 < netif->dev->driver->get(netif->dev,
677  NETOPT_STATE,
678  &state,
679  sizeof(state))) {
680  return state;
681  }
682  return -ENOSYS;
683 }
684 
692 static inline void gnrc_gomach_turn_channel(gnrc_netif_t *netif, uint16_t channel_num)
693 {
694  assert(netif != NULL);
695 
696  netif->dev->driver->set(netif->dev,
698  &channel_num,
699  sizeof(channel_num));
700 }
701 
725 
736 
748 
759 
769 
780 
790  gnrc_gomach_packet_info_t *pa_info);
791 
799 
807 
818 
829 
838 
846 
857 
868 
877 
886 
894 
902 
910 
911 #ifdef __cplusplus
912 }
913 #endif
914 
#define assert(cond)
abort the program if assertion is false
Definition: assert.h:135
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:123
netopt_enable_t
Binary parameter for enabling and disabling options.
Definition: netopt.h:884
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:893
@ NETOPT_STATE
(netopt_state_t) state of network device
Definition: netopt.h:240
@ NETOPT_ACK_REQ
(netopt_enable_t) acknowledgement request on outgoing frames
Definition: netopt.h:228
@ NETOPT_AUTOACK
(netopt_enable_t) automatic link layer ACKs
Definition: netopt.h:214
@ NETOPT_CHANNEL
(uint16_t) channel number
Definition: netopt.h:48
Low-level RTT (Real Time Timer) peripheral driver interface definitions.
Type to pass information about packet parsing.
Definition: types.h:240
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:583
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:609
const struct netdev_driver * driver
ptr to that driver's interface.
Definition: netdev.h:365