<commit_before>/**
 * Generic transceiver module as an interface to NIC driver.
 *
 * Copyright (C) 2013  INRIA.
 *
 * This file is subject to the terms and conditions of the GNU Lesser
 * General Public License v2.1. See the file LICENSE in the top level
 * directory for more details.
 *
 * @ingroup transceiver
 * @{
 * @file    transceiver.c
 * @brief   Providing a generic interface to the driver implementation for any supported network device.
 * @author  <NAME> <<EMAIL>>
 * @}
 */

#include <stdint.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <inttypes.h>

#include "thread.h"
#include "msg.h"
#include "irq.h"

#include "radio/types.h"

#include "transceiver.h"

/* supported transceivers */
#ifdef MODULE_TI_EMAC
#include "ti_emac.h"
#endif

#ifdef MODULE_CC110X
#include "cc110x.h"
#endif

#ifdef MODULE_CC110X_LEGACY_CSMA
#include "cc110x_legacy_csma.h"
#endif

#ifdef MODULE_CC110X_LEGACY
#include "cc110x_legacy.h"
#endif

#ifdef MODULE_CC2420
#include "cc2420.h"
#include "ieee802154_frame.h"
#endif

#ifdef MODULE_MC1322X
#include "mc1322x.h"
#include "maca.h"
#include "maca_packet.h"
#include "ieee802154_frame.h"
#endif

#ifdef MODULE_NATIVENET
#include "nativenet.h"
#include "nativenet_internal.h"
#endif

#ifdef MODULE_AT86RF231
#include "at86rf231.h"
#include "ieee802154_frame.h"
#endif

#define ENABLE_DEBUG (0)
#if ENABLE_DEBUG
#undef TRANSCEIVER_STACK_SIZE
#define TRANSCEIVER_STACK_SIZE      (KERNEL_CONF_STACKSIZE_MAIN)
#endif
#include "debug.h"

/*------------------------------------------------------------------------------------*/
/* used transceiver types */
transceiver_type_t transceivers = TRANSCEIVER_NONE;

/* registered upper layer threads */
registered_t reg[TRANSCEIVER_MAX_REGISTERED];

/* packet buffers */
#if MODULE_AT86RF231 || MODULE_CC2420 || MODULE_MC1322X
ieee802154_packet_t transceiver_buffer[TRANSCEIVER_BUFFER_SIZE];
#elif MODULE_TI_EMAC
ethernet_frame transceiver_buffer[TRANSCEIVER_BUFFER_SIZE];
#else
radio_packet_t transceiver_buffer[TRANSCEIVER_BUFFER_SIZE];
#endif
#ifndef MODULE_TI_EMAC
uint8_t data_buffer[TRANSCEIVER_BUFFER_SIZE * PAYLOAD_SIZE];
#endif
/* message buffer */
msg_t msg_buffer[TRANSCEIVER_MSG_BUFFER_SIZE];

uint32_t response; ///< response bytes for messages to upper layer threads

volatile kernel_pid_t transceiver_pid = KERNEL_PID_UNDEF; ///< the transceiver thread's pid

static volatile uint8_t rx_buffer_pos = 0;
static volatile uint8_t transceiver_buffer_pos = 0;

#ifdef MODULE_CC110X_LEGACY_CSMA
void *cc1100_payload;
int cc1100_payload_size;
packet_info_t *cc1100_packet_info;
uint8_t cc1100_pkt[CC1100_MAX_DATA_LENGTH];<commit_msg>conditionals for xbee to transceiver driver<commit_after>/**
 * Generic transceiver module as an interface to NIC driver.
 *
 * Copyright (C) 2013  INRIA.
 *
 * This file is subject to the terms and conditions of the GNU Lesser
 * General Public License v2.1. See the file LICENSE in the top level
 * directory for more details.
 *
 * @ingroup transceiver
 * @{
 * @file    transceiver.c
 * @brief   Providing a generic interface to the driver implementation for any supported network device.
 * @author  <NAME> <<EMAIL>>
 * @}
 */

#include <stdint.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <inttypes.h>

#include "thread.h"
#include "msg.h"
#include "irq.h"

#include "radio/types.h"

#include "transceiver.h"

/* supported transceivers */
#ifdef MODULE_TI_EMAC
#include "ti_emac.h"
#endif

#ifdef MODULE_CC110X
#include "cc110x.h"
#endif

#ifdef MODULE_CC110X_LEGACY_CSMA
#include "cc110x_legacy_csma.h"
#endif

#ifdef MODULE_CC110X_LEGACY
#include "cc110x_legacy.h"
#endif

#ifdef MODULE_CC2420
#include "cc2420.h"
#include "ieee802154_frame.h"
#endif

#ifdef MODULE_MC1322X
#include "mc1322x.h"
#include "maca.h"
#include "maca_packet.h"
#include "ieee802154_frame.h"
#endif

#ifdef MODULE_NATIVENET
#include "nativenet.h"
#include "nativenet_internal.h"
#endif

#ifdef MODULE_AT86RF231
#include "at86rf231.h"
#include "ieee802154_frame.h"
#endif

#ifdef MODULE_XBEE
#include "xbee.h"
#endif

#define ENABLE_DEBUG (0)
#if ENABLE_DEBUG
#undef TRANSCEIVER_STACK_SIZE
#define TRANSCEIVER_STACK_SIZE      (KERNEL_CONF_STACKSIZE_MAIN)
#endif
#include "debug.h"

/*------------------------------------------------------------------------------------*/
/* used transceiver types */
transceiver_type_t transceivers = TRANSCEIVER_NONE;

/* registered upper layer threads */
registered_t reg[TRANSCEIVER_MAX_REGISTERED];

/* packet buffers */
#if MODULE_AT86RF231 || MODULE_CC2420 || MODULE_MC1322X || MODULE_XBEE
ieee802154_packet_t transceiver_buffer[TRANSCEIVER_BUFFER_SIZE];
#elif MODULE_TI_EMAC
ethernet_frame transceiver_buffer[TRANSCEIVER_BUFFER_SIZE];
#else
radio_packet_t transceiver_buffer[TRANSCEIVER_BUFFER_SIZE];
#endif
#ifndef MODULE_TI_EMAC
uint8_t data_buffer[TRANSCEIVER_BUFFER_SIZE * PAYLOAD_SIZE];
#endif
/* message buffer */
msg_t msg_buffer[TRANSCEIVER_MSG_BUFFER_SIZE];

uint32_t response; ///< response bytes for messages to upper layer threads

volatile kernel_pid_t transceiver_pid = KERNEL_PID_UNDEF; ///< the transceiver thread's pid

static volatile uint8_t rx_buffer_pos = 0;
static volatile uint8_t transceiver_buffer_pos = 0;

#ifdef MODULE_CC110X_LEGACY_CSMA
void *cc1100_payload;
int cc1100_payload_size;
packet_info_t *cc1100_packet_info;
uint8_t cc1100_pkt[CC1100_MAX_DATA_LENGTH];
{'fraction_non_alphanumeric': 0.12583518930957685, 'fraction_numerical': 0.04417223459539718, 'mean_word_length': 4.928492849284929, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4414593', 'n_tokens_mistral': 2074, 'n_tokens_neox': 1947, 'n_words': 464}