Sensix
Wireless Sensor Network Middleware



   Home


   Project Page


   Download


   CVS




 Hosted by
Get SENSIX at SourceForge.net. Fast, secure 
and Free Open Source software downloads

/home/brennan/Software/sensix/tools/sim/platform.pc/external_comm.c File Reference

Go to the source code of this file.

Classes

struct  incoming_command_data_t

Defines

#define htonll(x)   (x)
#define ntohll(x)   (x)
#define localAddr   INADDR_LOOPBACK
#define EC_DEBUG(_x)

Functions

int createServerSocket (short port)
void * eventAcceptThreadFunc (void *arg)
void * commandReadThreadFunc (void *arg)
void initializeSockets ()
int acceptConnection (int servfd)
void waitForGuiConnection ()
int printOtherTime (char *buf, int len, long long int ftime)
int printTime (char *buf, int len)
char * currentTime ()
void addClient (int *clientSockets, int clifd)
void sendInitEvent (int clifd)
int net_connect (char *host)
void nido_start_mote (uint16_t moteID)
void nido_stop_mote (uint16_t moteID)
TOS_MsgPtr NIDO_received_radio (TOS_MsgPtr packet)
TOS_MsgPtr NIDO_received_uart (TOS_MsgPtr packet)
void set_link_prob_value (uint16_t moteID1, uint16_t moteID2, double prob)
void event_command_cleanup (event_t *event)
void event_command_in_handle (event_t *event, struct TOS_state *state)
void event_command_in_create (event_t *event, GuiMsg *msg, char *payLoad)
int processCommand (int clifd, int clidx, GuiMsg *msg, char *payLoad, unsigned char **replyMsg, int *replyLen)
int readTossimCommand (int clifd, int clidx)
int writeTossimEvent (void *data, int datalen, int clifd)
void buildTossimEvent (uint16_t moteID, uint16_t type, long long ftime, void *data, unsigned char **msgp, int *lenp)
void sendTossimEvent (uint16_t moteID, uint16_t type, long long ftime, void *data)

Variables

int commandServerSocket = -1
int eventServerSocket = -1
int commandClients [MAX_CLIENT_CONNECTIONS]
uint8_t batchState [MAX_CLIENT_CONNECTIONS]
norace int eventClients [MAX_CLIENT_CONNECTIONS]
norace uint16_t eventMask
pthread_t eventAcceptThread
pthread_t commandReadThread
pthread_mutex_t eventClientsLock
pthread_cond_t eventClientsCond
TOS_Msg external_comm_msgs_ [TOSNODES]
TOS_MsgPtr external_comm_buffers_ [TOSNODES]


Define Documentation

#define EC_DEBUG ( _x   ) 

Definition at line 81 of file external_comm.c.

#define htonll (  )     (x)

Definition at line 69 of file external_comm.c.

#define localAddr   INADDR_LOOPBACK

Definition at line 80 of file external_comm.c.

#define ntohll (  )     (x)

Definition at line 70 of file external_comm.c.


Function Documentation

int acceptConnection ( int  servfd  ) 

Definition at line 152 of file external_comm.c.

void addClient ( int *  clientSockets,
int  clifd 
)

Definition at line 278 of file external_comm.c.

void buildTossimEvent ( uint16_t  moteID,
uint16_t  type,
long long  ftime,
void *  data,
unsigned char **  msgp,
int *  lenp 
)

Definition at line 877 of file external_comm.c.

void * commandReadThreadFunc ( void *  arg  ) 

Definition at line 769 of file external_comm.c.

int createServerSocket ( short  port  ) 

Definition at line 168 of file external_comm.c.

char* currentTime (  ) 

Definition at line 272 of file external_comm.c.

void event_command_cleanup ( event_t *  event  ) 

Definition at line 432 of file external_comm.c.

void event_command_in_create ( event_t *  event,
GuiMsg msg,
char *  payLoad 
)

Definition at line 440 of file external_comm.c.

void event_command_in_handle ( event_t *  event,
struct TOS_state state 
)

Definition at line 599 of file external_comm.c.

void * eventAcceptThreadFunc ( void *  arg  ) 

Definition at line 311 of file external_comm.c.

void initializeSockets (  ) 

Definition at line 125 of file external_comm.c.

int net_connect ( char *  host  ) 

Definition at line 340 of file external_comm.c.

TOS_MsgPtr NIDO_received_radio ( TOS_MsgPtr  packet  ) 

TOS_MsgPtr NIDO_received_uart ( TOS_MsgPtr  packet  ) 

void nido_start_mote ( uint16_t  moteID  ) 

void nido_stop_mote ( uint16_t  moteID  ) 

int printOtherTime ( char *  buf,
int  len,
long long int  ftime 
)

Definition at line 251 of file external_comm.c.

int printTime ( char *  buf,
int  len 
)

Definition at line 268 of file external_comm.c.

int processCommand ( int  clifd,
int  clidx,
GuiMsg msg,
char *  payLoad,
unsigned char **  replyMsg,
int *  replyLen 
)

Definition at line 462 of file external_comm.c.

int readTossimCommand ( int  clifd,
int  clidx 
)

Definition at line 670 of file external_comm.c.

void sendInitEvent ( int  clifd  ) 

Definition at line 292 of file external_comm.c.

void sendTossimEvent ( uint16_t  moteID,
uint16_t  type,
long long  ftime,
void *  data 
)

Definition at line 937 of file external_comm.c.

void set_link_prob_value ( uint16_t  moteID1,
uint16_t  moteID2,
double  prob 
)

void waitForGuiConnection (  ) 

Definition at line 231 of file external_comm.c.

int writeTossimEvent ( void *  data,
int  datalen,
int  clifd 
)

Definition at line 846 of file external_comm.c.


Variable Documentation

uint8_t batchState[MAX_CLIENT_CONNECTIONS]

Definition at line 86 of file external_comm.c.

int commandClients[MAX_CLIENT_CONNECTIONS]

Definition at line 85 of file external_comm.c.

pthread_t commandReadThread

Definition at line 91 of file external_comm.c.

Definition at line 83 of file external_comm.c.

pthread_t eventAcceptThread

Definition at line 90 of file external_comm.c.

norace int eventClients[MAX_CLIENT_CONNECTIONS]

Definition at line 87 of file external_comm.c.

pthread_cond_t eventClientsCond

Definition at line 93 of file external_comm.c.

pthread_mutex_t eventClientsLock

Definition at line 92 of file external_comm.c.

norace uint16_t eventMask

Definition at line 88 of file external_comm.c.

Definition at line 84 of file external_comm.c.

TOS_MsgPtr external_comm_buffers_[TOSNODES]

Definition at line 97 of file external_comm.c.

TOS_Msg external_comm_msgs_[TOSNODES]

Definition at line 96 of file external_comm.c.


© 2008, Los Alamos National Security, LLC.