Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
|
#include <assert.h>
#include <pthread.h>
#include <signal.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include "ca821x-posix/ca821x-posix-evbme.h"
#include "ca821x-posix/ca821x-posix.h"
#include "evbme_messages.h"
Classes | |
struct | inst_priv |
Macros | |
#define | _DEFAULT_SOURCE 1 |
#define | RED "\x1b[31m" |
#define | GREEN "\x1b[32m" |
#define | YELLOW "\x1b[33m" |
#define | BLUE "\x1b[34m" |
#define | MAGENTA "\x1b[35m" |
#define | CYAN "\x1b[36m" |
#define | BOLDWHITE "\x1b[1m\x1b[37m" |
#define | RESET "\x1b[0m" |
#define | COLOR_SET(C, X) C X RESET |
#define | CHANNEL 22 |
#define | M_PANID 0x1AAA |
#define | MAX_MSDU_LEN 100 |
#define | MIN_MSDU_LEN 100 |
#define | MAX_INSTANCES 5 |
#define | TX_PERIOD ((struct timespec){0, getRand(6000000, 7000000)}) |
#define | TO_BACKOFF ((struct timespec){0, 10000000}) |
#define | WAIT_CONFIRM 0 |
#define | ONE_DIRECTION 0 |
#define | INSERT_SYNC (getRand(0, 0)) |
#define | INDIRECT 1 |
#define | INDIRECTJUNK 0 |
#define | USELONGADDR (getRand(0, 0)) |
#define | ACKREQ (getRand(1, 1)) |
#define | NUMRETRIES 4 |
#define | HISTORY_LENGTH 200 |
#define | MSDU_HISTORY 100 |
#define | M_MSDU_LENGTH (getRand(MIN_MSDU_LEN, MAX_MSDU_LEN)) |
#define | STATUS_RECEIVED (1 << 0) |
#define | STATUS_ACKNOWLEDGED (1 << 1) |
#define | STATUS_REPEATED (1 << 2) |
#define | STATUS_CONFIRMED (1 << 3) |
Functions | |
void | initInst (struct inst_priv *cur) |
void | drawTableHeader () |
void | drawTableRow (unsigned int time) |
int | main (int argc, char *argv[]) |
Variables | |
int | numInsts |
struct inst_priv | insts [MAX_INSTANCES] = {} |
pthread_mutex_t | out_mutex = PTHREAD_MUTEX_INITIALIZER |
pthread_mutex_t | rand_mutex = PTHREAD_MUTEX_INITIALIZER |
#define _DEFAULT_SOURCE 1 |
#define ACKREQ (getRand(1, 1)) |
#define BLUE "\x1b[34m" |
#define BOLDWHITE "\x1b[1m\x1b[37m" |
#define CHANNEL 22 |
#define COLOR_SET | ( | C, | |
X | |||
) | C X RESET |
#define CYAN "\x1b[36m" |
#define GREEN "\x1b[32m" |
#define HISTORY_LENGTH 200 |
#define INDIRECT 1 |
#define INDIRECTJUNK 0 |
#define INSERT_SYNC (getRand(0, 0)) |
#define M_MSDU_LENGTH (getRand(MIN_MSDU_LEN, MAX_MSDU_LEN)) |
#define M_PANID 0x1AAA |
#define MAGENTA "\x1b[35m" |
#define MAX_INSTANCES 5 |
#define MAX_MSDU_LEN 100 |
#define MIN_MSDU_LEN 100 |
#define MSDU_HISTORY 100 |
#define NUMRETRIES 4 |
#define ONE_DIRECTION 0 |
#define RED "\x1b[31m" |
#define RESET "\x1b[0m" |
#define STATUS_ACKNOWLEDGED (1 << 1) |
#define STATUS_CONFIRMED (1 << 3) |
#define STATUS_RECEIVED (1 << 0) |
#define STATUS_REPEATED (1 << 2) |
#define TO_BACKOFF ((struct timespec){0, 10000000}) |
#define TX_PERIOD ((struct timespec){0, getRand(6000000, 7000000)}) |
#define USELONGADDR (getRand(0, 0)) |
#define WAIT_CONFIRM 0 |
#define YELLOW "\x1b[33m" |
void drawTableHeader | ( | ) |
void drawTableRow | ( | unsigned int | time | ) |
void initInst | ( | struct inst_priv * | cur | ) |
int main | ( | int | argc, |
char * | argv[] | ||
) |
struct inst_priv insts[MAX_INSTANCES] = {} |
int numInsts |
pthread_mutex_t out_mutex = PTHREAD_MUTEX_INITIALIZER |
pthread_mutex_t rand_mutex = PTHREAD_MUTEX_INITIALIZER |