Microchip® Advanced Software Framework

wsndemo.c File Reference
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "config.h"
#include "sys.h"
#include "phy.h"
#include "nwk.h"
#include "sysTimer.h"
#include "commands.h"
#include "sio2host.h"
#include "system.h"
#include "asf.h"
#include "board.h"
#include "wsndemo.h"

Data Structures

struct  AppMessage_t
 

Macros

#define APP_CAPTION_SIZE   (sizeof(APP_CAPTION) - 1)
 
#define APP_COMMAND_PENDING   0x01
 

Typedefs

typedef struct AppMessage_t AppMessage_t
 
typedef enum AppState_t AppState_t
 

Enumerations

enum  AppState_t {
  APP_STATE_INITIAL,
  APP_STATE_SEND,
  APP_STATE_WAIT_CONF,
  APP_STATE_SENDING_DONE,
  APP_STATE_WAIT_SEND_TIMER,
  APP_STATE_WAIT_COMMAND_TIMER,
  APP_STATE_PREPARE_TO_SLEEP,
  APP_STATE_SLEEP,
  APP_STATE_WAKEUP
}
 

Functions

static void APP_TaskHandler (void)
 
static bool appDataInd (NWK_DataInd_t *ind)
 
static void appDataSendingTimerHandler (SYS_Timer_t *timer)
 
static void appInit (void)
 
static void appSendData (void)
 
static void appUartSendMessage (uint8_t *data, uint8_t size)
 
void UartBytesReceived (uint16_t bytes, uint8_t *byte)
 
void wsndemo_init (void)
 Init function of the WSNDemo application. More...
 
void wsndemo_task (void)
 Task of the WSNDemo application This task should be called in a while(1) More...
 

Variables

static SYS_Timer_t appDataSendingTimer
 
static AppMessage_t appMsg
 
static AppState_t appState = APP_STATE_INITIAL
 
static uint8_t rx_data [APP_RX_BUF_SIZE]
 

#define APP_CAPTION_SIZE   (sizeof(APP_CAPTION) - 1)

Referenced by appInit().

#define APP_COMMAND_PENDING   0x01

Referenced by appDataInd().

typedef struct AppMessage_t AppMessage_t
typedef enum AppState_t AppState_t

enum AppState_t
Enumerator
APP_STATE_INITIAL 
APP_STATE_SEND 
APP_STATE_WAIT_CONF 
APP_STATE_SENDING_DONE 
APP_STATE_WAIT_SEND_TIMER 
APP_STATE_WAIT_COMMAND_TIMER 
APP_STATE_PREPARE_TO_SLEEP 
APP_STATE_SLEEP 
APP_STATE_WAKEUP 

static void appDataSendingTimerHandler ( SYS_Timer_t timer)
static
static void appUartSendMessage ( uint8_t *  data,
uint8_t  size 
)
static

References sio2host_putchar().

Referenced by appDataInd(), and appSendData().

void UartBytesReceived ( uint16_t  bytes,
uint8_t *  byte 
)

References APP_CommandsByteReceived().

Referenced by APP_TaskHandler().

void wsndemo_init ( void  )

Init function of the WSNDemo application.

References sio2host_init(), sm_init(), and SYS_Init().

Referenced by main().

void wsndemo_task ( void  )

Task of the WSNDemo application This task should be called in a while(1)

References APP_TaskHandler(), and SYS_TaskHandler().

Referenced by main().

SYS_Timer_t appDataSendingTimer
static
AppMessage_t appMsg
static

Referenced by appSendData().

uint8_t rx_data[APP_RX_BUF_SIZE]
static

Referenced by _usart_read_buffer().