1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-16 01:53:51 +01:00

gnrc: piggy-back some code style changes

This commit is contained in:
Martine Lenders 2015-08-07 14:37:19 +02:00
parent 9cf5e5fb6a
commit e8d5d5576a
5 changed files with 20 additions and 18 deletions

View File

@ -33,7 +33,7 @@
#include "net/ieee802154.h" #include "net/ieee802154.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**

View File

@ -216,8 +216,8 @@ void kw2xrf_set_sequence(kw2xrf_t *dev, kw2xrf_physeq_t seq)
/* TODO: This should only used in combination with /* TODO: This should only used in combination with
* an CSMA-MAC layer. Currently not working * an CSMA-MAC layer. Currently not working
*/ */
/*if((seq == XCVSEQ_TRANSMIT) || (seq == XCVSEQ_TX_RX)) { /*if ((seq == XCVSEQ_TRANSMIT) || (seq == XCVSEQ_TX_RX)) {
if((dev->option) & KW2XRF_OPT_AUTOACK) { if ((dev->option) & KW2XRF_OPT_AUTOACK) {
seq = XCVSEQ_TX_RX; seq = XCVSEQ_TX_RX;
} }
else { else {
@ -1060,7 +1060,7 @@ int _assemble_tx_buf(kw2xrf_t *dev, ng_pktsnip_t *pkt)
* since this is a soft_mac device this has to be * since this is a soft_mac device this has to be
* handled in a upcoming CSMA-MAC layer. * handled in a upcoming CSMA-MAC layer.
*/ */
/*if(dev->option & KW2XRF_OPT_AUTOACK) { /*if (dev->option & KW2XRF_OPT_AUTOACK) {
dev->buf[1] = 0x61; dev->buf[1] = 0x61;
} }
else { else {

View File

@ -458,7 +458,7 @@ int xbee_init(xbee_t *dev, uart_t uart, uint32_t baudrate,
hwtimer_wait(HWTIMER_TICKS(RESET_DELAY)); hwtimer_wait(HWTIMER_TICKS(RESET_DELAY));
gpio_set(reset_pin); gpio_set(reset_pin);
} }
/* put the XBee device into command mode */ /* put the XBee device into command mode */
hwtimer_wait(HWTIMER_TICKS(ENTER_CMD_MODE_DELAY)); hwtimer_wait(HWTIMER_TICKS(ENTER_CMD_MODE_DELAY));
_at_cmd(dev, "+++"); _at_cmd(dev, "+++");
hwtimer_wait(HWTIMER_TICKS(ENTER_CMD_MODE_DELAY)); hwtimer_wait(HWTIMER_TICKS(ENTER_CMD_MODE_DELAY));
@ -487,7 +487,8 @@ int xbee_init(xbee_t *dev, uart_t uart, uint32_t baudrate,
return 0; return 0;
} }
static inline bool _is_broadcast(ng_netif_hdr_t *hdr) { static inline bool _is_broadcast(ng_netif_hdr_t *hdr)
{
/* IEEE 802.15.4 does not support multicast so we need to check both flags */ /* IEEE 802.15.4 does not support multicast so we need to check both flags */
return (bool)(hdr->flags & (NG_NETIF_HDR_FLAGS_BROADCAST | return (bool)(hdr->flags & (NG_NETIF_HDR_FLAGS_BROADCAST |
NG_NETIF_HDR_FLAGS_MULTICAST)); NG_NETIF_HDR_FLAGS_MULTICAST));
@ -544,7 +545,8 @@ static int _send(ng_netdev_t *netdev, ng_pktsnip_t *pkt)
dev->tx_buf[3] = API_ID_TX_SHORT_ADDR; dev->tx_buf[3] = API_ID_TX_SHORT_ADDR;
memcpy(dev->tx_buf + 5, ng_netif_hdr_get_dst_addr(hdr), 2); memcpy(dev->tx_buf + 5, ng_netif_hdr_get_dst_addr(hdr), 2);
pos = 7; pos = 7;
} else { }
else {
dev->tx_buf[1] = (uint8_t)((size + 11) >> 8); dev->tx_buf[1] = (uint8_t)((size + 11) >> 8);
dev->tx_buf[2] = (uint8_t)(size + 11); dev->tx_buf[2] = (uint8_t)(size + 11);
dev->tx_buf[3] = API_ID_TX_LONG_ADDR; dev->tx_buf[3] = API_ID_TX_LONG_ADDR;

View File

@ -81,7 +81,7 @@ extern "C" {
* @return NULL, if @p addr_len was of illegal length. * @return NULL, if @p addr_len was of illegal length.
*/ */
static inline eui64_t *ieee802154_get_iid(eui64_t *eui64, uint8_t *addr, static inline eui64_t *ieee802154_get_iid(eui64_t *eui64, uint8_t *addr,
size_t addr_len) size_t addr_len)
{ {
int i = 0; int i = 0;

View File

@ -202,8 +202,8 @@ bool ng_sixlowpan_iphc_decode(ng_pktsnip_t *pkt)
case IPHC_SAC_SAM_L2: case IPHC_SAC_SAM_L2:
ieee802154_get_iid((eui64_t *)(&ipv6_hdr->src.u64[1]), ieee802154_get_iid((eui64_t *)(&ipv6_hdr->src.u64[1]),
ng_netif_hdr_get_src_addr(netif_hdr), ng_netif_hdr_get_src_addr(netif_hdr),
netif_hdr->src_l2addr_len); netif_hdr->src_l2addr_len);
ng_ipv6_addr_set_link_local_prefix(&ipv6_hdr->src); ng_ipv6_addr_set_link_local_prefix(&ipv6_hdr->src);
break; break;
@ -229,8 +229,8 @@ bool ng_sixlowpan_iphc_decode(ng_pktsnip_t *pkt)
case IPHC_SAC_SAM_CTX_L2: case IPHC_SAC_SAM_CTX_L2:
ieee802154_get_iid((eui64_t *)(&ipv6_hdr->src.u64[1]), ieee802154_get_iid((eui64_t *)(&ipv6_hdr->src.u64[1]),
ng_netif_hdr_get_src_addr(netif_hdr), ng_netif_hdr_get_src_addr(netif_hdr),
netif_hdr->src_l2addr_len); netif_hdr->src_l2addr_len);
ng_ipv6_addr_init_prefix(&ipv6_hdr->src, &ctx->prefix, ng_ipv6_addr_init_prefix(&ipv6_hdr->src, &ctx->prefix,
ctx->prefix_len); ctx->prefix_len);
break; break;
@ -277,8 +277,8 @@ bool ng_sixlowpan_iphc_decode(ng_pktsnip_t *pkt)
case IPHC_M_DAC_DAM_U_L2: case IPHC_M_DAC_DAM_U_L2:
ieee802154_get_iid((eui64_t *)(&ipv6_hdr->dst.u64[1]), ieee802154_get_iid((eui64_t *)(&ipv6_hdr->dst.u64[1]),
ng_netif_hdr_get_dst_addr(netif_hdr), ng_netif_hdr_get_dst_addr(netif_hdr),
netif_hdr->dst_l2addr_len); netif_hdr->dst_l2addr_len);
ng_ipv6_addr_set_link_local_prefix(&ipv6_hdr->dst); ng_ipv6_addr_set_link_local_prefix(&ipv6_hdr->dst);
break; break;
@ -300,8 +300,8 @@ bool ng_sixlowpan_iphc_decode(ng_pktsnip_t *pkt)
case IPHC_M_DAC_DAM_U_CTX_L2: case IPHC_M_DAC_DAM_U_CTX_L2:
ieee802154_get_iid((eui64_t *)(&ipv6_hdr->dst.u64[1]), ieee802154_get_iid((eui64_t *)(&ipv6_hdr->dst.u64[1]),
ng_netif_hdr_get_dst_addr(netif_hdr), ng_netif_hdr_get_dst_addr(netif_hdr),
netif_hdr->dst_l2addr_len); netif_hdr->dst_l2addr_len);
ng_ipv6_addr_init_prefix(&ipv6_hdr->dst, &ctx->prefix, ng_ipv6_addr_init_prefix(&ipv6_hdr->dst, &ctx->prefix,
ctx->prefix_len); ctx->prefix_len);
break; break;
@ -511,7 +511,7 @@ bool ng_sixlowpan_iphc_encode(ng_pktsnip_t *pkt)
(netif_hdr->src_l2addr_len == 8)) { (netif_hdr->src_l2addr_len == 8)) {
/* prefer to create IID from netif header if available */ /* prefer to create IID from netif header if available */
ieee802154_get_iid(&iid, ng_netif_hdr_get_src_addr(netif_hdr), ieee802154_get_iid(&iid, ng_netif_hdr_get_src_addr(netif_hdr),
netif_hdr->src_l2addr_len); netif_hdr->src_l2addr_len);
} }
else { else {
/* but take from driver otherwise */ /* but take from driver otherwise */
@ -620,7 +620,7 @@ bool ng_sixlowpan_iphc_encode(ng_pktsnip_t *pkt)
eui64_t iid; eui64_t iid;
ieee802154_get_iid(&iid, ng_netif_hdr_get_dst_addr(netif_hdr), ieee802154_get_iid(&iid, ng_netif_hdr_get_dst_addr(netif_hdr),
netif_hdr->dst_l2addr_len); netif_hdr->dst_l2addr_len);
if ((ipv6_hdr->dst.u64[1].u64 == iid.uint64.u64) || if ((ipv6_hdr->dst.u64[1].u64 == iid.uint64.u64) ||
_context_overlaps_iid(dst_ctx, &(ipv6_hdr->dst), &iid)) { _context_overlaps_iid(dst_ctx, &(ipv6_hdr->dst), &iid)) {