#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 "sysclk.h"
#include "led.h"
#include "asf.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 |
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 |
|
static |
References APP_RX_BUF_SIZE, APP_SENDING_INTERVAL, APP_STATE_PREPARE_TO_SLEEP, APP_STATE_SEND, APP_STATE_SENDING_DONE, APP_STATE_SLEEP, APP_STATE_WAIT_SEND_TIMER, APP_STATE_WAKEUP, appInit(), appSendData(), appState, NWK_Busy(), NWK_SleepReq(), NWK_WakeupReq(), sio2host_rx(), sm_sleep(), SYS_TimerStart(), and UartBytesReceived().
Referenced by wsndemo_task().
|
static |
References APP_COMMAND_PENDING, APP_CommandsPending(), appUartSendMessage(), NWK_DataInd_t::data, LED_COUNT, LED_DATA, LED_Toggle, NWK_DataInd_t::lqi, AppMessage_t::lqi, NWK_SetAckControl(), NWK_DataInd_t::rssi, AppMessage_t::rssi, NWK_DataInd_t::size, and NWK_DataInd_t::srcAddr.
Referenced by appInit().
|
static |
References APP_STATE_SEND, APP_STATE_WAIT_SEND_TIMER, appState, and SYS_TimerStart().
Referenced by appInit().
|
static |
References APP_ADDR, APP_CAPTION, APP_CAPTION_SIZE, APP_CHANNEL, APP_COMMAND_ID_NETWORK_INFO, APP_CommandsInit(), APP_ENDPOINT, APP_NODE_TYPE, APP_PANID, APP_SECURITY_KEY, APP_SENDING_INTERVAL, APP_STATE_SEND, appDataInd(), appDataSendingTimerHandler(), appState, AppMessage_t::battery, AppMessage_t::caption, AppMessage_t::channelMask, AppMessage_t::commandId, AppMessage_t::extAddr, SYS_Timer_t::handler, SYS_Timer_t::interval, LED_NETWORK, LED_On, AppMessage_t::light, AppMessage_t::lqi, SYS_Timer_t::mode, AppMessage_t::nodeType, NWK_ACK_WAIT_TIME, NWK_OpenEndpoint(), NWK_SetAddr(), NWK_SetPanId(), NWK_SetSecurityKey(), AppMessage_t::panId, AppMessage_t::parentShortAddr, PHY_RandomReq(), PHY_SetChannel(), PHY_SetRxState(), AppMessage_t::rssi, AppMessage_t::sensors, AppMessage_t::shortAddr, AppMessage_t::size, AppMessage_t::softVersion, SYS_TIMER_INTERVAL_MODE, SYS_TIMER_PERIODIC_MODE, SYS_TimerStart(), AppMessage_t::temperature, AppMessage_t::text, AppMessage_t::type, and AppMessage_t::workingChannel.
Referenced by APP_TaskHandler().
|
static |
References APP_ENDPOINT, APP_STATE_WAIT_CONF, APP_STATE_WAIT_SEND_TIMER, appMsg, appState, appUartSendMessage(), AppMessage_t::battery, NWK_DataReq_t::confirm, NWK_DataReq_t::data, NWK_DataReq_t::dstAddr, NWK_DataReq_t::dstEndpoint, LED_DATA, LED_On, AppMessage_t::light, NWK_DataReq(), NWK_OPT_ACK_REQUEST, NWK_OPT_ENABLE_SECURITY, NWK_RouteNextHop(), NWK_DataReq_t::options, AppMessage_t::parentShortAddr, AppMessage_t::sensors, NWK_DataReq_t::size, NWK_DataReq_t::srcEndpoint, SYS_TimerStart(), and AppMessage_t::temperature.
Referenced by APP_TaskHandler().
|
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().
|
static |
|
static |
Referenced by appSendData().
|
static |
Referenced by APP_TaskHandler(), appDataSendingTimerHandler(), appInit(), and appSendData().
|
static |