📄 app.c
字号:
static inline #line 371char lossy_hears(int moteID);static inline #line 392int read_lossy_entry(FILE *file, int *mote_one, int *mote_two, double *loss);static inline #line 471void lossy_init(void);static inline #line 512link_t *lossy_neighbors(int moteID);static inline rfm_model *create_lossy_model(char *file);static inline #line 550void set_link_prob_value(uint16_t moteID1, uint16_t moteID2, double prob);# 57 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/pc/packet_sim.c"int byteTransmitTime = 8 * 104 * 2;int backoffLow = 10 * (8 * 104);int backoffHigh = 20 * (8 * 104);int txChangeLatency = 30 * (8 * 104);int preambleLength = 20;int headerLength = 7;struct IncomingMsg;typedef struct IncomingMsg { TOS_Msg msg; struct IncomingMsg *next;} IncomingMsg;TOS_MsgPtr packet_transmitting[TOSNODES];IncomingMsg *incoming[TOSNODES];link_t *cc1000_connectivity[TOSNODES];static void event_backoff_create(event_t *event, int node, long long eventTime);void event_backoff_handle(event_t *event, struct TOS_state *state);void event_start_transmit_handle(event_t *event, struct TOS_state *state);static inline void event_start_transmit_create(event_t *event, int node, long long eventTime);void event_receive_packet_create(event_t *event, int node, long long eventTime, IncomingMsg *msg);void event_receive_packet_handle(event_t *event, struct TOS_state *state);void event_send_packet_done_create(event_t *event, int node, long long eventTime);void event_send_packet_done_handle(event_t *event, struct TOS_state *state);static inline void packet_sim_init(void);static #line 130void event_backoff_create(event_t *event, int node, long long eventTime);void event_backoff_handle(event_t *event, struct TOS_state *state);static inline #line 155void event_start_transmit_create(event_t *event, int node, long long eventTime);static void corruptPacket(IncomingMsg *msg, int src, int dest);void event_start_transmit_handle(event_t *event, struct TOS_state *state);#line 228void event_receive_packet_create(event_t *event, int node, long long eventTime, IncomingMsg *msg);void event_receive_packet_handle(event_t *event, struct TOS_state *state);#line 266void event_send_packet_done_create(event_t *event, int node, long long eventTime);void event_send_packet_done_handle(event_t *event, struct TOS_state *state);# 45 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/sensorboards/micasb/sensorboard.h"enum __nesc_unnamed4294 { TOSH_ACTUAL_PHOTO_PORT = 1, TOSH_ACTUAL_TEMP_PORT = 1, TOSH_ACTUAL_MIC_PORT = 2, TOSH_ACTUAL_ACCEL_X_PORT = 3, TOSH_ACTUAL_ACCEL_Y_PORT = 4, TOSH_ACTUAL_MAG_X_PORT = 6, TOSH_ACTUAL_MAG_Y_PORT = 5};enum __nesc_unnamed4295 { TOS_ADC_PHOTO_PORT = 1, TOS_ADC_TEMP_PORT = 2, TOS_ADC_MIC_PORT = 3, TOS_ADC_ACCEL_X_PORT = 4, TOS_ADC_ACCEL_Y_PORT = 5, TOS_ADC_MAG_X_PORT = 6, TOS_ADC_MAG_Y_PORT = 8};enum __nesc_unnamed4296 { TOS_MAG_POT_ADDR = 0, TOS_MIC_POT_ADDR = 1};static __inline void TOSH_SET_PHOTO_CTL_PIN(void);#line 73static __inline void TOSH_CLR_PHOTO_CTL_PIN(void);#line 73static __inline void TOSH_MAKE_PHOTO_CTL_OUTPUT(void);#line 73static __inline void TOSH_MAKE_PHOTO_CTL_INPUT(void);static __inline void TOSH_SET_TEMP_CTL_PIN(void);#line 74static __inline void TOSH_CLR_TEMP_CTL_PIN(void);#line 74static __inline void TOSH_MAKE_TEMP_CTL_OUTPUT(void);#line 74static __inline void TOSH_MAKE_TEMP_CTL_INPUT(void);# 39 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/Timer.h"enum __nesc_unnamed4297 { TIMER_REPEAT = 0, TIMER_ONE_SHOT = 1, NUM_TIMERS = 4};# 35 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/ADC.h"enum __nesc_unnamed4298 { TOS_ADCSample3750ns = 0, TOS_ADCSample7500ns = 1, TOS_ADCSample15us = 2, TOS_ADCSample30us = 3, TOS_ADCSample60us = 4, TOS_ADCSample120us = 5, TOS_ADCSample240us = 6, TOS_ADCSample480us = 7};# 34 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/Clock.h"enum __nesc_unnamed4299 { TOS_I1024PS = 0, TOS_S1024PS = 3, TOS_I512PS = 1, TOS_S512PS = 3, TOS_I256PS = 3, TOS_S256PS = 3, TOS_I128PS = 7, TOS_S128PS = 3, TOS_I64PS = 15, TOS_S64PS = 3, TOS_I32PS = 31, TOS_S32PS = 3, TOS_I16PS = 63, TOS_S16PS = 3, TOS_I8PS = 127, TOS_S8PS = 3, TOS_I4PS = 255, TOS_S4PS = 3, TOS_I2PS = 15, TOS_S2PS = 7, TOS_I1PS = 31, TOS_S1PS = 7, TOS_I0PS = 0, TOS_S0PS = 0};enum __nesc_unnamed4300 { DEFAULT_SCALE = 3, DEFAULT_INTERVAL = 255};# 8 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/lib/FunnelingMAC/FunnelingMAC.h"enum __nesc_unnamed4301 { AM_TOKENRING = 31, AM_PTOKENRING = 32, AM_DATA = 33};typedef struct RETURNTOKENRING_Msg { uint8_t sourceaddr; uint8_t denaddr;} __attribute((packed)) RETURNTOKENRING_Msg;typedef struct TOKENRINGMsg { uint8_t sourceaddr; uint8_t denaddr; uint8_t isstart;} __attribute((packed)) TOKENRINGMsg;static # 42 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/system/crc.h"uint16_t crcByte(uint16_t crc, uint8_t b);# 32 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/pc/HPLConstants.h"enum __nesc_unnamed4302 { UART_BYTE_TIME = 1600};static result_t Nido$RadioSendMsg$default$sendDone(TOS_MsgPtr arg_0x105f0868, result_t arg_0x105f09b8);static void PowerStateM$PowerState$radioStop(void);static void PowerStateM$PowerState$ADCdataReady(void);static void PowerStateM$PowerState$radioStart(void);static void PowerStateM$PowerState$CPUCycleCheckpoint(void);static void PowerStateM$PowerState$yellowOff(void);static void PowerStateM$PowerState$yellowOn(void);static void PowerStateM$PowerState$greenOff(void);static result_t PowerStateM$PowerState$init(int arg_0x105f35c0, int arg_0x105f3708);static void PowerStateM$PowerState$radioRxMode(void);static void PowerStateM$PowerState$ADCsample(uint8_t arg_0x1060a0e8);static void PowerStateM$PowerState$ADCon(void);static void PowerStateM$PowerState$redOff(void);static void PowerStateM$PowerState$radioTxMode(void);static void PowerStateM$PowerState$redOn(void);static result_t PowerStateM$PowerState$stop(void);static double PowerStateM$PowerState$get_mote_cycles(int arg_0x105f31b0);static void PowerStateM$PowerState$greenOn(void);static result_t SurgeM$Light$dataReady(uint16_t arg_0x106e0cd0);static result_t SurgeM$TimerS$fired(void);static result_t SurgeM$SendMsg$sendDone(TOS_MsgPtr arg_0x106ecf58, result_t arg_0x106ed0a8);static result_t SurgeM$Temperature$dataReady(uint16_t arg_0x106e0cd0);static result_t SurgeM$StdControl$init(void);static result_t SurgeM$StdControl$start(void);static result_t SurgeM$StdControl$stop(void);static result_t SurgeM$TimerT$fired(void);static result_t TimerM$Clock$fire(void);static result_t TimerM$StdControl$init(void);static result_t TimerM$StdControl$start(void);static result_t TimerM$StdControl$stop(void);static result_t TimerM$Timer$default$fired(uint8_t arg_0x106fd090);static result_t TimerM$Timer$start(uint8_t arg_0x106fd090, char arg_0x106cc8d8, uint32_t arg_0x106cca30);static result_t TimerM$Timer$stop(uint8_t arg_0x106fd090);static void HPLClock$Clock$setInterval(uint8_t arg_0x10711178);static uint8_t HPLClock$Clock$readCounter(void);static result_t HPLClock$Clock$setRate(char arg_0x10710678, char arg_0x107107b8);static uint8_t HPLClock$Clock$getInterval(void);static result_t NoLeds$Leds$greenToggle(void);static uint8_t HPLPowerManagementM$PowerManagement$adjustPower(void);static result_t LedsM$Leds$yellowOff(void);static result_t LedsM$Leds$yellowOn(void);static result_t LedsM$Leds$init(void);static result_t LedsM$Leds$greenOff(void);static result_t LedsM$Leds$redOff(void);static result_t LedsM$Leds$redOn(void);static result_t LedsM$Leds$greenOn(void);static result_t PhotoTempM$PhotoTempTimer$fired(void);static result_t PhotoTempM$PhotoStdControl$init(void);static result_t PhotoTempM$PhotoStdControl$start(void);static result_t PhotoTempM$PhotoStdControl$stop(void);static result_t PhotoTempM$InternalTempADC$dataReady(uint16_t arg_0x106e0cd0);static result_t PhotoTempM$TempStdControl$init(void);static result_t PhotoTempM$TempStdControl$start(void);static result_t PhotoTempM$TempStdControl$stop(void);static result_t PhotoTempM$ExternalTempADC$getData(void);static result_t PhotoTempM$ExternalPhotoADC$getData(void);static result_t PhotoTempM$InternalPhotoADC$dataReady(uint16_t arg_0x106e0cd0);static result_t ADCM$HPLADC$dataReady(uint16_t arg_0x107a8878);static result_t ADCM$ADCControl$bindPort(uint8_t arg_0x1079ded8, uint8_t arg_0x1076e060);static result_t ADCM$ADCControl$init(void);static result_t ADCM$ADC$getData(uint8_t arg_0x10789950);static result_t ADCM$ADC$default$dataReady(uint8_t arg_0x10789950, uint16_t arg_0x106e0cd0);static result_t HPLADCC$ADC$bindPort(uint8_t arg_0x107b1700, uint8_t arg_0x107b1848);static result_t HPLADCC$ADC$sampleStop(void);static result_t HPLADCC$ADC$init(void);static result_t HPLADCC$ADC$samplePort(uint8_t arg_0x107b1d30);static TOS_MsgPtr AMPromiscuous$ReceiveMsg$default$receive(uint8_t arg_0x107bc638, TOS_MsgPtr arg_0x105dcca8);static result_t AMPromiscuous$ActivityTimer$fired(void);static result_t AMPromiscuous$UARTSend$sendDone(TOS_MsgPtr arg_0x105f0868, result_t arg_0x105f09b8);static TOS_MsgPtr AMPromiscuous$RadioReceive$receive(TOS_MsgPtr arg_0x105dcca8);static result_t AMPromiscuous$CommControl$setPromiscuous(bool arg_0x107e6b38);static result_t AMPromiscuous$Control$init(void);static result_t AMPromiscuous$Control$start(void);static result_t AMPromiscuous$Control$stop(void);static result_t AMPromiscuous$default$sendDone(void);static result_t AMPromiscuous$RadioSend$sendDone(TOS_MsgPtr arg_0x105f0868, result_t arg_0x105f09b8);static result_t AMPromiscuous$SendMsg$send(uint8_t arg_0x107bc080, uint16_t arg_0x106ec8a0, uint8_t arg_0x106ec9e8, TOS_MsgPtr arg_0x106ecb38);static result_t AMPromiscuous$SendMsg$default$sendDone(uint8_t arg_0x107bc080, TOS_MsgPtr arg_0x106ecf58, result_t arg_0x106ed0a8);static TOS_MsgPtr AMPromiscuous$UARTReceive$receive(TOS_MsgPtr arg_0x105dcca8);static result_t MicaHighSpeedRadioM$Send$send(TOS_MsgPtr arg_0x105f0350);static result_t MicaHighSpeedRadioM$Code$decodeDone(char arg_0x107ef298, char arg_0x107ef3d8);static result_t MicaHighSpeedRadioM$Code$encodeDone(char arg_0x107ef7e0);static void MicaHighSpeedRadioM$RadioReceiveCoordinator$default$byte(TOS_MsgPtr arg_0x107f2b40, uint8_t arg_0x107f2c90);static void MicaHighSpeedRadioM$RadioReceiveCoordinator$default$startSymbol(uint8_t arg_0x107f2430, uint8_t arg_0x107f2578, TOS_MsgPtr arg_0x107f26c8);static result_t MicaHighSpeedRadioM$SpiByteFifo$dataReady(uint8_t arg_0x108134a0);static result_t MicaHighSpeedRadioM$Control$init(void);static result_t MicaHighSpeedRadioM$Control$start(void);static result_t MicaHighSpeedRadioM$Control$stop(void);static void MicaHighSpeedRadioM$RadioSendCoordinator$default$byte(TOS_MsgPtr arg_0x107f2b40, uint8_t arg_0x107f2c90);static void MicaHighSpeedRadioM$RadioSendCoordinator$default$startSymbol(uint8_t arg_0x107f2430, uint8_t arg_0x107f2578, TOS_MsgPtr arg_0x107f26c8);static result_t MicaHighSpeedRadioM$ChannelMon$idleDetect(void);static result_t MicaHighSpeedRadioM$ChannelMon$startSymDetect(void);static result_t SecDedEncoding$Code$encode_flush(void);static result_t SecDedEncoding$Code$decode(char arg_0x107eee98);static result_t SecDedEncoding$Code$encode(char arg_0x107eeaa0);static uint16_t RandomLFSR$Random$rand(void);static result_t RandomLFSR$Random$init(void);static result_t ChannelMonC$ChannelMon$macDelay(void);static result_t ChannelMonC$ChannelMon$startSymbolSearch(void);static result_t ChannelMonC$ChannelMon$init(void);static result_t ChannelMonC$ChannelMon$stopMonitorChannel(void);static uint16_t RadioTimingC$RadioTiming$currentTime(void);static uint16_t RadioTimingC$RadioTiming$getTiming(void);static result_t SpiByteFifoC$SpiByteFifo$send(uint8_t arg_0x108121c0);static result_t SpiByteFifoC$SpiByteFifo$phaseShift(void);static result_t SpiByteFifoC$SpiByteFifo$startReadBytes(uint16_t arg_0x10812880);static result_t SpiByteFifoC$SpiByteFifo$idle(void);static result_t SpiByteFifoC$SpiByteFifo$txMode(void);static result_t SpiByteFifoC$SpiByteFifo$rxMode(void);static TOS_MsgPtr CrcFilter$LowerReceive$receive(TOS_MsgPtr arg_0x105dcca8);static result_t UARTNoCRCPacketM$Send$send(TOS_MsgPtr arg_0x105f0350);static result_t UARTNoCRCPacketM$Control$init(void);static result_t UARTNoCRCPacketM$Control$start(void);static result_t UARTNoCRCPacketM$Control$stop(void);static TOS_MsgPtr FunnelingMACM$ReceiveMsg$receive(uint8_t arg_0x108fd770, TOS_MsgPtr arg_0x105dcca8);static result_t FunnelingMACM$SendMsgT$sendDone(TOS_MsgPtr arg_0x106ecf58, result_t arg_0x106ed0a8);static result_t FunnelingMACM$UARTSend$sendDone(TOS_MsgPtr arg_0x105f0868, result_t arg_0x105f09b8);static result_t FunnelingMACM$SendMsgD$sendDone(TOS_MsgPtr arg_0x106ecf58, result_t arg_0x106ed0a8);static result_t FunnelingMACM$SendMsg$send(uint16_t arg_0x106ec8a0, uint8_t arg_0x106ec9e8, TOS_MsgPtr arg_0x106ecb38);static result_t FunnelingMACM$SendMsgPT$sendDone(TOS_MsgPtr arg_0x106ecf58, result_t arg_0x106ed0a8);static result_t FunnelingMACM$StdControl$init(void);static result_t FunnelingMACM$StdControl$start(void);static result_t FunnelingMACM$StdControl$stop(void);static result_t FramerM$ByteComm$txDone(void);static result_t FramerM$ByteComm$txByteReady(bool arg_0x108e0e90);static result_t FramerM$BareSendMsg$send(TOS_MsgPtr arg_0x105f0350);static result_t FramerM$StdControl$init(void);static result_t FramerM$StdControl$start(void);static result_t FramerM$StdControl$stop(void);static result_t UARTM$HPLUART$putDone(void);static result_t UARTM$ByteComm$txByte(uint8_t arg_0x108e0230);static result_t UARTM$Control$init(void);static result_t UARTM$Control$start(void);static result_t UARTM$Control$stop(void);static result_t HPLUARTC$HPLUART$init(void);static result_t HPLUARTC$HPLUART$put(uint8_t arg_0x1097e700);static result_t HPLUARTC$HPLUART$stop(void);static # 75 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/ReceiveMsg.nc"TOS_MsgPtr Nido$UARTReceiveMsg$receive(TOS_MsgPtr arg_0x105dcca8);static # 22 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/pc/PowerState.nc"void Nido$PowerState$CPUCycleCheckpoint(void);static #line 14result_t Nido$PowerState$init(int arg_0x105f35c0, int arg_0x105f3708);static result_t Nido$PowerState$stop(void);static # 67 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/BareSendMsg.nc"result_t Nido$RadioSendMsg$sendDone(TOS_MsgPtr arg_0x105f0868, result_t arg_0x105f09b8);static # 75 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/ReceiveMsg.nc"TOS_MsgPtr Nido$RadioReceiveMsg$receive(TOS_MsgPtr arg_0x105dcca8);static # 63 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/StdControl.nc"result_t Nido$StdControl$init(void);static result_t Nido$StdControl$start(void);static result_t Nido$StdControl$stop(void);static inline # 74 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/pc/Nido.nc"void Nido$usage(char *progname);static void Nido$help(char *progname);#line 107void event_boot_handle(event_t *fevent, struct TOS_state *fstate);#line 122int main(int argc, char **argv);#line 387void nido_start_mote(uint16_t moteID);#line 402void nido_stop_mote(uint16_t moteID);#line 416TOS_MsgPtr NIDO_received_radio(TOS_MsgPtr packet);TOS_MsgPtr NIDO_received_uart(TOS_MsgPtr packet);static inline #line 442result_t Nido$RadioSendMsg$default$sendDone(TOS_MsgPtr msg, result_t success);void packet_sim_transmit_done(TOS_MsgPtr msg);void packet_sim_receive_msg(TOS_MsgPtr msg);void set_sim_rate(uint32_t rate);uint32_t get_sim_rate(void);static inline # 20 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/platform/pc/PowerStateM.nc"int PowerStateM$num_bbs(void);static inline void PowerStateM$dump_power_details(void);static inline result_t PowerStateM$PowerState$init(int prof, int cpu_prof);static inline #line 54result_t PowerStateM$PowerState$stop(void);static inline void PowerStateM$PowerState$ADCon(void);static inline #line 75void PowerStateM$PowerState$ADCdataReady(void);static inline void PowerStateM$PowerState$ADCsample(uint8_t port);static inline #line 130void PowerStateM$PowerState$redOn(void);static inline void PowerStateM$PowerState$redOff(void);static inline void PowerStateM$PowerState$greenOn(void);static inline void PowerStateM$PowerState$greenOff(void);static inline void PowerStateM$PowerState$yellowOn(void);static inline void PowerStateM$PowerState$yellowOff(void);static inline void PowerStateM$PowerState$radioTxMode(void);static inline void PowerStateM$PowerState$radioRxMode(void);static inline #line 185void PowerStateM$PowerState$radioStart(void);static inline void PowerStateM$PowerState$radioStop(void);static inline #line 311int PowerStateM$num_bbs(void);static inline int PowerStateM$bb_exec_count(int mote, int bb);static double PowerStateM$PowerState$get_mote_cycles(int mote);static inline #line 339void PowerStateM$print_power_info(void);static inline #line 361void PowerStateM$dump_power_details(void);static inline #line 389void PowerStateM$PowerState$CPUCycleCheckpoint(void);static # 63 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/StdControl.nc"result_t SurgeM$PhotoControl$init(void);static result_t SurgeM$PhotoControl$start(void);static result_t SurgeM$PhotoControl$stop(void);static # 52 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/ADC.nc"result_t SurgeM$Light$getData(void);static # 63 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/StdControl.nc"result_t SurgeM$TempControl$init(void);static result_t SurgeM$TempControl$start(void);static result_t SurgeM$TempControl$stop(void);static # 59 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/Timer.nc"result_t SurgeM$TimerS$start(char arg_0x106cc8d8, uint32_t arg_0x106cca30);static result_t SurgeM$TimerS$stop(void);static # 122 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/Leds.nc"result_t SurgeM$Leds$yellowOff(void);static #line 114result_t SurgeM$Leds$yellowOn(void);static #line 56result_t SurgeM$Leds$init(void);static # 48 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/SendMsg.nc"result_t SurgeM$SendMsg$send(uint16_t arg_0x106ec8a0, uint8_t arg_0x106ec9e8, TOS_MsgPtr arg_0x106ecb38);static # 52 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/ADC.nc"result_t SurgeM$Temperature$getData(void);static # 59 "C:/tinyos/cygwin/opt/tinyos-1.x/tos/interfaces/Timer.nc"result_t SurgeM$TimerT$start(char arg_0x106cc8d8, uint32_t arg_0x106cca30);static result_t SurgeM$TimerT$stop(void);# 28 "SurgeM.nc"uint8_t SurgeM$BASE_STATION_ADDR[1000];enum SurgeM$__nesc_unnamed4303 { SurgeM$TIMER_GETADC_COUNT = 3};enum SurgeM$__nesc_unnamed4304 {#line 33 SurgeM$SENSOR_ID = 0, SurgeM$PACKET_ID, SurgeM$NODE_ID = 2, SurgeM$R
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -