Data Structures | Defines | Enumerations | Functions | Variables

# sniffer.h File Reference

Interface of the Sniffer Firmware. More...

Go to the source code of this file.

## Data Structures
struct | pcap_packet_t
struct | pcap_pool_t
struct | scan_result_t
| Data structure for scan results. More...
struct | sniffer_context_t
| Data structure for internal state variables of the application. More...
## Defines
#define | CHANNEL_MAX_OFFSET (TRX_NB_CHANNELS-1)
#define | CHANNEL_NEXT_CIRCULAR(x)
#define | CHANNEL_OFFSET(x) (x > TRX_MAX_CHANNEL ? TRX_MIN_CHANNEL : (x - TRX_MIN_CHANNEL))
#define | MAX_PACKET_BUFFERS (8)
#define | NL "\n"
#define | SCAN_PERIOD_MS (2000)
#define | VERSION "0.1"
## Enumerations
enum | sniffer_state_t { IDLE, EDSCAN, SCAN, SCAN_DONE, SNIFF }
| Appication States. More...
## Functions
void | ctrl_process_input (void)
void | scan_continue (void)
void | scan_init (void)
| Initialize the scan mode.
void | sniffer_start (sniffer_state_t state)
| Process data received from HIF.
void | sniffer_stop (void)
| Halt current operation and enter state IDLE.
## Variables
sniffer_context_t | ctx

## Detailed Description

Interface of the Sniffer Firmware.

## Define Documentation

#define CHANNEL_NEXT_CIRCULAR | ( |  | x | ) |

Value:

    do \
        { \
            (x)++; \
            if ((x) > TRX_MAX_CHANNEL) \
            { \
                (x) = TRX_MIN_CHANNEL; \
            } \
        } \
        while(0)

Increment channel number and wraps back to lowest channel, if upper channel + 1 is reached.

## Enumeration Type Documentation

enum sniffer_state_t

Appication States.

Enumerator:

  IDLE | Application is in idle mode, receiving commands from HIF.
  EDSCAN | Application is in scanning mode.
  SCAN | Application is in scanning mode.
  SCAN_DONE | Application is in scanning mode.
  SNIFF | Application is in sniffing mode.

## Function Documentation

void scan_init | ( | void |  | ) |

Initialize the scan mode.

void sniffer_start | ( | sniffer_state_t | state | ) |

Process data received from HIF.

The function checks for available input data and performs depending on the current state the processing.

void sniffer_stop | ( | void |  | ) |

Halt current operation and enter state IDLE.

## Variable Documentation

sniffer_context_t ctx

Note:
  In order to get higher performance in frame receiving, this application uses a own implementation of the transceiver interrrupt routine (TRX_IRQ_vect), instead of the callback function from librf23x.a.