#define dbg(mode, format, ...) ((void)0) #define dbg_clear(mode, format, ...) ((void)0) #define dbg_active(mode) 0 # 50 "d:/avrgcc/avr/include/inttypes.h" typedef signed char int8_t; typedef unsigned char uint8_t; # 60 "d:/avrgcc/avr/include/inttypes.h" 3 typedef int int16_t; typedef unsigned int uint16_t; typedef long int32_t; typedef unsigned long uint32_t; typedef long long int64_t; typedef unsigned long long uint64_t; typedef int16_t intptr_t; typedef uint16_t uintptr_t; # 213 "d:/avrgcc/lib/gcc-lib/avr/3.3/include/stddef.h" 3 typedef unsigned int size_t; # 63 "d:/avrgcc/avr/include/string.h" extern char *strcat(char *, const char *); extern int __attribute((__pure__)) strcmp(const char *, const char *); extern char *strcpy(char *, const char *); extern int __attribute((__pure__)) strcasecmp(const char *, const char *); extern size_t __attribute((__pure__)) strlen(const char *); # 325 "d:/avrgcc/lib/gcc-lib/avr/3.3/include/stddef.h" 3 typedef int wchar_t; # 60 "d:/avrgcc/avr/include/stdlib.h" typedef struct __nesc_unnamed4242 { int quot; int rem; } div_t; typedef struct __nesc_unnamed4243 { long quot; long rem; } ldiv_t; typedef int (*__compar_fn_t)(const void *, const void *); # 413 "d:/avrgcc/avr/include/stdlib.h" 3 extern char *itoa(int __val, char *__s, int __radix); # 151 "d:/avrgcc/lib/gcc-lib/avr/3.3/include/stddef.h" 3 typedef int ptrdiff_t; # 90 "d:/tinyos-1.x/tos/system/tos.h" typedef unsigned char bool; enum __nesc_unnamed4244 { FALSE = 0, TRUE = 1 }; uint16_t TOS_LOCAL_ADDRESS = 1; enum __nesc_unnamed4245 { FAIL = 0, SUCCESS = 1 }; static inline uint8_t rcombine(uint8_t r1, uint8_t r2); typedef uint8_t result_t; static inline result_t rcombine(result_t r1, result_t r2); static inline result_t rcombine3(result_t r1, result_t r2, result_t r3); static inline result_t rcombine4(result_t r1, result_t r2, result_t r3, result_t r4); enum __nesc_unnamed4246 { NULL = 0x0 }; # 79 "d:/avrgcc/avr/include/avr/pgmspace.h" typedef void __attribute((__progmem__)) prog_void; typedef char __attribute((__progmem__)) prog_char; typedef unsigned char __attribute((__progmem__)) prog_uchar; typedef int __attribute((__progmem__)) prog_int; typedef long __attribute((__progmem__)) prog_long; typedef long long __attribute((__progmem__)) prog_long_long; # 147 "d:/tinyos-1.x/tos/platform/avrmote/avrhardware.h" enum __nesc_unnamed4247 { TOSH_period16 = 0x00, TOSH_period32 = 0x01, TOSH_period64 = 0x02, TOSH_period128 = 0x03, TOSH_period256 = 0x04, TOSH_period512 = 0x05, TOSH_period1024 = 0x06, TOSH_period2048 = 0x07 }; static inline void TOSH_wait(void); static inline void TOSH_sleep(void); typedef uint8_t __nesc_atomic_t; __inline __nesc_atomic_t __nesc_atomic_start(void ); __inline void __nesc_atomic_end(__nesc_atomic_t oldSreg); # 224 "d:/tinyos-1.x/tos/platform/mica2/CC1000Const.h" static const prog_uchar CC1K_LPL_PreambleLength[7 * 2] = { 0, 28, 0, 94, 0, 250, 0x01, 0x73, 0x01, 0xEA, 0x04, 0xBC, 0x0A, 0x5E }; static const prog_uchar CC1K_LPL_ValidPrecursor[7] = { 5, 2, 2, 2, 2, 2, 2 }; static const prog_uchar CC1K_LPL_SleepTime[7 * 2] = { 0, 0, 0, 20, 0, 85, 0, 135, 0, 185, 0x01, 0xE5, 0x04, 0x3D }; static const prog_uchar CC1K_LPL_SleepPreamble[7] = { 0, 8, 8, 8, 8, 8, 8 }; static const prog_uchar CC1K_LPL_SquelchInit[7] = { 0x70, 0xEF, 0xEF, 0xEF, 0xEF, 0xEF, 0xEF }; static const prog_uchar CC1K_Params[5][31] = { { 0x31, 0x58, 0x00, 0x00, 0x57, 0xf6, 0x85, 0X03, 0x55, ( 8 << 4) | (4 << 2), 1 << 1, ( 0x0 << 4) | (0xf << 0), 12 << 3, 0xe << 4, ( 1 << 5) | (6 << 0), ( 1 << 7) | (33 << 0), ((( 3 << 5) | (1 << 3)) | (3 << 1)) | (1 << 0), (( 5 << 4) | (1 << 2)) | (1 << 0), ( 0x7 << 4) | (0x0 << 0), 1 << 0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ( 8 << 4) | (1 << 0), TRUE }, { 0x31, 0x7c, 0x00, 0x00, 0x7b, 0xf9, 0xae, 0x02, 0x38, ( 8 << 4) | (3 << 2), (( 1 << 5) | (2 << 3)) | (1 << 1), ( 0x8 << 4) | (0x0 << 0), 8 << 3, 0x1 << 4, ( 1 << 5) | (6 << 0), ( 1 << 7) | (33 << 0), ((( 3 << 5) | (1 << 3)) | (3 << 1)) | (1 << 0), (( 5 << 4) | (1 << 2)) | (1 << 0), ( 0x1 << 4) | (0x0 << 0), 1 << 0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ( 15 << 4) | (3 << 0), TRUE }, { 0x31, 0x51, 0x00, 0x00, 0x50, 0xf7, 0x4F, 0X03, 0x0E, ( 8 << 4) | (4 << 2), 1 << 1, ( 0x0 << 4) | (0xf << 0), 11 << 3, 0xe << 4, ( 1 << 5) | (6 << 0), ( 1 << 7) | (33 << 0), ((( 3 << 5) | (1 << 3)) | (3 << 1)) | (1 << 0), (( 5 << 4) | (1 << 2)) | (1 << 0), ( 0x7 << 4) | (0x0 << 0), 1 << 0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ( 8 << 4) | (1 << 0), TRUE }, { 0x31, 0x58, 0x00, 0x00, 0x57, 0xf6, 0x85, 0X03, 0x55, ( 4 << 4) | (1 << 2), 1 << 1, ( 0x0 << 4) | (0xf << 0), 12 << 3, 0xe << 4, ( 1 << 5) | (6 << 0), ( 1 << 7) | (55 << 0), ((( 3 << 5) | (1 << 3)) | (3 << 1)) | (1 << 0), (( 5 << 4) | (1 << 2)) | (0 << 0), ( 0x7 << 4) | (0x0 << 0), 1 << 0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ( 8 << 4) | (1 << 0), TRUE }, { 0x31, 0x58, 0x00, 0x00, 0x57, 0xf6, 0x85, 0X03, 0x55, ( 8 << 4) | (4 << 2), 1 << 1, ( 0x0 << 4) | (0xf << 0), 12 << 3, 0xe << 4, ( 1 << 5) | (6 << 0), ( 1 << 7) | (33 << 0), ((( 3 << 5) | (1 << 3)) | (3 << 1)) | (1 << 0), (( 5 << 4) | (1 << 2)) | (1 << 0), ( 0x7 << 4) | (0x0 << 0), 1 << 0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ( 8 << 4) | (1 << 0), TRUE } }; static # 95 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" void __inline TOSH_uwait(int u_sec); #line 110 static __inline void TOSH_SET_RED_LED_PIN(void); #line 110 static __inline void TOSH_CLR_RED_LED_PIN(void); #line 110 static __inline void TOSH_MAKE_RED_LED_OUTPUT(void); static __inline void TOSH_SET_GREEN_LED_PIN(void); #line 111 static __inline void TOSH_CLR_GREEN_LED_PIN(void); #line 111 static __inline void TOSH_MAKE_GREEN_LED_OUTPUT(void); static __inline void TOSH_SET_YELLOW_LED_PIN(void); #line 112 static __inline void TOSH_CLR_YELLOW_LED_PIN(void); #line 112 static __inline void TOSH_MAKE_YELLOW_LED_OUTPUT(void); static __inline void TOSH_MAKE_CC_CHP_OUT_INPUT(void); static __inline void TOSH_SET_CC_PDATA_PIN(void); #line 120 static __inline void TOSH_CLR_CC_PDATA_PIN(void); #line 120 static __inline int TOSH_READ_CC_PDATA_PIN(void); #line 120 static __inline void TOSH_MAKE_CC_PDATA_OUTPUT(void); #line 120 static __inline void TOSH_MAKE_CC_PDATA_INPUT(void); static __inline void TOSH_SET_CC_PCLK_PIN(void); #line 121 static __inline void TOSH_CLR_CC_PCLK_PIN(void); #line 121 static __inline void TOSH_MAKE_CC_PCLK_OUTPUT(void); static __inline void TOSH_SET_CC_PALE_PIN(void); #line 122 static __inline void TOSH_CLR_CC_PALE_PIN(void); #line 122 static __inline void TOSH_MAKE_CC_PALE_OUTPUT(void); static __inline void TOSH_SET_FLASH_SELECT_PIN(void); #line 125 static __inline void TOSH_MAKE_FLASH_SELECT_OUTPUT(void); static __inline void TOSH_MAKE_FLASH_CLK_OUTPUT(void); static __inline void TOSH_MAKE_FLASH_OUT_OUTPUT(void); static __inline void TOSH_SET_INT1_PIN(void); #line 132 static __inline void TOSH_CLR_INT1_PIN(void); #line 132 static __inline void TOSH_MAKE_INT1_OUTPUT(void); #line 132 static __inline void TOSH_MAKE_INT1_INPUT(void); static __inline void TOSH_SET_INT2_PIN(void); #line 133 static __inline void TOSH_CLR_INT2_PIN(void); #line 133 static __inline void TOSH_MAKE_INT2_OUTPUT(void); #line 133 static __inline void TOSH_MAKE_INT2_INPUT(void); static __inline int TOSH_READ_INT3_PIN(void); #line 134 static __inline void TOSH_MAKE_INT3_INPUT(void); static __inline void TOSH_MAKE_MOSI_OUTPUT(void); #line 137 static __inline void TOSH_MAKE_MOSI_INPUT(void); static __inline void TOSH_MAKE_MISO_OUTPUT(void); #line 138 static __inline void TOSH_MAKE_MISO_INPUT(void); static __inline void TOSH_MAKE_SPI_OC1C_INPUT(void); static __inline void TOSH_MAKE_SPI_SCK_INPUT(void); static __inline void TOSH_MAKE_PW0_OUTPUT(void); static __inline void TOSH_MAKE_PW1_OUTPUT(void); static __inline void TOSH_SET_PW2_PIN(void); #line 145 static __inline void TOSH_CLR_PW2_PIN(void); #line 145 static __inline void TOSH_MAKE_PW2_OUTPUT(void); static __inline void TOSH_SET_PW3_PIN(void); #line 146 static __inline void TOSH_CLR_PW3_PIN(void); #line 146 static __inline void TOSH_MAKE_PW3_OUTPUT(void); static __inline void TOSH_SET_PW4_PIN(void); #line 147 static __inline void TOSH_CLR_PW4_PIN(void); #line 147 static __inline void TOSH_MAKE_PW4_OUTPUT(void); static __inline void TOSH_MAKE_PW5_OUTPUT(void); static __inline void TOSH_SET_PW6_PIN(void); #line 149 static __inline void TOSH_CLR_PW6_PIN(void); #line 149 static __inline void TOSH_MAKE_PW6_OUTPUT(void); static __inline void TOSH_MAKE_PW7_OUTPUT(void); static __inline void TOSH_SET_I2C_BUS1_SCL_PIN(void); #line 153 static __inline void TOSH_CLR_I2C_BUS1_SCL_PIN(void); #line 153 static __inline void TOSH_MAKE_I2C_BUS1_SCL_OUTPUT(void); static __inline void TOSH_SET_I2C_BUS1_SDA_PIN(void); #line 154 static __inline void TOSH_CLR_I2C_BUS1_SDA_PIN(void); #line 154 static __inline int TOSH_READ_I2C_BUS1_SDA_PIN(void); #line 154 static __inline void TOSH_MAKE_I2C_BUS1_SDA_OUTPUT(void); #line 154 static __inline void TOSH_MAKE_I2C_BUS1_SDA_INPUT(void); static inline void TOSH_SET_PIN_DIRECTIONS(void ); #line 206 enum __nesc_unnamed4248 { TOSH_ADC_PORTMAPSIZE = 12 }; enum __nesc_unnamed4249 { TOSH_ACTUAL_CC_RSSI_PORT = 0, TOSH_ACTUAL_VOLTAGE_PORT = 7, TOSH_ACTUAL_BANDGAP_PORT = 30, TOSH_ACTUAL_GND_PORT = 31 }; enum __nesc_unnamed4250 { TOS_ADC_CC_RSSI_PORT = 0, TOS_ADC_VOLTAGE_PORT = 7, TOS_ADC_BANDGAP_PORT = 10, TOS_ADC_GND_PORT = 11 }; # 85 "d:/tinyos-1.x/tos/system/dbg.h" typedef long long TOS_dbg_mode; # 80 "d:/tinyos-1.x/tos/system/dbg_modes.h" enum __nesc_unnamed4251 { DBG_ALL = ~0ULL, DBG_BOOT = 1ULL << 0, DBG_CLOCK = 1ULL << 1, DBG_TASK = 1ULL << 2, DBG_SCHED = 1ULL << 3, DBG_SENSOR = 1ULL << 4, DBG_LED = 1ULL << 5, DBG_CRYPTO = 1ULL << 6, DBG_ROUTE = 1ULL << 7, DBG_AM = 1ULL << 8, DBG_CRC = 1ULL << 9, DBG_PACKET = 1ULL << 10, DBG_ENCODE = 1ULL << 11, DBG_RADIO = 1ULL << 12, DBG_LOG = 1ULL << 13, DBG_ADC = 1ULL << 14, DBG_I2C = 1ULL << 15, DBG_UART = 1ULL << 16, DBG_PROG = 1ULL << 17, DBG_SOUNDER = 1ULL << 18, DBG_TIME = 1ULL << 19, DBG_SIM = 1ULL << 21, DBG_QUEUE = 1ULL << 22, DBG_SIMRADIO = 1ULL << 23, DBG_HARD = 1ULL << 24, DBG_MEM = 1ULL << 25, DBG_USR1 = 1ULL << 27, DBG_USR2 = 1ULL << 28, DBG_USR3 = 1ULL << 29, DBG_TEMP = 1ULL << 30, DBG_ERROR = 1ULL << 31, DBG_NONE = 0, DBG_DEFAULT = DBG_ALL }; # 89 "d:/tinyos-1.x/tos/system/sched.c" typedef struct __nesc_unnamed4252 { void (*tp)(void); } TOSH_sched_entry_T; enum __nesc_unnamed4253 { TOSH_MAX_TASKS = 8, TOSH_TASK_BITMASK = TOSH_MAX_TASKS - 1 }; TOSH_sched_entry_T TOSH_queue[TOSH_MAX_TASKS]; volatile uint8_t TOSH_sched_full; volatile uint8_t TOSH_sched_free; static inline void TOSH_interrupt_enable(void ); static inline bool TOSH_interrupt_disable(void ); static inline void TOSH_wait(void ); static inline void TOSH_sleep(void ); static inline void TOSH_sched_init(void ); #line 130 bool TOS_post(void (*tp)(void)); static inline #line 170 bool TOSH_run_next_task(void); static inline #line 189 void TOSH_run_task(void); static # 142 "d:/tinyos-1.x/tos/system/tos.h" void *nmemcpy(void *to, const void *from, size_t n); static inline void *nmemset(void *to, int val, size_t n); # 71 "d:/tinyos-1.x/tos/system/AM.h" enum __nesc_unnamed4254 { TOS_BCAST_ADDR = 0xffff, TOS_UART_ADDR = 0x007e }; enum __nesc_unnamed4255 { TOS_DEFAULT_AM_GROUP = 0x7d }; uint8_t TOS_AM_GROUP = TOS_DEFAULT_AM_GROUP; #line 106 typedef struct TOS_Msg { uint16_t addr; uint8_t type; uint8_t group; uint8_t length; int8_t data[40]; uint16_t crc; uint16_t strength; uint8_t ack; uint16_t time; } TOS_Msg; typedef struct TinySec_Msg { uint16_t addr; uint8_t type; uint8_t length; uint8_t iv[4]; uint8_t enc[40]; uint8_t mac[4]; uint8_t calc_mac[4]; uint8_t ack_byte; bool computeMACDone; bool validMAC; } __attribute((packed)) TinySec_Msg; enum __nesc_unnamed4256 { MSG_DATA_SIZE = (size_t )& ((struct TOS_Msg *)0)->crc + sizeof(uint16_t ), TINYSEC_MSG_DATA_SIZE = (size_t )& ((struct TinySec_Msg *)0)->mac + 4, DATA_LENGTH = 40, LENGTH_BYTE_NUMBER = (size_t )& ((struct TOS_Msg *)0)->length + 1, TINYSEC_LENGTH_BYTE_NUMBER = (size_t )& ((struct TinySec_Msg *)0)->length + 1, TINYSEC_END_OF_IV_BYTE_NUMBER = (size_t )& ((struct TinySec_Msg *)0)->iv + 4, TINYSEC_ENCRYPTED_DATA_BEGIN_BYTE_NUMBER = (size_t )& ((struct TinySec_Msg *)0)->enc + 1 }; typedef TOS_Msg *TOS_MsgPtr; static inline uint8_t TOS_MsgLength(uint8_t type); # 48 "d:/tinyos-1.x/tos/interfaces/SchemaType.h" typedef enum __nesc_unnamed4257 { SCHEMA_SUCCESS = 0, SCHEMA_ERROR, SCHEMA_RESULT_READY, SCHEMA_RESULT_NULL, SCHEMA_RESULT_PENDING } SchemaErrorNo; typedef enum __nesc_unnamed4258 { VOID = 0, INT8 = 1, UINT8 = 2, INT16 = 3, UINT16 = 4, INT32 = 5, UINT32 = 6, TIMESTAMP = 7, STRING = 8, COMPLEX_TYPE = 9 } TOSType; static short sizeOf(TOSType type); static #line 94 short lengthOf(TOSType type, char *data); struct CommandMsg { short nodeid; char fromBase; char data[0]; }; # 59 "d:/tinyos-1.x/tos/interfaces/Attr.h" enum __nesc_unnamed4259 { MAX_ATTRS = 13 + 10, MAX_ATTR_NAME_LEN = 8, MAX_CONST_LEN = 4, MAX_CONST_ATTRS = 1 }; typedef struct __nesc_unnamed4260 { TOSType type; uint8_t nbytes; uint8_t idx; uint8_t id; int8_t constIdx; char name[MAX_ATTR_NAME_LEN + 1]; } AttrDesc; typedef AttrDesc *AttrDescPtr; typedef struct __nesc_unnamed4261 { uint8_t numAttrs; AttrDesc attrDesc[MAX_ATTRS]; } AttrDescs; typedef AttrDescs *AttrDescsPtr; # 65 "d:/tinyos-1.x/tos/lib/TinyDB/DBBuffer.h" typedef enum __nesc_unnamed4262 { EvictOldestPolicy = 0 } BufferPolicy; enum __nesc_unnamed4263 { kRADIO_BUFFER = 0, kEEPROM_START_OFFSET = 2000 }; typedef enum __nesc_unnamed4264 { kRADIO = 0, kRAM = 1, kEEPROM = 2, kCOMMAND = 3, kATTRLIST = 4, kCOMMANDLIST = 5, kEVENTLIST = 6, kQUERYLIST = 7 } BufferType; # 72 "d:/tinyos-1.x/tos/lib/TinyDB/TinyDB.h" typedef enum __nesc_unnamed4265 { err_NoError = 1, err_UnknownError = 0, err_OutOfMemory = 2, err_UnknownAllocationState = 3, err_InvalidGetDataCommand = 4, err_InvalidAggregateRecord = 5, err_NoMoreResults = 6, err_MessageBufferInUse = 7, err_MessageSendFailed = 8, err_RemoveFailedRouterBusy = 9, err_MessageBufferFull = 10, err_MSF_DelMsg = 11, err_MSF_DelMsgBusy = 12, err_MSF_ForwardKnownQuery = 13, err_MSF_ForwardKnownQueryBusy = 14, err_MSF_ForwardNewQuery = 15, err_MSF_ForwardNewQueryBusy = 16, err_MSF_SendWaiting = 17, err_MSF_SendWaitingBusy = 18, err_InvalidIndex = 19, err_UnsupportedPolicy = 20, err_ResultBufferInUse = 21, err_ResultBufferBusy = 22, err_UnknownCommand = 23, err_UnsupportedBuffer = 24, err_IndexOutOfBounds = 25, err_InvalidQueryId = 26, err_AlreadyTupleResult = 27, err_InvalidResultType = 29, err_UnknownAttribute = 30, err_Typecheck = 31, err_NoUnnamedEepromBuffers = 32, err_EepromFailure = 33, err_BufferNotOpen = 34, err_BufferOpenForWriting = 35, err_NoMatchbox = 36 } TinyDBError; #line 123 typedef struct __nesc_unnamed4266 { char qid; char numFields; long notNull; char fields[0]; } Tuple; #line 123 typedef struct __nesc_unnamed4266 * TuplePtr; #line 123 typedef struct __nesc_unnamed4266 ** TupleHandle; enum __nesc_unnamed4267 { #line 133 QUERY_FIELD_SIZE = 8, COMMAND_SIZE = 8, STRING_SIZE = 8 }; typedef struct __nesc_unnamed4268 { char name[QUERY_FIELD_SIZE]; uint8_t op; uint8_t type; } Field; #line 138 typedef struct __nesc_unnamed4268 * FieldPtr; typedef struct __nesc_unnamed4269 { char name[COMMAND_SIZE]; bool hasParam; short param; } CmdBufInfo; typedef struct __nesc_unnamed4270 { bool hasOutput : 1; bool hasInput : 1; bool create : 1; uint16_t numRows : 13; char outBufName[STRING_SIZE]; char inBufName[STRING_SIZE]; BufferPolicy policy; } RamBufInfo; typedef union __nesc_unnamed4271 { CmdBufInfo cmd; RamBufInfo ram; } BufInfo; typedef struct __nesc_unnamed4272 { uint16_t group; char *data; } AggResultRef; enum __nesc_unnamed4273 { kMAX_RESULTS = 4, AGG_DATA_LEN = 28 }; typedef struct QueryResult { char qid; int8_t result_idx; uint16_t epoch; uint8_t qrType; union __nesc_unnamed4274 { Tuple t; char data[AGG_DATA_LEN]; AggResultRef buf[kMAX_RESULTS]; } d; } QueryResult; #line 183 typedef struct QueryResult * #line 200 QueryResultPtr; typedef struct __nesc_unnamed4275 { char *data; } QueryTableInfo; #line 206 typedef struct __nesc_unnamed4275 ** QueryTableHand; typedef struct __nesc_unnamed4276 { uint8_t qid; uint8_t numFields; uint8_t numExprs; uint16_t epochDuration, savedEpochDur; uint16_t numEpochs; uint16_t clocksPerSample; int16_t clockCount; uint16_t currentEpoch; bool running; BufInfo buf; char bufferType; uint8_t bufferId; uint8_t fromCatalogBuffer; uint8_t fromBuffer; uint16_t curResult; uint8_t markedForDeletion; uint16_t queryRoot; uint8_t hasEvent; uint8_t eventId; uint8_t eventCmdId; bool hasForClause; QueryTableHand tableInfo; char queryToSchemaFieldMap[1]; } ParsedQuery; #line 218 typedef struct __nesc_unnamed4276 * #line 250 ParsedQueryPtr; enum __nesc_unnamed4277 { kONE_SHOT = 0x7FFF, NULL_QUERY_FIELD = 0x80, GROUP_FIELD = 0x7F, TYPED_FIELD = 0x7E }; typedef struct __nesc_unnamed4278 { uint8_t qid; uint8_t numFields; uint8_t numExprs; uint8_t fromCatalogBuffer; uint8_t fromBuffer; char bufferType; uint8_t bufferId; short epochDuration; short numEpochs; short knownFields; short knownExprs; uint16_t queryRoot; bool hasBuf; BufInfo buf; bool needsEvent; bool hasEvent; bool hasForClause; char eventName[COMMAND_SIZE]; Field fields[1]; } Query; #line 269 typedef struct __nesc_unnamed4278 * #line 295 QueryPtr; enum __nesc_unnamed4279 { MAX_FIELDS = 16, MAX_EXPRS = 16, kNO_QUERY = 0xFF }; typedef char Op; enum __nesc_unnamed4280 { EQ = 0, NEQ = 1, GT = 2, GE = 3, LT = 4, LE = 5 }; typedef char Agg; enum __nesc_unnamed4281 { FOP_NOOP = 0, FOP_TIMES = 1, FOP_DIVIDE = 2, FOP_ADD = 3, FOP_SUBTRACT = 4, FOP_MOD = 5, FOP_RSHIFT = 6 }; typedef struct __nesc_unnamed4282 { short field; Op op; short value; } OpValExpr; typedef struct __nesc_unnamed4283 { short field; short groupingField; short groupFieldOp; short groupFieldConst; Agg op; } AggregateExpression; typedef struct __nesc_unnamed4284 { AggregateExpression agg; uint8_t args[4]; } TemporalAggExpr; typedef struct __nesc_unnamed4285 { Op op; short field; char s[STRING_SIZE]; } StringExpr; enum __nesc_unnamed4286 { kNO_GROUPING_FIELD = 0xFFFF }; typedef char **OperatorStateHandle; enum __nesc_unnamed4287 { kSEL = 0, kAGG = 1, kTEMP_AGG = 2 }; typedef struct __nesc_unnamed4288 { char opType : 6; bool isStringExp : 1; bool success : 1; char idx; union __nesc_unnamed4289 { OpValExpr opval; AggregateExpression agg; TemporalAggExpr tagg; StringExpr sexp; } ex; short fieldOp; short fieldConst; OperatorStateHandle opState; } Expr; #line 375 typedef struct __nesc_unnamed4288 * #line 391 ExprPtr; enum __nesc_unnamed4290 { kFIRST_RESULT = 0xFF }; enum __nesc_unnamed4291 { kUNDEFINED = 0, kIS_AGG = 1, kNOT_AGG = 2, kAGG_SINGLE_FIELD = 3 }; typedef struct __nesc_unnamed4292 { char qid; bool isAgg; uint16_t epoch; TinyDBError error; union __nesc_unnamed4293 { uint16_t tupleField; struct __nesc_unnamed4294 { int16_t group; uint8_t id; uint8_t len; } agg; } u; char *data; } ResultTuple; enum __nesc_unnamed4295 { kFIELD = 0, kEXPR = 1, kBUF_MSG = 2, kEVENT_MSG = 3, kN_EPOCHS_MSG = 4, kDROP_TABLE_MSG = 5 }; enum __nesc_unnamed4296 { #line 441 ADD_MSG = 0, DEL_MSG = 1, MODIFY_MSG = 2, RATE_MSG = 3, DROP_TABLE_MSG = 5 }; enum __nesc_unnamed4297 { CRC_FAILURE = 1, ACK_FAILURE = 2, SEND_FAILURE = 3, ENQUEUE_FAILURE = 4, SEND_BUSY_FAILURE = 5 }; enum __nesc_unnamed4298 { HIGH_CONTENTION_THRESH = 20, LOW_CONTENTION_THRESH = 10 }; typedef struct QueryMessage { char qid; uint16_t queryRoot; char msgType; char numFields; char numExprs; char fromBuffer; uint8_t fromCatalogBuffer : 1; uint8_t hasEvent : 1; uint8_t hasForClause : 1; uint8_t bufferType : 5; short epochDuration; char type; char idx; uint8_t timeSyncData[5]; int16_t clockCount; union __nesc_unnamed4299 { Field field; Expr expr; BufInfo buf; char eventName[COMMAND_SIZE]; short numEpochs; int8_t ttl; } u; } QueryMessage; #line 463 typedef struct QueryMessage * #line 489 QueryMessagePtr; typedef struct __nesc_unnamed4300 { char qid; } QueryRequestMessage; #line 493 typedef struct __nesc_unnamed4300 * QueryRequestMessagePtr; struct UartMsg { char data[30]; }; struct RTCMsg { uint32_t time_high32; uint32_t time_low32; }; enum __nesc_unnamed4301 { #line 507 kMAX_QUERIES = 8 }; #line 508 typedef struct StatusMessage { bool fromBase; uint8_t numQueries; unsigned char queries[kMAX_QUERIES]; } StatusMessage; typedef bool *BoolPtr; typedef char *CharPtr; enum __nesc_unnamed4302 { kDATA_MESSAGE_ID = 240, kQUERY_MESSAGE_ID = 101, kCOMMAND_MESSAGE_ID = 103, kQUERY_REQUEST_MESSAGE_ID = 104, kEVENT_MESSAGE_ID = 105, kSTATUS_MESSAGE_ID = 106, kMSG_LEN = DATA_LENGTH, AM_QUERYRESULT = kDATA_MESSAGE_ID, AM_QUERYMESSAGE = kQUERY_MESSAGE_ID, AM_STATUSMESSAGE = kSTATUS_MESSAGE_ID, AM_UARTMSG = 1, AM_RTCMSG = 107 }; enum __nesc_unnamed4303 { kTINYDB_SERVICE_ID = 0 }; typedef struct __nesc_unnamed4304 { short senderid; short parentid; uint8_t level; unsigned char timeRemaining; uint8_t idx; } DbMsgHdr; typedef struct NetworkMessage { DbMsgHdr hdr; char data[0]; } NetworkMessage; # 43 "d:/avrgcc/lib/gcc-lib/avr/3.3/include/stdarg.h" typedef __builtin_va_list __gnuc_va_list; # 105 "d:/avrgcc/lib/gcc-lib/avr/3.3/include/stdarg.h" 3 typedef __gnuc_va_list va_list; # 53 "d:/tinyos-1.x/tos/interfaces/Params.h" enum __nesc_unnamed4305 { MAX_PARAMS = 4 }; typedef struct __nesc_unnamed4306 { uint8_t numParams; TOSType params[MAX_PARAMS]; } ParamList; typedef struct __nesc_unnamed4307 { uint8_t numParams; char *paramDataPtr[MAX_PARAMS]; } ParamVals; static void setParamList(ParamList *params, uint8_t nargs, ...); # 50 "d:/tinyos-1.x/tos/interfaces/Command.h" enum __nesc_unnamed4308 { MAX_COMMANDS = 8, MAX_CMD_NAME_LEN = 8 }; enum __nesc_unnamed4309 { AM_COMMANDMSG = 103 }; typedef struct __nesc_unnamed4310 { uint8_t idx; char name[MAX_CMD_NAME_LEN + 1]; uint8_t id; TOSType retType; uint8_t retLen; ParamList params; } CommandDesc; typedef CommandDesc *CommandDescPtr; typedef struct __nesc_unnamed4311 { uint8_t numCmds; CommandDesc commandDesc[MAX_COMMANDS]; } CommandDescs; typedef CommandDescs *CommandDescsPtr; # 69 "d:/tinyos-1.x/tos/interfaces/Timer.h" enum __nesc_unnamed4312 { TIMER_REPEAT = 0, TIMER_ONE_SHOT = 1, NUM_TIMERS = 7 }; # 1 "d:/tinyos-1.x/tos/platform/avrmote/crc.h" uint16_t __attribute((__progmem__)) crcTable[256] = { 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0 }; static inline uint16_t crcByte(uint16_t oldCrc, uint8_t byte); # 65 "d:/tinyos-1.x/tos/interfaces/ADC.h" enum __nesc_unnamed4313 { TOS_ADCSample3750ns = 0, TOS_ADCSample7500ns = 1, TOS_ADCSample15us = 2, TOS_ADCSample30us = 3, TOS_ADCSample60us = 4, TOS_ADCSample120us = 5, TOS_ADCSample240us = 6, TOS_ADCSample480us = 7 }; # 68 "d:/tinyos-1.x/tos/sensorboards/micasb/sensorboard.h" enum __nesc_unnamed4314 { 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_unnamed4315 { 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_unnamed4316 { TOS_MAG_POT_ADDR = 0, TOS_MIC_POT_ADDR = 1 }; static __inline void TOSH_SET_PHOTO_CTL_PIN(void); #line 94 static __inline void TOSH_CLR_PHOTO_CTL_PIN(void); #line 94 static __inline void TOSH_MAKE_PHOTO_CTL_OUTPUT(void); #line 94 static __inline void TOSH_MAKE_PHOTO_CTL_INPUT(void); static __inline void TOSH_SET_TEMP_CTL_PIN(void); #line 95 static __inline void TOSH_CLR_TEMP_CTL_PIN(void); #line 95 static __inline void TOSH_MAKE_TEMP_CTL_OUTPUT(void); #line 95 static __inline void TOSH_MAKE_TEMP_CTL_INPUT(void); static __inline char TOSH_READ_TONE_DECODE_SIGNAL_PIN(void); #line 96 static __inline void TOSH_MAKE_TONE_DECODE_SIGNAL_INPUT(void); static __inline void TOSH_SET_MIC_CTL_PIN(void); #line 97 static __inline void TOSH_CLR_MIC_CTL_PIN(void); #line 97 static __inline void TOSH_MAKE_MIC_CTL_OUTPUT(void); static __inline void TOSH_SET_SOUNDER_CTL_PIN(void); #line 98 static __inline void TOSH_CLR_SOUNDER_CTL_PIN(void); #line 98 static __inline void TOSH_MAKE_SOUNDER_CTL_OUTPUT(void); static __inline void TOSH_SET_ACCEL_CTL_PIN(void); #line 99 static __inline void TOSH_CLR_ACCEL_CTL_PIN(void); #line 99 static __inline void TOSH_MAKE_ACCEL_CTL_OUTPUT(void); static __inline void TOSH_SET_MIC_MUX_SEL_PIN(void); #line 101 static __inline void TOSH_CLR_MIC_MUX_SEL_PIN(void); #line 101 static __inline void TOSH_MAKE_MIC_MUX_SEL_OUTPUT(void); # 3 "d:/tinyos-1.x/tos/interfaces/TosTime.h" typedef struct __nesc_unnamed4317 { uint32_t high32; uint32_t low32; } tos_time_t; # 63 "d:/tinyos-1.x/tos/platform/mica128/Clock.h" enum __nesc_unnamed4318 { TOS_I1000PS = 32, TOS_S1000PS = 1, TOS_I100PS = 40, TOS_S100PS = 2, TOS_I10PS = 101, TOS_S10PS = 3, 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_unnamed4319 { DEFAULT_SCALE = 3, DEFAULT_INTERVAL = 127 }; # 2 "d:/tinyos-1.x/tos/interfaces/AbsoluteTimer.h" enum __nesc_unnamed4320 { MAX_NUM_TIMERS = 2 }; # 67 "d:/tinyos-1.x/tos/interfaces/MemAlloc.h" typedef int8_t **Handle; typedef Handle *HandlePtr; # 44 "d:/tinyos-1.x/tos/interfaces/TosServiceSchedule.h" typedef struct __nesc_unnamed4321 { tos_time_t start_time; int16_t on_time; int16_t off_time; uint8_t flags; } tos_service_schedule; enum __nesc_unnamed4322 { DISABLED = 0x00, ENABLED = 0x40, STOP = 0x10, START = 0x20 }; static inline # 45 "d:/tinyos-1.x/tos/lib/Reset.h" void resetMote(void); # 6 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/Aggregates.h" enum __nesc_unnamed4323 { kMAX_SHORT = 0x7FFF, kMIN_SHORT = 0x8000 }; typedef enum __nesc_unnamed4324 { kNOOP = 0, kSUM = 1, kMIN = 2, kMAX = 3, kCOUNT = 4, kAVG = 5, kEXP_AVG = 6, kWIN_AVG = 7, kWIN_SUM = 8, kWIN_MIN = 9, kWIN_MAX = 10, kWIN_COUNT = 11, kDELTA = 12, kTREND = 13, kWIN_RAND = 14, kADP_DELTA = 15 } AggregateID; typedef struct __nesc_unnamed4325 { int16_t value; int16_t id; } AlgebraicData; typedef struct __nesc_unnamed4326 { AlgebraicData lastResult; uint8_t head; uint8_t tail; uint8_t size; uint8_t nvals; uint8_t epochsLeft; uint8_t value[1]; } TemporalAlgebraicData; typedef struct __nesc_unnamed4327 { int16_t sum; uint16_t count; } AverageData; typedef struct __nesc_unnamed4328 { int16_t value; uint16_t epoch; uint8_t curInd; } AdpDeltaData; typedef struct __nesc_unnamed4329 { int16_t value; uint16_t epoch; } AdpAggData; typedef struct __nesc_unnamed4330 { AdpDeltaData lastResult; uint8_t head; uint8_t tail; uint8_t size; uint8_t nvals; uint8_t epochsLeft; AdpAggData value[1]; } TemporalAdpDeltaData; #line 96 typedef enum __nesc_unnamed4331 { kEXEMPLARY_PROPERTY = 0x1, kMONOTONIC_PROPERTY = 0x2, kDUPLICATE_INSENSITIVE_PROPERTY = 0x4 } AggregateProperties; static #line 115 void setParamValues(ParamVals *v, Expr *e); #line 127 typedef enum __nesc_unnamed4332 { kEPOCHS_PER_WINDOW = 0, kNEW_BITS_PER_SAMPLE = 0, kSLIDING_DIST = 1, kTREND_THRESHOLD = 1, kCONTENTION_THRESHOLD = 1, kDELTA_THRESHOLD = 2, kCURRENT_EPOCH = 2 } ParamIndex; static inline uint8_t getEpochsPerWindow(ParamVals *v); static inline uint8_t getSlidingDist(ParamVals *v); static inline #line 157 uint8_t getNewBitsPerSample(ParamVals *v); static inline #line 175 void setCurrentEpoch(ParamVals *v, uint16_t curEpoch); static #line 187 void addValueToTemporalAggState(TemporalAlgebraicData *tad, short value); # 31 "d:/tinyos-1.x/tos/interfaces/pqueue.h" typedef int8_t pq_element; typedef struct __nesc_unnamed4333 { char (*compare)(pq_element , pq_element ); uint8_t size; uint8_t n_elements; pq_element heap[0]; } pqueue_t; static inline void pqueue_init(pqueue_t *pq, uint8_t size, char (*compare)(pq_element , pq_element )); static result_t pqueue_enqueue(pqueue_t *pq, pq_element e); static #line 62 pq_element pqueue_dequeue_idx(pqueue_t *pq, int8_t i); static inline #line 87 pq_element pqueue_dequeue(pqueue_t *pq); static pq_element pqueue_remove(pqueue_t *pq, pq_element e); static inline pq_element pqueue_peek(pqueue_t *pq); static uint8_t PotM$Pot$get(void); static result_t PotM$Pot$init(uint8_t arg_0xa2a50c8); static result_t PotM$Pot$set(uint8_t arg_0xa2a5618); static result_t HPLPotC$Pot$finalise(void); static result_t HPLPotC$Pot$decrease(void); static result_t HPLPotC$Pot$increase(void); static result_t HPLInit$init(void); static bool HPLInterrupt$Interrupt$disable(void); static result_t HPLInterrupt$Interrupt$enable(void); static result_t NetworkM$QueryProcessor$queryComplete(ParsedQueryPtr arg_0xa30f3e0); static TOS_MsgPtr NetworkM$RcvQueryMsg$receive(TOS_MsgPtr arg_0xa33a580); static result_t NetworkM$SchemaMsg$sendDone(TOS_MsgPtr arg_0xa3320a0, result_t arg_0xa3321e8); static QueryResultPtr NetworkM$Network$getDataPayLoad(TOS_MsgPtr arg_0xa317de8); static QueryMessagePtr NetworkM$Network$getQueryPayLoad(TOS_MsgPtr arg_0xa3201c8); static QueryRequestMessagePtr NetworkM$Network$getQueryRequestPayLoad(TOS_MsgPtr arg_0xa31af88); static TinyDBError NetworkM$Network$sendQueryRequest(TOS_MsgPtr arg_0xa31b588, uint16_t arg_0xa31b6d0); static TinyDBError NetworkM$Network$sendQueryMessage(TOS_MsgPtr arg_0xa3207b8); static TinyDBError NetworkM$Network$sendDataMessage(TOS_MsgPtr arg_0xa31a4f0); static result_t NetworkM$SendStatusMessage$sendDone(TOS_MsgPtr arg_0xa3320a0, result_t arg_0xa3321e8); static TOS_MsgPtr NetworkM$RcvCommandMsg$receive(TOS_MsgPtr arg_0xa33a580); static result_t NetworkM$SendQueryRequest$sendDone(TOS_MsgPtr arg_0xa3320a0, result_t arg_0xa3321e8); static void NetworkM$NetworkMonitor$updateContention(bool arg_0xa326c90, int arg_0xa326dc8); static uint8_t NetworkM$NetworkMonitor$getMHopQueueLength(void); static uint8_t NetworkM$NetworkMonitor$getDepth(void); static uint8_t NetworkM$NetworkMonitor$getQuality(void); static uint16_t NetworkM$NetworkMonitor$getParent(void); static uint8_t NetworkM$NetworkMonitor$getQueueLength(void); static TOS_MsgPtr NetworkM$RcvRequestMsg$receive(TOS_MsgPtr arg_0xa33a580); static result_t NetworkM$SendDataMsg$sendDone(TOS_MsgPtr arg_0xa3320a0, result_t arg_0xa3321e8); static result_t NetworkM$SendQueryMsg$sendDone(TOS_MsgPtr arg_0xa3320a0, result_t arg_0xa3321e8); static TOS_MsgPtr NetworkM$RcvStatusMessage$receive(TOS_MsgPtr arg_0xa33a580); static TOS_MsgPtr NetworkM$RcvDataMsg$receive(TOS_MsgPtr arg_0xa33a580); static result_t NetworkM$StdControl$init(void); static result_t NetworkM$StdControl$start(void); static result_t NetworkM$StdControl$stop(void); static result_t NetworkM$DebugMsg$sendDone(TOS_MsgPtr arg_0xa3320a0, result_t arg_0xa3321e8); static TOS_MsgPtr AMStandard$ReceiveMsg$default$receive(uint8_t arg_0xa3e52e0, TOS_MsgPtr arg_0xa33a580); static result_t AMStandard$ActivityTimer$fired(void); static result_t AMStandard$UARTSend$sendDone(TOS_MsgPtr arg_0xa3e1248, result_t arg_0xa3e1390); static TOS_MsgPtr AMStandard$RadioReceive$receive(TOS_MsgPtr arg_0xa33a580); static result_t AMStandard$Control$init(void); static result_t AMStandard$Control$start(void); static result_t AMStandard$Control$stop(void); static result_t AMStandard$default$sendDone(void); static result_t AMStandard$RadioSend$sendDone(TOS_MsgPtr arg_0xa3e1248, result_t arg_0xa3e1390); static result_t AMStandard$SendMsg$send(uint8_t arg_0xa3e4d48, uint16_t arg_0xa32f9f0, uint8_t arg_0xa32fb30, TOS_MsgPtr arg_0xa32fc78); static result_t AMStandard$SendMsg$default$sendDone(uint8_t arg_0xa3e4d48, TOS_MsgPtr arg_0xa3320a0, result_t arg_0xa3321e8); static TOS_MsgPtr AMStandard$UARTReceive$receive(TOS_MsgPtr arg_0xa33a580); static result_t CC1000RadioIntM$Send$send(TOS_MsgPtr arg_0xa3e0d40); static result_t CC1000RadioIntM$SpiByteFifo$dataReady(uint8_t arg_0xa43e690); static result_t CC1000RadioIntM$WakeupTimer$fired(void); static result_t CC1000RadioIntM$StdControl$init(void); static result_t CC1000RadioIntM$StdControl$start(void); static result_t CC1000RadioIntM$StdControl$stop(void); static result_t CC1000RadioIntM$RSSIADC$dataReady(uint16_t arg_0xa445aa0); static result_t CC1000ControlM$CC1000Control$Tune(uint8_t arg_0xa40f078); static bool CC1000ControlM$CC1000Control$GetLOStatus(void); static result_t CC1000ControlM$CC1000Control$RxMode(void); static result_t CC1000ControlM$CC1000Control$BIASOn(void); static result_t CC1000ControlM$CC1000Control$TxMode(void); static result_t CC1000ControlM$CC1000Control$SelectLock(uint8_t arg_0xa408d10); static result_t CC1000ControlM$StdControl$init(void); static result_t CC1000ControlM$StdControl$start(void); static result_t CC1000ControlM$StdControl$stop(void); static result_t HPLCC1000M$HPLCC1000$init(void); static uint8_t HPLCC1000M$HPLCC1000$read(uint8_t arg_0xa48b498); static result_t HPLCC1000M$HPLCC1000$write(uint8_t arg_0xa48af10, uint8_t arg_0xa48b050); static uint16_t RandomLFSR$Random$rand(void); static result_t RandomLFSR$Random$init(void); static result_t ADCM$HPLADC$dataReady(uint16_t arg_0xa4d8630); static result_t ADCM$ADCControl$bindPort(uint8_t arg_0xa41fbc0, uint8_t arg_0xa41fd00); static result_t ADCM$ADCControl$init(void); static result_t ADCM$ADC$getData(uint8_t arg_0xa4c97b8); static result_t ADCM$ADC$default$dataReady(uint8_t arg_0xa4c97b8, uint16_t arg_0xa445aa0); static result_t HPLADCM$ADC$bindPort(uint8_t arg_0xa4c74d8, uint8_t arg_0xa4c7618); static result_t HPLADCM$ADC$init(void); static result_t HPLADCM$ADC$samplePort(uint8_t arg_0xa4c7af0); static result_t HPLSpiM$SpiByteFifo$initSlave(void); static result_t HPLSpiM$SpiByteFifo$disableIntr(void); static result_t HPLSpiM$SpiByteFifo$writeByte(uint8_t arg_0xa42ef08); static result_t HPLSpiM$SpiByteFifo$enableIntr(void); static result_t HPLSpiM$SpiByteFifo$txMode(void); static result_t HPLSpiM$SpiByteFifo$rxMode(void); static void HPLClock$Clock$setCounter(uint8_t arg_0xa50c9a8); static void HPLClock$Clock$setInterval(uint8_t arg_0xa50ed68); static uint8_t HPLClock$Clock$readCounter(void); static result_t HPLClock$Clock$setRate(char arg_0xa50e280, char arg_0xa50e3b8); static uint8_t HPLClock$Clock$getInterval(void); static result_t HPLClock$StdControl$init(void); static result_t HPLClock$StdControl$start(void); static result_t LogicalTimeM$AbsoluteTimer$default$fired(uint8_t arg_0xa535210); static result_t LogicalTimeM$AbsoluteTimer$cancel(uint8_t arg_0xa535210); static result_t LogicalTimeM$AbsoluteTimer$set(uint8_t arg_0xa535210, tos_time_t arg_0xa4fed40); static void LogicalTimeM$TimeSet$set(tos_time_t arg_0xa4fc1e8); static uint32_t LogicalTimeM$Time$getHigh32(void); static tos_time_t LogicalTimeM$Time$get(void); static uint32_t LogicalTimeM$Time$getLow32(void); static result_t LogicalTimeM$Clock$fire(void); static result_t LogicalTimeM$StdControl$init(void); static result_t LogicalTimeM$StdControl$start(void); static result_t LogicalTimeM$Timer$default$fired(uint8_t arg_0xa534bd0); static result_t LogicalTimeM$Timer$start(uint8_t arg_0xa534bd0, char arg_0xa3f1240, uint32_t arg_0xa3f1390); static result_t LogicalTimeM$Timer$stop(uint8_t arg_0xa534bd0); static tos_time_t TimeUtilC$TimeUtil$addint32(tos_time_t arg_0xa4fa010, int32_t arg_0xa4fa150); static tos_time_t TimeUtilC$TimeUtil$addUint32(tos_time_t arg_0xa4fa690, uint32_t arg_0xa4fa7d8); static tos_time_t TimeUtilC$TimeUtil$subtract(tos_time_t arg_0xa4fbf30, tos_time_t arg_0xa5160a0); static char TimeUtilC$TimeUtil$compare(tos_time_t arg_0xa4fb3b8, tos_time_t arg_0xa4fb500); static uint8_t HPLPowerManagementM$PowerManagement$adjustPower(void); static result_t NoCRCPacket$Send$send(TOS_MsgPtr arg_0xa3e0d40); static result_t NoCRCPacket$SendVarLenPacket$default$sendDone(uint8_t *arg_0xa3e21b8, result_t arg_0xa3e2300); static result_t NoCRCPacket$ByteComm$txDone(void); static result_t NoCRCPacket$ByteComm$txByteReady(bool arg_0xa5a66f0); static result_t NoCRCPacket$ByteComm$rxByteReady(uint8_t arg_0xa58df30, bool arg_0xa5a6080, uint16_t arg_0xa5a61d0); static result_t NoCRCPacket$Control$init(void); static result_t NoCRCPacket$Control$start(void); static result_t NoCRCPacket$Control$stop(void); static result_t NoCRCPacket$txBytes(uint8_t *arg_0xa58c9a8, uint8_t arg_0xa58caf0); static result_t UARTM$HPLUART$get(uint8_t arg_0xa5c8400); static result_t UARTM$HPLUART$putDone(void); static result_t UARTM$ByteComm$txByte(uint8_t arg_0xa58dab0); static result_t UARTM$Control$init(void); static result_t UARTM$Control$start(void); static result_t UARTM$Control$stop(void); static result_t HPLUART0M$UART$init(void); static result_t HPLUART0M$UART$put(uint8_t arg_0xa5afea8); static result_t HPLUART0M$UART$stop(void); static result_t LedsC$Leds$yellowOff(void); static result_t LedsC$Leds$yellowOn(void); static result_t LedsC$Leds$init(void); static result_t LedsC$Leds$greenOff(void); static result_t LedsC$Leds$redOff(void); static result_t LedsC$Leds$greenToggle(void); static result_t LedsC$Leds$yellowToggle(void); static result_t LedsC$Leds$redToggle(void); static result_t LedsC$Leds$set(uint8_t arg_0xa352fa8); static result_t LedsC$Leds$redOn(void); static result_t LedsC$Leds$greenOn(void); static result_t TupleRouterM$AbsoluteTimer$fired(void); static short TupleRouterM$QueryProcessor$msgToQueryRoot(TOS_Msg *arg_0xa30fd10); static ParsedQueryPtr TupleRouterM$QueryProcessor$getQueryCmd(uint8_t arg_0xa30f818); static short TupleRouterM$QueryProcessor$numQueries(void); static ParsedQueryPtr TupleRouterM$QueryProcessor$getQueryIdx(short arg_0xa2ec580); static TinyDBError TupleRouterM$SelOperator$processedTuple(TuplePtr arg_0xa60d0b0, ParsedQueryPtr arg_0xa60d1f8, ExprPtr arg_0xa60d338, bool arg_0xa60d478); static result_t TupleRouterM$Network$sendDataDone(TOS_MsgPtr arg_0xa31a970, result_t arg_0xa31aab8); static result_t TupleRouterM$Network$sendQueryRequestDone(TOS_MsgPtr arg_0xa31bb98, result_t arg_0xa31bce0); static result_t TupleRouterM$Network$sendQueryDone(TOS_MsgPtr arg_0xa320c78, result_t arg_0xa320dc0); static result_t TupleRouterM$Network$queryRequestSub(QueryRequestMessagePtr arg_0xa328490); static result_t TupleRouterM$Network$dataSub(QueryResultPtr arg_0xa321278); static result_t TupleRouterM$Network$snoopedSub(QueryResultPtr arg_0xa321c40, bool arg_0xa321d88, uint16_t arg_0xa321ed8); static result_t TupleRouterM$Network$querySub(QueryMessagePtr arg_0xa321760); static result_t TupleRouterM$Table$addNamedFieldDone(result_t arg_0xa63b9e0); static void TupleRouterM$signalError(TinyDBError arg_0xa63dd58, int arg_0xa63de90); static void TupleRouterM$statusMessage(CharPtr arg_0xa6382d8); static result_t TupleRouterM$AttrUse$getAttrDone(char *arg_0xa5e2828, char *arg_0xa5e2980, SchemaErrorNo arg_0xa5e2ac8); static result_t TupleRouterM$AttrUse$startAttrDone(uint8_t arg_0xa5e3448); static TinyDBError TupleRouterM$RadioQueue$enqueue(const QueryResultPtr arg_0xa63cfd0, bool *arg_0xa63d128); static void TupleRouterM$RadioReceiveCoordinator$byte(TOS_MsgPtr arg_0xa42c780, uint8_t arg_0xa42c8c8); static void TupleRouterM$RadioReceiveCoordinator$startSymbol(void); static TinyDBError TupleRouterM$AggOperator$processedTuple(TuplePtr arg_0xa60d0b0, ParsedQueryPtr arg_0xa60d1f8, ExprPtr arg_0xa60d338, bool arg_0xa60d478); static TinyDBError TupleRouterM$AggOperator$processedResult(QueryResultPtr arg_0xa60c9d0, ParsedQueryPtr arg_0xa60cb18, ExprPtr arg_0xa60cc58); static result_t TupleRouterM$DBBuffer$putComplete(uint8_t arg_0xa61c0f0, QueryResult *arg_0xa61c250, TinyDBError arg_0xa61c398); static result_t TupleRouterM$DBBuffer$getComplete(uint8_t arg_0xa63f9f8, QueryResult *arg_0xa63fb58, TinyDBError arg_0xa63fca0); static result_t TupleRouterM$DBBuffer$allocComplete(uint8_t arg_0xa63f468, TinyDBError arg_0xa63f5b0); static result_t TupleRouterM$MemAlloc$compactComplete(void); static result_t TupleRouterM$MemAlloc$reallocComplete(Handle arg_0xa624f58, result_t arg_0xa6250a0); static result_t TupleRouterM$MemAlloc$allocComplete(HandlePtr arg_0xa624908, result_t arg_0xa624a50); static void TupleRouterM$RadioSendCoordinator$byte(TOS_MsgPtr arg_0xa42c780, uint8_t arg_0xa42c8c8); static void TupleRouterM$RadioSendCoordinator$startSymbol(void); static result_t TupleRouterM$StdControl$init(void); static result_t TupleRouterM$StdControl$start(void); static result_t TupleRouterM$StdControl$stop(void); static CommandDescPtr Command$CommandUse$getCommandById(uint8_t arg_0xa3400a0); static result_t Command$CommandUse$invokeBuffer(char *arg_0xa34c7e8, char *arg_0xa34c940, SchemaErrorNo *arg_0xa34caa0); static result_t Command$CommandUse$invoke(char *arg_0xa340b70, char *arg_0xa340cc8, SchemaErrorNo *arg_0xa340e28, ParamVals *arg_0xa340f88); static CommandDescPtr Command$CommandUse$getCommand(char *arg_0xa345b78); static result_t Command$CommandUse$invokeMsg(TOS_MsgPtr arg_0xa341e10, char *arg_0xa34c010, SchemaErrorNo *arg_0xa34c170); static result_t Command$Cmd$default$commandFunc(uint8_t arg_0xa77e7b0, char *arg_0xa778010, char *arg_0xa778168, SchemaErrorNo *arg_0xa7782c8, ParamVals *arg_0xa778428); static result_t Command$Cmd$registerCommand(uint8_t arg_0xa77e7b0, char *arg_0xa77f610, TOSType arg_0xa77f750, uint8_t arg_0xa77f890, ParamList *arg_0xa77f9f8); static result_t CommandResetM$ResetCmd$commandFunc(char *arg_0xa778010, char *arg_0xa778168, SchemaErrorNo *arg_0xa7782c8, ParamVals *arg_0xa778428); static result_t CommandResetM$StdControl$init(void); static result_t CommandResetM$StdControl$start(void); static result_t CommandResetM$StdControl$stop(void); static void ResetC$Reset$reset(void); static result_t CommandSounderM$SetSound$commandFunc(char *arg_0xa778010, char *arg_0xa778168, SchemaErrorNo *arg_0xa7782c8, ParamVals *arg_0xa778428); static result_t CommandSounderM$Clock1$fired(void); static result_t CommandSounderM$StdControl$init(void); static result_t CommandSounderM$StdControl$start(void); static result_t CommandSounderM$StdControl$stop(void); static result_t SounderM$StdControl$init(void); static result_t SounderM$StdControl$start(void); static result_t SounderM$StdControl$stop(void); static result_t CommandPotM$StdControl$init(void); static result_t CommandPotM$StdControl$start(void); static result_t CommandPotM$StdControl$stop(void); static result_t CommandPotM$SetPot$commandFunc(char *arg_0xa778010, char *arg_0xa778168, SchemaErrorNo *arg_0xa7782c8, ParamVals *arg_0xa778428); static result_t CommandLedsM$YellowLedCmd$commandFunc(char *arg_0xa778010, char *arg_0xa778168, SchemaErrorNo *arg_0xa7782c8, ParamVals *arg_0xa778428); static result_t CommandLedsM$GreenLedCmd$commandFunc(char *arg_0xa778010, char *arg_0xa778168, SchemaErrorNo *arg_0xa7782c8, ParamVals *arg_0xa778428); static result_t CommandLedsM$RedLedCmd$commandFunc(char *arg_0xa778010, char *arg_0xa778168, SchemaErrorNo *arg_0xa7782c8, ParamVals *arg_0xa778428); static result_t CommandLedsM$StdControl$init(void); static result_t CommandLedsM$StdControl$start(void); static result_t CommandLedsM$StdControl$stop(void); static result_t CommandAttrM$CommandRegister$commandFunc(char *arg_0xa778010, char *arg_0xa778168, SchemaErrorNo *arg_0xa7782c8, ParamVals *arg_0xa778428); static result_t CommandAttrM$StdControl$init(void); static result_t CommandAttrM$StdControl$start(void); static result_t CommandAttrM$StdControl$stop(void); static result_t Attr$Attr$registerAttr(uint8_t arg_0xa7eac68, char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68); static result_t Attr$Attr$getAttrDone(uint8_t arg_0xa7eac68, char *arg_0xa7e5138, char *arg_0xa7e5290, SchemaErrorNo arg_0xa7e53d8); static result_t Attr$Attr$startAttrDone(uint8_t arg_0xa7eac68); static result_t Attr$Attr$default$getAttr(uint8_t arg_0xa7eac68, char *arg_0xa7e42f0, char *arg_0xa7e4448, SchemaErrorNo *arg_0xa7e45a8); static result_t Attr$Attr$default$startAttr(uint8_t arg_0xa7eac68); static result_t Attr$ConstAttr$registerAttr(char *arg_0xa7c5ee0, TOSType arg_0xa7ec060, char *arg_0xa7ec1b0); static AttrDescPtr Attr$AttrUse$getAttrById(uint8_t arg_0xa5e4d58); static uint8_t Attr$AttrUse$numAttrs(void); static AttrDescPtr Attr$AttrUse$getAttr(char *arg_0xa5e4850); static result_t Attr$AttrUse$getAttrValue(char *arg_0xa5e5928, char *arg_0xa5e5a80, SchemaErrorNo *arg_0xa5e5be0); static result_t Attr$AttrUse$startAttr(uint8_t arg_0xa5e2ff0); static result_t Tuple$QueryProcessor$queryComplete(ParsedQueryPtr arg_0xa30f3e0); static result_t Tuple$TupleIntf$setFieldNoQuery(TuplePtr arg_0xa5fe160, uint8_t arg_0xa5fe2b8, uint8_t arg_0xa5fe410, uint8_t arg_0xa5fe580[], uint8_t arg_0xa5fe6f0[], CharPtr arg_0xa5fe840); static CharPtr Tuple$TupleIntf$getFieldPtrNoQuery(TuplePtr arg_0xa5ff718, uint8_t arg_0xa5ff870, uint8_t arg_0xa5ff9c8, uint8_t arg_0xa5ffb38[], uint8_t arg_0xa5ffca8[]); static TinyDBError Tuple$TupleIntf$getNextEmptyFieldIdx(ParsedQueryPtr arg_0xa5fd7a0, TuplePtr arg_0xa5fd8e8, uint8_t *arg_0xa5fda48); static AttrDescPtr Tuple$TupleIntf$getNextQueryField(ParsedQueryPtr arg_0xa5fd1c8, TuplePtr arg_0xa5fd310); static CharPtr Tuple$TupleIntf$getFieldPtr(ParsedQueryPtr arg_0xa5fef10, TuplePtr arg_0xa5ff058, uint8_t arg_0xa5ff1a0); static result_t Tuple$TupleIntf$tupleInit(ParsedQueryPtr arg_0xa5fc650, TuplePtr arg_0xa5fc798); static result_t Tuple$TupleIntf$setField(ParsedQueryPtr arg_0xa605740, TuplePtr arg_0xa605888, uint8_t arg_0xa6059d0, CharPtr arg_0xa605b10); static uint16_t Tuple$TupleIntf$fieldSize(ParsedQueryPtr arg_0xa605180, uint8_t arg_0xa6052c0); static uint16_t Tuple$TupleIntf$tupleSize(ParsedQueryPtr arg_0xa604d30); static result_t Tuple$Table$addNamedFieldDone(result_t arg_0xa63b9e0); static result_t Tuple$AttrUse$getAttrDone(char *arg_0xa5e2828, char *arg_0xa5e2980, SchemaErrorNo arg_0xa5e2ac8); static result_t Tuple$AttrUse$startAttrDone(uint8_t arg_0xa5e3448); static result_t Tuple$DBBuffer$putComplete(uint8_t arg_0xa61c0f0, QueryResult *arg_0xa61c250, TinyDBError arg_0xa61c398); static result_t Tuple$DBBuffer$getComplete(uint8_t arg_0xa63f9f8, QueryResult *arg_0xa63fb58, TinyDBError arg_0xa63fca0); static result_t Tuple$DBBuffer$allocComplete(uint8_t arg_0xa63f468, TinyDBError arg_0xa63f5b0); static Field Query$QueryIntf$getField(QueryPtr arg_0xa5e7958, uint8_t arg_0xa5e7a98); static short Query$QueryIntf$size(QueryPtr arg_0xa5e7528); static result_t Query$QueryIntf$setExpr(QueryPtr arg_0xa5fb110, uint8_t arg_0xa5fb250, Expr arg_0xa5fb390); static Field *Query$QueryIntf$getFieldPtr(QueryPtr arg_0xa5e7ec8, uint8_t arg_0xa5fa030); static bool Query$QueryIntf$fieldsComplete(Query arg_0xa5fb840); static result_t Query$QueryIntf$setField(QueryPtr arg_0xa5fa488, uint8_t arg_0xa5fa5c8, Field arg_0xa5fa708); static bool Query$QueryIntf$exprsComplete(Query arg_0xa5fbc70); static Expr Query$QueryIntf$getExpr(QueryPtr arg_0xa5faba0, uint8_t arg_0xa5face0); static result_t ParsedQuery$Table$addNamedFieldDone(result_t arg_0xa63b9e0); static result_t ParsedQuery$AttrUse$getAttrDone(char *arg_0xa5e2828, char *arg_0xa5e2980, SchemaErrorNo arg_0xa5e2ac8); static result_t ParsedQuery$AttrUse$startAttrDone(uint8_t arg_0xa5e3448); static bool ParsedQuery$ParsedQueryIntf$queryFieldIsTyped(uint8_t arg_0xa601948); static bool ParsedQuery$ParsedQueryIntf$queryFieldIsNull(uint8_t arg_0xa601520); static short ParsedQuery$ParsedQueryIntf$pqSize(ParsedQueryPtr arg_0xa5f7da8); static result_t ParsedQuery$ParsedQueryIntf$getFieldType(ParsedQuery *arg_0xa610388, uint8_t arg_0xa6104d0, uint8_t *arg_0xa610638); static short ParsedQuery$ParsedQueryIntf$baseSize(QueryPtr arg_0xa5f7930); static TinyDBError ParsedQuery$ParsedQueryIntf$getResultField(ParsedQueryPtr arg_0xa612860, QueryResultPtr arg_0xa6129a8, uint8_t arg_0xa612af0, char *arg_0xa612c48); static TinyDBError ParsedQuery$ParsedQueryIntf$getResultId(ParsedQueryPtr arg_0xa613320, Field *arg_0xa613478, uint8_t *arg_0xa6135d0); static uint8_t ParsedQuery$ParsedQueryIntf$getFieldId(ParsedQueryPtr arg_0xa5f68c8, uint8_t arg_0xa5f6a08); static result_t ParsedQuery$ParsedQueryIntf$setExpr(ParsedQueryPtr arg_0xa5f6e38, uint8_t arg_0xa5f6f78, Expr arg_0xa5f70b8); static ExprPtr ParsedQuery$ParsedQueryIntf$getExprPtr(ParsedQueryPtr arg_0xa5f6348, uint8_t arg_0xa5f6488); static TuplePtr ParsedQuery$ParsedQueryIntf$getTuplePtr(ParsedQueryPtr arg_0xa5f74f8); static bool ParsedQuery$ParsedQueryIntf$typeCheck(ParsedQuery *arg_0xa613b80, ParsedQuery *arg_0xa613ce0); static Expr ParsedQuery$ParsedQueryIntf$getExpr(ParsedQueryPtr arg_0xa601da8, uint8_t arg_0xa601ee8); static TinyDBError ParsedQuery$AggOperator$processedTuple(TuplePtr arg_0xa60d0b0, ParsedQueryPtr arg_0xa60d1f8, ExprPtr arg_0xa60d338, bool arg_0xa60d478); static TinyDBError ParsedQuery$AggOperator$processedResult(QueryResultPtr arg_0xa60c9d0, ParsedQueryPtr arg_0xa60cb18, ExprPtr arg_0xa60cc58); static result_t ParsedQuery$DBBuffer$putComplete(uint8_t arg_0xa61c0f0, QueryResult *arg_0xa61c250, TinyDBError arg_0xa61c398); static result_t ParsedQuery$DBBuffer$getComplete(uint8_t arg_0xa63f9f8, QueryResult *arg_0xa63fb58, TinyDBError arg_0xa63fca0); static result_t ParsedQuery$DBBuffer$allocComplete(uint8_t arg_0xa63f468, TinyDBError arg_0xa63f5b0); static TinyDBError SelOperator$Operator$processTuple(ParsedQueryPtr arg_0xa60e468, TuplePtr arg_0xa60e5b0, ExprPtr arg_0xa60e6f0); static TinyDBError QueryResult$QueryResultIntf$initQueryResult(QueryResultPtr arg_0xa617878); static TinyDBError QueryResult$QueryResultIntf$toBytes(QueryResultPtr arg_0xa62b368, ParsedQueryPtr arg_0xa62b4b0, CharPtr arg_0xa62b5f0); static uint16_t QueryResult$QueryResultIntf$resultSize(QueryResultPtr arg_0xa62adb8, ParsedQueryPtr arg_0xa62af00); static TinyDBError QueryResult$QueryResultIntf$fromBytes(QueryResultPtr arg_0xa62bb48, QueryResultPtr arg_0xa62bc90, ParsedQueryPtr arg_0xa62bdd8); static ResultTuple QueryResult$QueryResultIntf$getResultTuple(QueryResultPtr arg_0xa629378, short arg_0xa6294b0, ParsedQueryPtr arg_0xa6295f8); static short QueryResult$QueryResultIntf$numRecords(QueryResultPtr arg_0xa628df8, ParsedQueryPtr arg_0xa628f40); static TinyDBError QueryResult$QueryResultIntf$addAggResult(QueryResultPtr arg_0xa629ae0, int16_t arg_0xa629c20, char *arg_0xa629d70, int16_t arg_0xa629eb0, ParsedQueryPtr arg_0xa60a010, short arg_0xa60a148); static TinyDBError QueryResult$QueryResultIntf$fromResultTuple(ResultTuple arg_0xa6282f8, QueryResultPtr arg_0xa628440, ParsedQueryPtr arg_0xa628588); static TinyDBError QueryResult$QueryResultIntf$toTuplePtr(QueryResultPtr arg_0xa62a598, ParsedQueryPtr arg_0xa62a6e0, TupleHandle arg_0xa62a828); static short QueryResult$QueryResultIntf$queryIdFromMsg(QueryResultPtr arg_0xa6289b8); static TinyDBError QueryResult$QueryResultIntf$fromTuple(QueryResultPtr arg_0xa617dd8, ParsedQueryPtr arg_0xa617f20, TuplePtr arg_0xa62a080); static result_t QueryResult$MemAlloc$compactComplete(void); static result_t QueryResult$MemAlloc$reallocComplete(Handle arg_0xa624f58, result_t arg_0xa6250a0); static result_t QueryResult$MemAlloc$allocComplete(HandlePtr arg_0xa624908, result_t arg_0xa624a50); static int16_t TinyAlloc$MemAlloc$size(Handle arg_0xa609bd0); static result_t TinyAlloc$MemAlloc$unlock(Handle arg_0xa608ef0); static result_t TinyAlloc$MemAlloc$lock(Handle arg_0xa608a00); static uint16_t TinyAlloc$MemAlloc$freeBytes(void); static result_t TinyAlloc$MemAlloc$reallocate(Handle arg_0xa6083e0, int16_t arg_0xa608520); static result_t TinyAlloc$MemAlloc$allocate(HandlePtr arg_0xa60bd50, int16_t arg_0xa60be90); static int16_t TinyAlloc$MemAlloc$free(Handle arg_0xa6093b0); static result_t TinyAlloc$StdControl$init(void); static result_t TinyAlloc$StdControl$start(void); static TinyDBError AggOperator$addResults(QueryResult *arg_0xa8fbf20, ParsedQuery *arg_0xa8f8098, Expr *arg_0xa8f81f0); static short AggOperator$getGroupNoFromQr(QueryResult *arg_0xa8f8e38); static result_t AggOperator$QueryProcessor$queryComplete(ParsedQueryPtr arg_0xa30f3e0); static TinyDBError AggOperator$Operator$processPartialResult(QueryResultPtr arg_0xa60f9b0, ParsedQueryPtr arg_0xa60faf8, ExprPtr arg_0xa60fc38); static TinyDBError AggOperator$Operator$processTuple(ParsedQueryPtr arg_0xa60e468, TuplePtr arg_0xa60e5b0, ExprPtr arg_0xa60e6f0); static result_t AggOperator$Operator$endOfEpoch(ParsedQueryPtr arg_0xa60c1a8, ExprPtr arg_0xa60c2e8); static bool AggOperator$Operator$resultIsForExpr(QueryResultPtr arg_0xa60ebb8, ExprPtr arg_0xa60ecf8); static TinyDBError AggOperator$finalizeAggExpr(QueryResult *arg_0xa8f8618, ParsedQueryPtr arg_0xa8f8760, Expr *arg_0xa8f88b8, char *arg_0xa8f8a10); static result_t AggOperator$MemAlloc$compactComplete(void); static result_t AggOperator$MemAlloc$reallocComplete(Handle arg_0xa624f58, result_t arg_0xa6250a0); static result_t AggOperator$MemAlloc$allocComplete(HandlePtr arg_0xa624908, result_t arg_0xa624a50); static short ExprEvalC$ExprEval$evaluateGroupBy(AggregateExpression arg_0xa886060, short arg_0xa8861a0); static short ExprEvalC$ExprEval$evaluate(Expr *arg_0xa88daf0, short arg_0xa88dc30); static bool AggregateUseM$AggregateUse$hasData(uint8_t arg_0xa929e50, char *arg_0xa926010, ParamList *arg_0xa926170, ParamVals *arg_0xa9262d8); static TinyDBError AggregateUseM$AggregateUse$finalize(uint8_t arg_0xa9266e8, char *arg_0xa926838, char *arg_0xa926990, ParamList *arg_0xa926af0, ParamVals *arg_0xa926c58); static uint16_t AggregateUseM$AggregateUse$stateSize(uint8_t arg_0xa929790, ParamList *arg_0xa9298f0, ParamVals *arg_0xa929a58); static result_t AggregateUseM$AggregateUse$init(uint8_t arg_0xa928da0, char *arg_0xa928ef0, ParamList *arg_0xa929050, ParamVals *arg_0xa9291b8, bool arg_0xa929300); static result_t AggregateUseM$AggregateUse$merge(uint8_t arg_0xa8f59a0, char *arg_0xa8f5af8, char *arg_0xa8f5c50, ParamList *arg_0xa8f5db0, ParamVals *arg_0xa8f5f18); static result_t AggregateUseM$AggregateUse$update(uint8_t arg_0xa928428, char *arg_0xa928578, char *arg_0xa9286c8, ParamList *arg_0xa928828, ParamVals *arg_0xa928990); static bool AggregateUseM$Agg$default$hasData(uint8_t arg_0xa9500a0, char *arg_0xa9835f0, ParamList *arg_0xa983750, ParamVals *arg_0xa9838b8); static TinyDBError AggregateUseM$Agg$default$finalize(uint8_t arg_0xa9500a0, char *arg_0xa9827f0, char *arg_0xa982948, ParamList *arg_0xa982aa8, ParamVals *arg_0xa982c10); static uint16_t AggregateUseM$Agg$default$stateSize(uint8_t arg_0xa9500a0, ParamList *arg_0xa983050, ParamVals *arg_0xa9831b8); static result_t AggregateUseM$Agg$default$init(uint8_t arg_0xa9500a0, char *arg_0xa951f28, ParamList *arg_0xa982098, ParamVals *arg_0xa982200, bool arg_0xa982348); static result_t AggregateUseM$Agg$default$merge(uint8_t arg_0xa9500a0, char *arg_0xa950e50, char *arg_0xa950fa8, ParamList *arg_0xa951108, ParamVals *arg_0xa951270); static result_t AggregateUseM$Agg$default$update(uint8_t arg_0xa9500a0, char *arg_0xa9516c8, char *arg_0xa951818, ParamList *arg_0xa951978, ParamVals *arg_0xa951ae0); static bool MaxM$Aggregate$hasData(char *arg_0xa9835f0, ParamList *arg_0xa983750, ParamVals *arg_0xa9838b8); static TinyDBError MaxM$Aggregate$finalize(char *arg_0xa9827f0, char *arg_0xa982948, ParamList *arg_0xa982aa8, ParamVals *arg_0xa982c10); static uint16_t MaxM$Aggregate$stateSize(ParamList *arg_0xa983050, ParamVals *arg_0xa9831b8); static result_t MaxM$Aggregate$init(char *arg_0xa951f28, ParamList *arg_0xa982098, ParamVals *arg_0xa982200, bool arg_0xa982348); static result_t MaxM$Aggregate$merge(char *arg_0xa950e50, char *arg_0xa950fa8, ParamList *arg_0xa951108, ParamVals *arg_0xa951270); static result_t MaxM$Aggregate$update(char *arg_0xa9516c8, char *arg_0xa951818, ParamList *arg_0xa951978, ParamVals *arg_0xa951ae0); static bool MinM$Aggregate$hasData(char *arg_0xa9835f0, ParamList *arg_0xa983750, ParamVals *arg_0xa9838b8); static TinyDBError MinM$Aggregate$finalize(char *arg_0xa9827f0, char *arg_0xa982948, ParamList *arg_0xa982aa8, ParamVals *arg_0xa982c10); static uint16_t MinM$Aggregate$stateSize(ParamList *arg_0xa983050, ParamVals *arg_0xa9831b8); static result_t MinM$Aggregate$init(char *arg_0xa951f28, ParamList *arg_0xa982098, ParamVals *arg_0xa982200, bool arg_0xa982348); static result_t MinM$Aggregate$merge(char *arg_0xa950e50, char *arg_0xa950fa8, ParamList *arg_0xa951108, ParamVals *arg_0xa951270); static result_t MinM$Aggregate$update(char *arg_0xa9516c8, char *arg_0xa951818, ParamList *arg_0xa951978, ParamVals *arg_0xa951ae0); static bool CountM$Aggregate$hasData(char *arg_0xa9835f0, ParamList *arg_0xa983750, ParamVals *arg_0xa9838b8); static TinyDBError CountM$Aggregate$finalize(char *arg_0xa9827f0, char *arg_0xa982948, ParamList *arg_0xa982aa8, ParamVals *arg_0xa982c10); static uint16_t CountM$Aggregate$stateSize(ParamList *arg_0xa983050, ParamVals *arg_0xa9831b8); static result_t CountM$Aggregate$init(char *arg_0xa951f28, ParamList *arg_0xa982098, ParamVals *arg_0xa982200, bool arg_0xa982348); static result_t CountM$Aggregate$merge(char *arg_0xa950e50, char *arg_0xa950fa8, ParamList *arg_0xa951108, ParamVals *arg_0xa951270); static result_t CountM$Aggregate$update(char *arg_0xa9516c8, char *arg_0xa951818, ParamList *arg_0xa951978, ParamVals *arg_0xa951ae0); static bool SumM$Aggregate$hasData(char *arg_0xa9835f0, ParamList *arg_0xa983750, ParamVals *arg_0xa9838b8); static TinyDBError SumM$Aggregate$finalize(char *arg_0xa9827f0, char *arg_0xa982948, ParamList *arg_0xa982aa8, ParamVals *arg_0xa982c10); static uint16_t SumM$Aggregate$stateSize(ParamList *arg_0xa983050, ParamVals *arg_0xa9831b8); static result_t SumM$Aggregate$init(char *arg_0xa951f28, ParamList *arg_0xa982098, ParamVals *arg_0xa982200, bool arg_0xa982348); static result_t SumM$Aggregate$merge(char *arg_0xa950e50, char *arg_0xa950fa8, ParamList *arg_0xa951108, ParamVals *arg_0xa951270); static result_t SumM$Aggregate$update(char *arg_0xa9516c8, char *arg_0xa951818, ParamList *arg_0xa951978, ParamVals *arg_0xa951ae0); static bool AvgM$Aggregate$hasData(char *arg_0xa9835f0, ParamList *arg_0xa983750, ParamVals *arg_0xa9838b8); static TinyDBError AvgM$Aggregate$finalize(char *arg_0xa9827f0, char *arg_0xa982948, ParamList *arg_0xa982aa8, ParamVals *arg_0xa982c10); static uint16_t AvgM$Aggregate$stateSize(ParamList *arg_0xa983050, ParamVals *arg_0xa9831b8); static result_t AvgM$Aggregate$init(char *arg_0xa951f28, ParamList *arg_0xa982098, ParamVals *arg_0xa982200, bool arg_0xa982348); static result_t AvgM$Aggregate$merge(char *arg_0xa950e50, char *arg_0xa950fa8, ParamList *arg_0xa951108, ParamVals *arg_0xa951270); static result_t AvgM$Aggregate$update(char *arg_0xa9516c8, char *arg_0xa951818, ParamList *arg_0xa951978, ParamVals *arg_0xa951ae0); static bool ExpAvgM$Aggregate$hasData(char *arg_0xa9835f0, ParamList *arg_0xa983750, ParamVals *arg_0xa9838b8); static TinyDBError ExpAvgM$Aggregate$finalize(char *arg_0xa9827f0, char *arg_0xa982948, ParamList *arg_0xa982aa8, ParamVals *arg_0xa982c10); static uint16_t ExpAvgM$Aggregate$stateSize(ParamList *arg_0xa983050, ParamVals *arg_0xa9831b8); static result_t ExpAvgM$Aggregate$init(char *arg_0xa951f28, ParamList *arg_0xa982098, ParamVals *arg_0xa982200, bool arg_0xa982348); static result_t ExpAvgM$Aggregate$merge(char *arg_0xa950e50, char *arg_0xa950fa8, ParamList *arg_0xa951108, ParamVals *arg_0xa951270); static result_t ExpAvgM$Aggregate$update(char *arg_0xa9516c8, char *arg_0xa951818, ParamList *arg_0xa951978, ParamVals *arg_0xa951ae0); static bool WinMinM$Aggregate$hasData(char *arg_0xa9835f0, ParamList *arg_0xa983750, ParamVals *arg_0xa9838b8); static TinyDBError WinMinM$Aggregate$finalize(char *arg_0xa9827f0, char *arg_0xa982948, ParamList *arg_0xa982aa8, ParamVals *arg_0xa982c10); static uint16_t WinMinM$Aggregate$stateSize(ParamList *arg_0xa983050, ParamVals *arg_0xa9831b8); static result_t WinMinM$Aggregate$init(char *arg_0xa951f28, ParamList *arg_0xa982098, ParamVals *arg_0xa982200, bool arg_0xa982348); static result_t WinMinM$Aggregate$merge(char *arg_0xa950e50, char *arg_0xa950fa8, ParamList *arg_0xa951108, ParamVals *arg_0xa951270); static result_t WinMinM$Aggregate$update(char *arg_0xa9516c8, char *arg_0xa951818, ParamList *arg_0xa951978, ParamVals *arg_0xa951ae0); static bool WinMaxM$Aggregate$hasData(char *arg_0xa9835f0, ParamList *arg_0xa983750, ParamVals *arg_0xa9838b8); static TinyDBError WinMaxM$Aggregate$finalize(char *arg_0xa9827f0, char *arg_0xa982948, ParamList *arg_0xa982aa8, ParamVals *arg_0xa982c10); static uint16_t WinMaxM$Aggregate$stateSize(ParamList *arg_0xa983050, ParamVals *arg_0xa9831b8); static result_t WinMaxM$Aggregate$init(char *arg_0xa951f28, ParamList *arg_0xa982098, ParamVals *arg_0xa982200, bool arg_0xa982348); static result_t WinMaxM$Aggregate$merge(char *arg_0xa950e50, char *arg_0xa950fa8, ParamList *arg_0xa951108, ParamVals *arg_0xa951270); static result_t WinMaxM$Aggregate$update(char *arg_0xa9516c8, char *arg_0xa951818, ParamList *arg_0xa951978, ParamVals *arg_0xa951ae0); static bool WinCountM$Aggregate$hasData(char *arg_0xa9835f0, ParamList *arg_0xa983750, ParamVals *arg_0xa9838b8); static TinyDBError WinCountM$Aggregate$finalize(char *arg_0xa9827f0, char *arg_0xa982948, ParamList *arg_0xa982aa8, ParamVals *arg_0xa982c10); static uint16_t WinCountM$Aggregate$stateSize(ParamList *arg_0xa983050, ParamVals *arg_0xa9831b8); static result_t WinCountM$Aggregate$init(char *arg_0xa951f28, ParamList *arg_0xa982098, ParamVals *arg_0xa982200, bool arg_0xa982348); static result_t WinCountM$Aggregate$merge(char *arg_0xa950e50, char *arg_0xa950fa8, ParamList *arg_0xa951108, ParamVals *arg_0xa951270); static result_t WinCountM$Aggregate$update(char *arg_0xa9516c8, char *arg_0xa951818, ParamList *arg_0xa951978, ParamVals *arg_0xa951ae0); static bool WinSumM$Aggregate$hasData(char *arg_0xa9835f0, ParamList *arg_0xa983750, ParamVals *arg_0xa9838b8); static TinyDBError WinSumM$Aggregate$finalize(char *arg_0xa9827f0, char *arg_0xa982948, ParamList *arg_0xa982aa8, ParamVals *arg_0xa982c10); static uint16_t WinSumM$Aggregate$stateSize(ParamList *arg_0xa983050, ParamVals *arg_0xa9831b8); static result_t WinSumM$Aggregate$init(char *arg_0xa951f28, ParamList *arg_0xa982098, ParamVals *arg_0xa982200, bool arg_0xa982348); static result_t WinSumM$Aggregate$merge(char *arg_0xa950e50, char *arg_0xa950fa8, ParamList *arg_0xa951108, ParamVals *arg_0xa951270); static result_t WinSumM$Aggregate$update(char *arg_0xa9516c8, char *arg_0xa951818, ParamList *arg_0xa951978, ParamVals *arg_0xa951ae0); static bool WinAvgM$Aggregate$hasData(char *arg_0xa9835f0, ParamList *arg_0xa983750, ParamVals *arg_0xa9838b8); static TinyDBError WinAvgM$Aggregate$finalize(char *arg_0xa9827f0, char *arg_0xa982948, ParamList *arg_0xa982aa8, ParamVals *arg_0xa982c10); static uint16_t WinAvgM$Aggregate$stateSize(ParamList *arg_0xa983050, ParamVals *arg_0xa9831b8); static result_t WinAvgM$Aggregate$init(char *arg_0xa951f28, ParamList *arg_0xa982098, ParamVals *arg_0xa982200, bool arg_0xa982348); static result_t WinAvgM$Aggregate$merge(char *arg_0xa950e50, char *arg_0xa950fa8, ParamList *arg_0xa951108, ParamVals *arg_0xa951270); static result_t WinAvgM$Aggregate$update(char *arg_0xa9516c8, char *arg_0xa951818, ParamList *arg_0xa951978, ParamVals *arg_0xa951ae0); static result_t AttrPotM$AttrRegister$getAttr(char *arg_0xa7e42f0, char *arg_0xa7e4448, SchemaErrorNo *arg_0xa7e45a8); static result_t AttrPotM$AttrRegister$startAttr(void); static result_t AttrPotM$StdControl$init(void); static result_t AttrPotM$StdControl$start(void); static result_t AttrPotM$StdControl$stop(void); static result_t AttrGlobalM$NodeIdAttr$getAttr(char *arg_0xa7e42f0, char *arg_0xa7e4448, SchemaErrorNo *arg_0xa7e45a8); static result_t AttrGlobalM$NodeIdAttr$startAttr(void); static result_t AttrGlobalM$GroupAttr$getAttr(char *arg_0xa7e42f0, char *arg_0xa7e4448, SchemaErrorNo *arg_0xa7e45a8); static result_t AttrGlobalM$GroupAttr$startAttr(void); static result_t AttrGlobalM$StdControl$init(void); static result_t AttrGlobalM$StdControl$start(void); static result_t AttrGlobalM$StdControl$stop(void); static result_t TinyDBAttrM$QueryProcessor$queryComplete(ParsedQueryPtr arg_0xa30f3e0); static result_t TinyDBAttrM$FreeSpaceAttr$getAttr(char *arg_0xa7e42f0, char *arg_0xa7e4448, SchemaErrorNo *arg_0xa7e45a8); static result_t TinyDBAttrM$FreeSpaceAttr$startAttr(void); static result_t TinyDBAttrM$QueueLenAttr$getAttr(char *arg_0xa7e42f0, char *arg_0xa7e4448, SchemaErrorNo *arg_0xa7e45a8); static result_t TinyDBAttrM$QueueLenAttr$startAttr(void); static result_t TinyDBAttrM$MHQueueLenAttr$getAttr(char *arg_0xa7e42f0, char *arg_0xa7e4448, SchemaErrorNo *arg_0xa7e45a8); static result_t TinyDBAttrM$MHQueueLenAttr$startAttr(void); static result_t TinyDBAttrM$QualityAttr$getAttr(char *arg_0xa7e42f0, char *arg_0xa7e4448, SchemaErrorNo *arg_0xa7e45a8); static result_t TinyDBAttrM$QualityAttr$startAttr(void); static result_t TinyDBAttrM$ParentAttr$getAttr(char *arg_0xa7e42f0, char *arg_0xa7e4448, SchemaErrorNo *arg_0xa7e45a8); static result_t TinyDBAttrM$ParentAttr$startAttr(void); static result_t TinyDBAttrM$QidAttr$getAttr(char *arg_0xa7e42f0, char *arg_0xa7e4448, SchemaErrorNo *arg_0xa7e45a8); static result_t TinyDBAttrM$QidAttr$startAttr(void); static result_t TinyDBAttrM$MemAlloc$compactComplete(void); static result_t TinyDBAttrM$MemAlloc$reallocComplete(Handle arg_0xa624f58, result_t arg_0xa6250a0); static result_t TinyDBAttrM$MemAlloc$allocComplete(HandlePtr arg_0xa624908, result_t arg_0xa624a50); static result_t TinyDBAttrM$StdControl$init(void); static result_t TinyDBAttrM$StdControl$start(void); static result_t TinyDBAttrM$StdControl$stop(void); static result_t TinyDBAttrM$DepthAttr$getAttr(char *arg_0xa7e42f0, char *arg_0xa7e4448, SchemaErrorNo *arg_0xa7e45a8); static result_t TinyDBAttrM$DepthAttr$startAttr(void); static result_t AttrTimeM$TimeHighAttr$getAttr(char *arg_0xa7e42f0, char *arg_0xa7e4448, SchemaErrorNo *arg_0xa7e45a8); static result_t AttrTimeM$TimeHighAttr$startAttr(void); static result_t AttrTimeM$TimeLowAttr$getAttr(char *arg_0xa7e42f0, char *arg_0xa7e4448, SchemaErrorNo *arg_0xa7e45a8); static result_t AttrTimeM$TimeLowAttr$startAttr(void); static result_t AttrTimeM$StdControl$init(void); static result_t AttrTimeM$StdControl$start(void); static result_t AttrTimeM$StdControl$stop(void); static result_t VoltageM$StdControl$init(void); static result_t VoltageM$StdControl$start(void); static result_t VoltageM$StdControl$stop(void); static result_t AttrVoltageM$AttrRegister$getAttr(char *arg_0xa7e42f0, char *arg_0xa7e4448, SchemaErrorNo *arg_0xa7e45a8); static result_t AttrVoltageM$AttrRegister$startAttr(void); static result_t AttrVoltageM$ADC$dataReady(uint16_t arg_0xa445aa0); static result_t AttrVoltageM$StdControl$init(void); static result_t AttrVoltageM$StdControl$start(void); static result_t AttrVoltageM$StdControl$stop(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_0xa445aa0); 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_0xa445aa0); static result_t AttrTempM$AttrRegister$getAttr(char *arg_0xa7e42f0, char *arg_0xa7e4448, SchemaErrorNo *arg_0xa7e45a8); static result_t AttrTempM$AttrRegister$startAttr(void); static result_t AttrTempM$ADC$dataReady(uint16_t arg_0xa445aa0); static result_t AttrTempM$StdControl$init(void); static result_t AttrTempM$StdControl$start(void); static result_t AttrTempM$StdControl$stop(void); static result_t AttrPhotoM$AttrRegister$getAttr(char *arg_0xa7e42f0, char *arg_0xa7e4448, SchemaErrorNo *arg_0xa7e45a8); static result_t AttrPhotoM$AttrRegister$startAttr(void); static result_t AttrPhotoM$ADC$dataReady(uint16_t arg_0xa445aa0); static result_t AttrPhotoM$StdControl$init(void); static result_t AttrPhotoM$StdControl$start(void); static result_t AttrPhotoM$StdControl$stop(void); static result_t AccelM$StdControl$init(void); static result_t AccelM$StdControl$start(void); static result_t AccelM$StdControl$stop(void); static result_t AttrAccelM$AttrAccelX$getAttr(char *arg_0xa7e42f0, char *arg_0xa7e4448, SchemaErrorNo *arg_0xa7e45a8); static result_t AttrAccelM$AttrAccelX$startAttr(void); static result_t AttrAccelM$AccelX$dataReady(uint16_t arg_0xa445aa0); static result_t AttrAccelM$AttrAccelY$getAttr(char *arg_0xa7e42f0, char *arg_0xa7e4448, SchemaErrorNo *arg_0xa7e45a8); static result_t AttrAccelM$AttrAccelY$startAttr(void); static result_t AttrAccelM$AccelY$dataReady(uint16_t arg_0xa445aa0); static result_t AttrAccelM$StdControl$init(void); static result_t AttrAccelM$StdControl$start(void); static result_t AttrAccelM$StdControl$stop(void); static result_t MicM$I2CPot$readPotDone(char arg_0xab0e010, bool arg_0xab0e150); static result_t MicM$I2CPot$writePotDone(bool arg_0xab0e550); static result_t MicM$MicInterrupt$default$toneDetected(void); static bool MicM$MicInterrupt$disable(void); static result_t MicM$Mic$gainAdjust(uint8_t arg_0xaad99d8); static uint8_t MicM$Mic$readToneDetector(void); static result_t MicM$Mic$muxSel(uint8_t arg_0xaad95e0); static result_t MicM$StdControl$init(void); static result_t MicM$StdControl$start(void); static result_t MicM$StdControl$stop(void); static result_t I2CM$I2C$sendEnd(void); static result_t I2CM$I2C$read(bool arg_0xaacd410); static result_t I2CM$I2C$sendStart(void); static result_t I2CM$I2C$write(char arg_0xaacd878); static result_t I2CM$StdControl$init(void); static result_t I2CPotM$I2C$sendEndDone(void); static result_t I2CPotM$I2C$sendStartDone(void); static result_t I2CPotM$I2C$writeDone(bool arg_0xab067d8); static result_t I2CPotM$I2C$readDone(char arg_0xab06370); static result_t I2CPotM$I2CPot$writePot(char arg_0xab15418, char arg_0xab15550, char arg_0xab15688); static result_t I2CPotM$StdControl$init(void); static result_t AttrMicM$AttrTones$getAttr(char *arg_0xa7e42f0, char *arg_0xa7e4448, SchemaErrorNo *arg_0xa7e45a8); static result_t AttrMicM$AttrTones$startAttr(void); static result_t AttrMicM$MicADC$dataReady(uint16_t arg_0xa445aa0); static result_t AttrMicM$NoiseSampleTimer$fired(void); static result_t AttrMicM$AttrNoise$getAttr(char *arg_0xa7e42f0, char *arg_0xa7e4448, SchemaErrorNo *arg_0xa7e45a8); static result_t AttrMicM$AttrNoise$startAttr(void); static result_t AttrMicM$StdControl$init(void); static result_t AttrMicM$StdControl$start(void); static result_t AttrMicM$StdControl$stop(void); static result_t AttrMicM$ToneDetectTimer$fired(void); static result_t DBBufferC$QueryProcessor$queryComplete(ParsedQueryPtr arg_0xa30f3e0); static result_t DBBufferC$AttrUse$getAttrDone(char *arg_0xa5e2828, char *arg_0xa5e2980, SchemaErrorNo arg_0xa5e2ac8); static result_t DBBufferC$AttrUse$startAttrDone(uint8_t arg_0xa5e3448); static result_t DBBufferC$MemAlloc$compactComplete(void); static result_t DBBufferC$MemAlloc$reallocComplete(Handle arg_0xa624f58, result_t arg_0xa6250a0); static result_t DBBufferC$MemAlloc$allocComplete(HandlePtr arg_0xa624908, result_t arg_0xa624a50); static TinyDBError DBBufferC$DBBuffer$getField(uint8_t arg_0xa6421c8, QueryResult *arg_0xa642328, uint8_t arg_0xa642468, char *arg_0xa6425c0); static TinyDBError DBBufferC$DBBuffer$enqueue(uint8_t arg_0xa62ddd8, QueryResultPtr arg_0xa62df20, bool *arg_0xa61e098, ParsedQueryPtr arg_0xa61e1e0); static TinyDBError DBBufferC$DBBuffer$getResult(uint8_t arg_0xa61f138, uint16_t arg_0xa61f280, QueryResult *arg_0xa61f3e0, bool *arg_0xa61f538); static ParsedQuery **DBBufferC$DBBuffer$getSchema(uint8_t arg_0xa640718); static TinyDBError DBBufferC$DBBuffer$qidFromBufferId(uint8_t arg_0xa641ee8, uint8_t *arg_0xa63e060); static TinyDBError DBBufferC$DBBuffer$peek(uint8_t arg_0xa61e798, QueryResult *arg_0xa61e8f8, bool *arg_0xa61ea50); static TinyDBError DBBufferC$DBBuffer$getBufferIdFromName(char *arg_0xa6418c0, uint8_t *arg_0xa641a20); static TinyDBError DBBufferC$DBBuffer$getFieldId(uint8_t arg_0xa61f950, FieldPtr arg_0xa61fa98, uint8_t *arg_0xa61fbf0); static TinyDBError DBBufferC$DBBuffer$nextUnusedBuffer(uint8_t *arg_0xa640ba8); static TinyDBError DBBufferC$DBBuffer$alloc(uint8_t arg_0xa642bd8, BufferType arg_0xa642d20, uint16_t arg_0xa642e68, BufferPolicy arg_0xa642fb0, ParsedQuery *arg_0xa643120, char *arg_0xa643270, bool *arg_0xa6433c8, long arg_0xa643500); static TinyDBError DBBufferC$DBBuffer$openBuffer(uint8_t arg_0xa63e528, bool *arg_0xa63e680); static TinyDBError DBBufferC$DBBuffer$getBufferId(uint8_t arg_0xa641038, bool arg_0xa641180, uint8_t *arg_0xa6412e0); static TinyDBError DBBufferC$DBBuffer$size(uint8_t arg_0xa640180, uint16_t *arg_0xa6402e0); static uint8_t DBBufferC$CatalogTable$catalogFieldSize(uint8_t arg_0xa7f7b98, uint8_t arg_0xa7f7cd8); static result_t DBBufferC$StdControl$init(void); static result_t DBBufferC$StdControl$start(void); static result_t DBBufferC$StdControl$stop(void); static result_t TableM$Table$getFieldName(ParsedQuery *arg_0xa63af10, uint8_t arg_0xa63b050, char **arg_0xa63b1b8); static result_t TableM$Table$getNamedField(ParsedQuery *arg_0xa63a840, char *arg_0xa63a990, uint8_t *arg_0xa63aae8); static result_t TableM$Table$addNamedField(ParsedQuery *arg_0xa623960, uint8_t arg_0xa623aa0, char *arg_0xa623bf0, uint8_t arg_0xa623d30); static result_t TableM$Table$getType(ParsedQuery *arg_0xa63a178, uint8_t arg_0xa63a2c0, uint8_t *arg_0xa63a418); static result_t TableM$MemAlloc$compactComplete(void); static result_t TableM$MemAlloc$reallocComplete(Handle arg_0xa624f58, result_t arg_0xa6250a0); static result_t TableM$MemAlloc$allocComplete(HandlePtr arg_0xa624908, result_t arg_0xa624a50); static result_t ServiceSchedulerM$AbsoluteTimer$fired(void); static result_t ServiceSchedulerM$Services$default$start(uint8_t arg_0xabf1558); static result_t ServiceSchedulerM$Services$default$stop(uint8_t arg_0xabf1558); static result_t ServiceSchedulerM$SchedulerClt$init(void); static result_t ServiceSchedulerM$SchedulerClt$start(void); static result_t ServiceSchedulerM$SchedulerClt$stop(void); static result_t ServiceSchedulerM$ServiceScheduler$remove(uint8_t arg_0xa621e00); static result_t ServiceSchedulerM$ServiceScheduler$reschedule(uint8_t arg_0xa620f28, tos_service_schedule arg_0xa621098); static # 70 "d:/tinyos-1.x/tos/system/RealMain.nc" result_t RealMain$hardwareInit(void); static # 105 "d:/tinyos-1.x/tos/interfaces/Pot.nc" result_t RealMain$Pot$init(uint8_t arg_0xa2a50c8); static # 86 "d:/tinyos-1.x/tos/interfaces/Interrupt.nc" result_t RealMain$Interrupt$enable(void); static # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" result_t RealMain$StdControl$init(void); static result_t RealMain$StdControl$start(void); # 78 "d:/tinyos-1.x/tos/system/RealMain.nc" int main(void); static # 101 "d:/tinyos-1.x/tos/interfaces/HPLPot.nc" result_t PotM$HPLPot$finalise(void); static #line 86 result_t PotM$HPLPot$decrease(void); static result_t PotM$HPLPot$increase(void); # 114 "d:/tinyos-1.x/tos/system/PotM.nc" uint8_t PotM$potSetting; static void PotM$setPot(uint8_t value); static inline #line 129 result_t PotM$Pot$init(uint8_t initialSetting); static inline result_t PotM$Pot$set(uint8_t setting); static inline #line 153 uint8_t PotM$Pot$get(void); static inline # 80 "d:/tinyos-1.x/tos/platform/mica2/HPLPotC.nc" result_t HPLPotC$Pot$decrease(void); static inline result_t HPLPotC$Pot$increase(void); static inline result_t HPLPotC$Pot$finalise(void); static inline # 80 "d:/tinyos-1.x/tos/platform/avrmote/HPLInit.nc" result_t HPLInit$init(void); static inline # 79 "d:/tinyos-1.x/tos/platform/avrmote/HPLInterrupt.nc" result_t HPLInterrupt$Interrupt$enable(void); static inline bool HPLInterrupt$Interrupt$disable(void); static inline void TOSH_interrupt_enable(void); static inline bool TOSH_interrupt_disable(void); static # 98 "d:/tinyos-1.x/tos/interfaces/CommandUse.nc" result_t NetworkM$CommandUse$invokeMsg(TOS_MsgPtr arg_0xa341e10, char *arg_0xa34c010, SchemaErrorNo *arg_0xa34c170); static # 94 "d:/tinyos-1.x/tos/lib/TinyDB/QueryProcessor.nc" short NetworkM$QueryProcessor$msgToQueryRoot(TOS_Msg *arg_0xa30fd10); static short NetworkM$QueryProcessor$numQueries(void); static ParsedQueryPtr NetworkM$QueryProcessor$getQueryIdx(short arg_0xa2ec580); static # 72 "d:/tinyos-1.x/tos/interfaces/SendMsg.nc" result_t NetworkM$SchemaMsg$send(uint16_t arg_0xa32f9f0, uint8_t arg_0xa32fb30, TOS_MsgPtr arg_0xa32fc78); static # 99 "d:/tinyos-1.x/tos/lib/TinyDB/Network.nc" result_t NetworkM$Network$sendDataDone(TOS_MsgPtr arg_0xa31a970, result_t arg_0xa31aab8); static #line 124 result_t NetworkM$Network$sendQueryRequestDone(TOS_MsgPtr arg_0xa31bb98, result_t arg_0xa31bce0); static #line 149 result_t NetworkM$Network$sendQueryDone(TOS_MsgPtr arg_0xa320c78, result_t arg_0xa320dc0); static #line 176 result_t NetworkM$Network$queryRequestSub(QueryRequestMessagePtr arg_0xa328490); static #line 155 result_t NetworkM$Network$dataSub(QueryResultPtr arg_0xa321278); static #line 169 result_t NetworkM$Network$snoopedSub(QueryResultPtr arg_0xa321c40, bool arg_0xa321d88, uint16_t arg_0xa321ed8); static #line 161 result_t NetworkM$Network$querySub(QueryMessagePtr arg_0xa321760); static # 72 "d:/tinyos-1.x/tos/interfaces/SendMsg.nc" result_t NetworkM$SendStatusMessage$send(uint16_t arg_0xa32f9f0, uint8_t arg_0xa32fb30, TOS_MsgPtr arg_0xa32fc78); static #line 72 result_t NetworkM$SendQueryRequest$send(uint16_t arg_0xa32f9f0, uint8_t arg_0xa32fb30, TOS_MsgPtr arg_0xa32fc78); static #line 72 result_t NetworkM$SendDataMsg$send(uint16_t arg_0xa32f9f0, uint8_t arg_0xa32fb30, TOS_MsgPtr arg_0xa32fc78); static # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" result_t NetworkM$SubControl$init(void); static result_t NetworkM$SubControl$start(void); static result_t NetworkM$SubControl$stop(void); static # 72 "d:/tinyos-1.x/tos/interfaces/SendMsg.nc" result_t NetworkM$SendQueryMsg$send(uint16_t arg_0xa32f9f0, uint8_t arg_0xa32fb30, TOS_MsgPtr arg_0xa32fc78); static # 133 "d:/tinyos-1.x/tos/interfaces/Leds.nc" result_t NetworkM$Leds$greenToggle(void); static #line 108 result_t NetworkM$Leds$redToggle(void); # 160 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkM.nc" enum NetworkM$__nesc_unnamed4334 { NetworkM$LEVEL_UNKNOWN = -1, NetworkM$PARENT_UNKNOWN = -1, NetworkM$BAD_IX = -1, NetworkM$UNKNOWN_ROOT = -1, NetworkM$PARENT_RESELECT_INTERVAL = 5, NetworkM$PARENT_LOST_INTERVAL = 10, NetworkM$TIME_OF_FLIGHT = 0, NetworkM$NUM_RELATIVES = 5, NetworkM$MAX_PROB_THRESH = 127, NetworkM$ALPHABITS = 2, NetworkM$NACKALPHA = 4, NetworkM$QUERY_RETRIES = 5, NetworkM$NUM_ROOTS = 4, NetworkM$DATA_RETRIES = 0 }; uint16_t NetworkM$mSendCount; char NetworkM$mRelatives[NetworkM$NUM_RELATIVES]; char NetworkM$mRelOccupiedBits; short NetworkM$mParentIx[NetworkM$NUM_ROOTS]; unsigned short NetworkM$mLastIdxRelative[NetworkM$NUM_RELATIVES]; unsigned char NetworkM$mCommProb[NetworkM$NUM_RELATIVES]; short NetworkM$mRoots[NetworkM$NUM_ROOTS]; char NetworkM$mRelLevel[NetworkM$NUM_ROOTS][NetworkM$NUM_RELATIVES]; TOS_MsgPtr NetworkM$mMsg; TOS_Msg NetworkM$mDbg; uint8_t NetworkM$mAmId; uint8_t NetworkM$mIdx; bool NetworkM$mForceTopology; bool NetworkM$mUart; bool NetworkM$mLocal; bool NetworkM$mWasCommand; bool NetworkM$mRadio; char NetworkM$mFanout; bool NetworkM$mCentralized; short NetworkM$mParentCand1; #line 212 short NetworkM$mParentCand2; #line 212 short NetworkM$mParentCand3; short NetworkM$mLastCheck; #line 213 short NetworkM$mLastHeard; uint16_t NetworkM$mContention; uint16_t NetworkM$mRem; enum NetworkM$__nesc_unnamed4335 { NetworkM$NUM_RECENT_MSGS = 8 }; long NetworkM$mRecentMsgs[NetworkM$NUM_RECENT_MSGS]; uint8_t NetworkM$mNextMsg; short NetworkM$mRetryCnt; SchemaErrorNo NetworkM$errorNo; typedef enum NetworkM$__nesc_unnamed4336 { NetworkM$QUERY_TYPE = 0, NetworkM$DATA_TYPE = 1 } NetworkM$MsgType; typedef struct NetworkM$__nesc_unnamed4337 { short nodeid; short msgcount; } NetworkM$NodeMsgCount; static void NetworkM$initHeader(DbMsgHdr *header, bool amRoot, uint8_t rootId); static bool NetworkM$processHeader(DbMsgHdr header, NetworkM$MsgType type, uint8_t rootId); static inline void NetworkM$setRoot(uint8_t rootId); static bool NetworkM$checkRoot(TOS_MsgPtr msg, uint8_t *rootId); static uint8_t NetworkM$myLevel(uint8_t rootId); static inline result_t NetworkM$StdControl$init(void); static inline #line 286 void NetworkM$setRoot(uint8_t rootId); static inline #line 300 uint8_t NetworkM$getRootId(short rootNode); static #line 324 bool NetworkM$checkRoot(TOS_MsgPtr msg, uint8_t *rootIdPtr); static inline #line 339 result_t NetworkM$StdControl$start(void); static inline result_t NetworkM$StdControl$stop(void); static inline QueryResultPtr NetworkM$Network$getDataPayLoad(TOS_MsgPtr msg); static #line 364 TinyDBError NetworkM$Network$sendDataMessage(TOS_MsgPtr msg); static inline #line 406 QueryMessagePtr NetworkM$Network$getQueryPayLoad(TOS_MsgPtr msg); static #line 425 TinyDBError NetworkM$Network$sendQueryMessage(TOS_MsgPtr msg); static inline #line 456 QueryRequestMessagePtr NetworkM$Network$getQueryRequestPayLoad(TOS_MsgPtr msg); static inline #line 471 TinyDBError NetworkM$Network$sendQueryRequest(TOS_MsgPtr msg, uint16_t to); static #line 496 result_t NetworkM$sendDone(TOS_MsgPtr msg, result_t success); static inline #line 526 result_t NetworkM$SendQueryMsg$sendDone(TOS_MsgPtr msg, result_t success); static inline #line 539 result_t NetworkM$SendDataMsg$sendDone(TOS_MsgPtr msg, result_t success); static inline #line 564 result_t NetworkM$SendQueryRequest$sendDone(TOS_MsgPtr msg, result_t success); static inline result_t NetworkM$SendStatusMessage$sendDone(TOS_MsgPtr msg, result_t success); static inline result_t NetworkM$DebugMsg$sendDone(TOS_MsgPtr msg, result_t success); static inline result_t NetworkM$SchemaMsg$sendDone(TOS_MsgPtr msg, result_t success); static #line 595 bool NetworkM$filterMessage(TOS_MsgPtr msg, bool checkRecent); static inline #line 625 TOS_MsgPtr NetworkM$RcvQueryMsg$receive(TOS_MsgPtr msg); static inline #line 649 TOS_MsgPtr NetworkM$RcvRequestMsg$receive(TOS_MsgPtr msg); static inline #line 667 TOS_MsgPtr NetworkM$RcvDataMsg$receive(TOS_MsgPtr msg); static inline #line 733 TOS_MsgPtr NetworkM$RcvCommandMsg$receive(TOS_MsgPtr msg); static inline #line 767 TOS_MsgPtr NetworkM$RcvStatusMessage$receive(TOS_MsgPtr msg); static #line 797 void NetworkM$initHeader(DbMsgHdr *header, bool amRoot, uint8_t rootId); static inline #line 815 void NetworkM$tinydbParentInit(DbMsgHdr header, short clockCnt, uint8_t rootId); static inline #line 838 bool NetworkM$isParent(uint8_t idx); enum NetworkM$__nesc_unnamed4338 { NetworkM$CONTENT_SHIFT = 4 }; static void NetworkM$NetworkMonitor$updateContention(bool failure, int status); static inline #line 872 uint16_t NetworkM$NetworkMonitor$getParent(void); static inline uint8_t NetworkM$NetworkMonitor$getDepth(void); static inline uint8_t NetworkM$NetworkMonitor$getQuality(void); static inline uint8_t NetworkM$NetworkMonitor$getQueueLength(void); static inline uint8_t NetworkM$NetworkMonitor$getMHopQueueLength(void); static inline #line 920 short NetworkM$tinydbUpdateSenderStats(DbMsgHdr header, short clockCnt, uint8_t rootId); static inline #line 983 void NetworkM$tinydbRelativeReplace(DbMsgHdr header, short clockCnt, uint8_t rootId); static #line 1013 void NetworkM$tinydbChooseParent(DbMsgHdr header, short clockCnt, uint8_t rootId, bool lastOk); static #line 1097 bool NetworkM$processHeader(DbMsgHdr header, NetworkM$MsgType type, uint8_t rootId); static inline #line 1245 result_t NetworkM$QueryProcessor$queryComplete(ParsedQueryPtr q); static # 106 "d:/tinyos-1.x/tos/interfaces/ReceiveMsg.nc" TOS_MsgPtr AMStandard$ReceiveMsg$receive( # 79 "d:/tinyos-1.x/tos/system/AMStandard.nc" uint8_t arg_0xa3e52e0, # 106 "d:/tinyos-1.x/tos/interfaces/ReceiveMsg.nc" TOS_MsgPtr arg_0xa33a580); static # 90 "d:/tinyos-1.x/tos/interfaces/Timer.nc" result_t AMStandard$ActivityTimer$start(char arg_0xa3f1240, uint32_t arg_0xa3f1390); static result_t AMStandard$ActivityTimer$stop(void); static # 85 "d:/tinyos-1.x/tos/interfaces/BareSendMsg.nc" result_t AMStandard$UARTSend$send(TOS_MsgPtr arg_0xa3e0d40); static # 29 "d:/tinyos-1.x/tos/interfaces/PowerManagement.nc" uint8_t AMStandard$PowerManagement$adjustPower(void); static # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" result_t AMStandard$RadioControl$init(void); static result_t AMStandard$RadioControl$start(void); static result_t AMStandard$RadioControl$stop(void); static #line 52 result_t AMStandard$TimerControl$init(void); static result_t AMStandard$TimerControl$start(void); static #line 52 result_t AMStandard$UARTControl$init(void); static result_t AMStandard$UARTControl$start(void); static result_t AMStandard$UARTControl$stop(void); static # 88 "d:/tinyos-1.x/tos/system/AMStandard.nc" result_t AMStandard$sendDone(void); static # 85 "d:/tinyos-1.x/tos/interfaces/BareSendMsg.nc" result_t AMStandard$RadioSend$send(TOS_MsgPtr arg_0xa3e0d40); static # 73 "d:/tinyos-1.x/tos/interfaces/SendMsg.nc" result_t AMStandard$SendMsg$sendDone( # 78 "d:/tinyos-1.x/tos/system/AMStandard.nc" uint8_t arg_0xa3e4d48, # 73 "d:/tinyos-1.x/tos/interfaces/SendMsg.nc" TOS_MsgPtr arg_0xa3320a0, result_t arg_0xa3321e8); # 105 "d:/tinyos-1.x/tos/system/AMStandard.nc" bool AMStandard$state; TOS_MsgPtr AMStandard$buffer; uint16_t AMStandard$lastCount; uint16_t AMStandard$counter; static inline bool AMStandard$Control$init(void); static inline #line 126 bool AMStandard$Control$start(void); static inline #line 143 bool AMStandard$Control$stop(void); static inline #line 156 void AMStandard$dbgPacket(TOS_MsgPtr data); static result_t AMStandard$reportSendDone(TOS_MsgPtr msg, result_t success); static inline result_t AMStandard$ActivityTimer$fired(void); static inline result_t AMStandard$SendMsg$default$sendDone(uint8_t id, TOS_MsgPtr msg, result_t success); static inline result_t AMStandard$default$sendDone(void); static inline void AMStandard$sendTask(void); static #line 209 result_t AMStandard$SendMsg$send(uint8_t id, uint16_t addr, uint8_t length, TOS_MsgPtr data); static inline #line 245 result_t AMStandard$UARTSend$sendDone(TOS_MsgPtr msg, result_t success); static inline result_t AMStandard$RadioSend$sendDone(TOS_MsgPtr msg, result_t success); TOS_MsgPtr received(TOS_MsgPtr packet); static inline #line 282 TOS_MsgPtr AMStandard$ReceiveMsg$default$receive(uint8_t id, TOS_MsgPtr msg); static inline TOS_MsgPtr AMStandard$UARTReceive$receive(TOS_MsgPtr packet); static inline TOS_MsgPtr AMStandard$RadioReceive$receive(TOS_MsgPtr packet); static # 94 "d:/tinyos-1.x/tos/interfaces/BareSendMsg.nc" result_t CC1000RadioIntM$Send$sendDone(TOS_MsgPtr arg_0xa3e1248, result_t arg_0xa3e1390); static # 86 "d:/tinyos-1.x/tos/interfaces/Random.nc" uint16_t CC1000RadioIntM$Random$rand(void); static #line 80 result_t CC1000RadioIntM$Random$init(void); static # 116 "d:/tinyos-1.x/tos/interfaces/ADCControl.nc" result_t CC1000RadioIntM$ADCControl$bindPort(uint8_t arg_0xa41fbc0, uint8_t arg_0xa41fd00); static #line 77 result_t CC1000RadioIntM$ADCControl$init(void); static # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" result_t CC1000RadioIntM$TimerControl$init(void); static result_t CC1000RadioIntM$TimerControl$start(void); static #line 52 result_t CC1000RadioIntM$CC1000StdControl$init(void); static result_t CC1000RadioIntM$CC1000StdControl$start(void); static result_t CC1000RadioIntM$CC1000StdControl$stop(void); static # 106 "d:/tinyos-1.x/tos/interfaces/ReceiveMsg.nc" TOS_MsgPtr CC1000RadioIntM$Receive$receive(TOS_MsgPtr arg_0xa33a580); static # 68 "d:/tinyos-1.x/tos/platform/mica2/SpiByteFifo.nc" result_t CC1000RadioIntM$SpiByteFifo$initSlave(void); static #line 67 result_t CC1000RadioIntM$SpiByteFifo$disableIntr(void); static #line 63 result_t CC1000RadioIntM$SpiByteFifo$writeByte(uint8_t arg_0xa42ef08); static result_t CC1000RadioIntM$SpiByteFifo$enableIntr(void); static result_t CC1000RadioIntM$SpiByteFifo$txMode(void); static result_t CC1000RadioIntM$SpiByteFifo$rxMode(void); static # 32 "d:/tinyos-1.x/tos/interfaces/RadioCoordinator.nc" void CC1000RadioIntM$RadioReceiveCoordinator$byte(TOS_MsgPtr arg_0xa42c780, uint8_t arg_0xa42c8c8); static #line 29 void CC1000RadioIntM$RadioReceiveCoordinator$startSymbol(void); static # 90 "d:/tinyos-1.x/tos/interfaces/Timer.nc" result_t CC1000RadioIntM$WakeupTimer$start(char arg_0xa3f1240, uint32_t arg_0xa3f1390); static result_t CC1000RadioIntM$WakeupTimer$stop(void); static # 32 "d:/tinyos-1.x/tos/interfaces/RadioCoordinator.nc" void CC1000RadioIntM$RadioSendCoordinator$byte(TOS_MsgPtr arg_0xa42c780, uint8_t arg_0xa42c8c8); static #line 29 void CC1000RadioIntM$RadioSendCoordinator$startSymbol(void); static # 175 "d:/tinyos-1.x/tos/platform/mica2/CC1000Control.nc" bool CC1000RadioIntM$CC1000Control$GetLOStatus(void); static #line 101 result_t CC1000RadioIntM$CC1000Control$RxMode(void); static #line 122 result_t CC1000RadioIntM$CC1000Control$BIASOn(void); static #line 93 result_t CC1000RadioIntM$CC1000Control$TxMode(void); static #line 155 result_t CC1000RadioIntM$CC1000Control$SelectLock(uint8_t arg_0xa408d10); static # 82 "d:/tinyos-1.x/tos/interfaces/ADC.nc" result_t CC1000RadioIntM$RSSIADC$getData(void); # 102 "d:/tinyos-1.x/tos/platform/mica2/CC1000RadioIntM.nc" enum CC1000RadioIntM$__nesc_unnamed4339 { CC1000RadioIntM$TX_STATE, CC1000RadioIntM$DISABLED_STATE, CC1000RadioIntM$IDLE_STATE, CC1000RadioIntM$PRETX_STATE, CC1000RadioIntM$SYNC_STATE, CC1000RadioIntM$RX_STATE, CC1000RadioIntM$POWER_DOWN_STATE }; enum CC1000RadioIntM$__nesc_unnamed4340 { CC1000RadioIntM$TXSTATE_WAIT, CC1000RadioIntM$TXSTATE_START, CC1000RadioIntM$TXSTATE_PREAMBLE, CC1000RadioIntM$TXSTATE_SYNC, CC1000RadioIntM$TXSTATE_DATA, CC1000RadioIntM$TXSTATE_CRC, CC1000RadioIntM$TXSTATE_FLUSH, CC1000RadioIntM$TXSTATE_DONE }; enum CC1000RadioIntM$__nesc_unnamed4341 { CC1000RadioIntM$SYNC_BYTE = 0x33, CC1000RadioIntM$NSYNC_BYTE = 0xcc, CC1000RadioIntM$SYNC_WORD = 0x33cc, CC1000RadioIntM$NSYNC_WORD = 0xcc33 }; uint8_t CC1000RadioIntM$RadioState; uint8_t CC1000RadioIntM$RadioTxState; uint16_t CC1000RadioIntM$txlength; uint16_t CC1000RadioIntM$rxlength; TOS_MsgPtr CC1000RadioIntM$txbufptr; TOS_MsgPtr CC1000RadioIntM$rxbufptr; TOS_Msg CC1000RadioIntM$RxBuf; uint8_t CC1000RadioIntM$NextTxByte; uint8_t CC1000RadioIntM$lplpower; uint8_t CC1000RadioIntM$lplpowertx; uint16_t CC1000RadioIntM$preamblelen; uint16_t CC1000RadioIntM$PreambleCount; uint8_t CC1000RadioIntM$SOFCount; union CC1000RadioIntM$__nesc_unnamed4342 { uint16_t W; struct { uint8_t LSB; uint8_t MSB; } ; } CC1000RadioIntM$RxShiftBuf; uint8_t CC1000RadioIntM$RxBitOffset; uint16_t CC1000RadioIntM$RxByteCnt; uint16_t CC1000RadioIntM$TxByteCnt; uint16_t CC1000RadioIntM$RSSISampleFreq; bool CC1000RadioIntM$bInvertRxData; bool CC1000RadioIntM$bTxPending; bool CC1000RadioIntM$bTxBusy; bool CC1000RadioIntM$bRSSIValid; uint16_t CC1000RadioIntM$usRunningCRC; uint16_t CC1000RadioIntM$usRSSIVal; uint16_t CC1000RadioIntM$usSquelchVal; int16_t CC1000RadioIntM$sMacDelay; volatile uint16_t CC1000RadioIntM$LocalAddr; static inline void CC1000RadioIntM$PacketRcvd(void); static inline #line 196 void CC1000RadioIntM$PacketSent(void); static inline #line 210 result_t CC1000RadioIntM$StdControl$init(void); static inline #line 346 result_t CC1000RadioIntM$WakeupTimer$fired(void); static inline #line 383 result_t CC1000RadioIntM$StdControl$stop(void); static inline result_t CC1000RadioIntM$StdControl$start(void); static inline #line 422 result_t CC1000RadioIntM$Send$send(TOS_MsgPtr pMsg); static #line 472 result_t CC1000RadioIntM$SpiByteFifo$dataReady(uint8_t data_in); static inline #line 757 result_t CC1000RadioIntM$RSSIADC$dataReady(uint16_t data); static # 74 "d:/tinyos-1.x/tos/platform/mica2/HPLCC1000.nc" result_t CC1000ControlM$HPLChipcon$init(void); static #line 88 uint8_t CC1000ControlM$HPLChipcon$read(uint8_t arg_0xa48b498); static #line 81 result_t CC1000ControlM$HPLChipcon$write(uint8_t arg_0xa48af10, uint8_t arg_0xa48b050); # 82 "d:/tinyos-1.x/tos/platform/mica2/CC1000ControlM.nc" uint8_t CC1000ControlM$tunefreq; uint8_t CC1000ControlM$rfpower; uint8_t CC1000ControlM$LockVal; static inline #line 96 result_t CC1000ControlM$chipcon_cal(void); static inline #line 156 result_t CC1000ControlM$StdControl$init(void); static inline #line 178 result_t CC1000ControlM$CC1000Control$Tune(uint8_t freq); static inline #line 196 result_t CC1000ControlM$CC1000Control$TxMode(void); static #line 209 result_t CC1000ControlM$CC1000Control$RxMode(void); static inline #line 231 result_t CC1000ControlM$CC1000Control$BIASOn(void); static inline #line 243 result_t CC1000ControlM$StdControl$stop(void); static inline result_t CC1000ControlM$StdControl$start(void); static inline #line 278 result_t CC1000ControlM$CC1000Control$SelectLock(uint8_t Value); static inline bool CC1000ControlM$CC1000Control$GetLOStatus(void); static inline # 79 "d:/tinyos-1.x/tos/platform/mica2/HPLCC1000M.nc" result_t HPLCC1000M$HPLCC1000$init(void); static #line 103 result_t HPLCC1000M$HPLCC1000$write(uint8_t addr, uint8_t data); static #line 156 uint8_t HPLCC1000M$HPLCC1000$read(uint8_t addr); # 77 "d:/tinyos-1.x/tos/system/RandomLFSR.nc" uint16_t RandomLFSR$shiftReg; uint16_t RandomLFSR$initSeed; uint16_t RandomLFSR$mask; static inline result_t RandomLFSR$Random$init(void); static uint16_t RandomLFSR$Random$rand(void); static # 97 "d:/tinyos-1.x/tos/interfaces/HPLADC.nc" result_t ADCM$HPLADC$bindPort(uint8_t arg_0xa4c74d8, uint8_t arg_0xa4c7618); static #line 81 result_t ADCM$HPLADC$init(void); static #line 104 result_t ADCM$HPLADC$samplePort(uint8_t arg_0xa4c7af0); static # 100 "d:/tinyos-1.x/tos/interfaces/ADC.nc" result_t ADCM$ADC$dataReady( # 83 "d:/tinyos-1.x/tos/platform/mica2/ADCM.nc" uint8_t arg_0xa4c97b8, # 100 "d:/tinyos-1.x/tos/interfaces/ADC.nc" uint16_t arg_0xa445aa0); # 92 "d:/tinyos-1.x/tos/platform/mica2/ADCM.nc" enum ADCM$__nesc_unnamed4343 { ADCM$IDLE = 0, ADCM$SINGLE_CONVERSION = 1, ADCM$CONTINUOUS_CONVERSION = 2 }; uint16_t ADCM$ReqPort; uint16_t ADCM$ReqVector; uint16_t ADCM$ContReqMask; static inline result_t ADCM$ADCControl$init(void); static inline #line 116 result_t ADCM$ADCControl$bindPort(uint8_t port, uint8_t adcPort); static inline result_t ADCM$ADC$default$dataReady(uint8_t port, uint16_t data); static inline result_t ADCM$HPLADC$dataReady(uint16_t data); static #line 164 result_t ADCM$startGet(uint8_t newState, uint8_t port); static inline #line 200 result_t ADCM$ADC$getData(uint8_t port); static # 126 "d:/tinyos-1.x/tos/interfaces/HPLADC.nc" result_t HPLADCM$ADC$dataReady(uint16_t arg_0xa4d8630); # 86 "d:/tinyos-1.x/tos/platform/mica2/HPLADCM.nc" bool HPLADCM$init_portmap_done; uint8_t HPLADCM$TOSH_adc_portmap[TOSH_ADC_PORTMAPSIZE]; static void HPLADCM$init_portmap(void); static inline #line 118 result_t HPLADCM$ADC$init(void); static #line 138 result_t HPLADCM$ADC$bindPort(uint8_t port, uint8_t adcPort); static #line 150 result_t HPLADCM$ADC$samplePort(uint8_t port); #line 175 void __attribute((interrupt)) __vector_21(void); static # 29 "d:/tinyos-1.x/tos/interfaces/PowerManagement.nc" uint8_t HPLSpiM$PowerManagement$adjustPower(void); static # 72 "d:/tinyos-1.x/tos/platform/mica2/SpiByteFifo.nc" result_t HPLSpiM$SpiByteFifo$dataReady(uint8_t arg_0xa43e690); # 75 "d:/tinyos-1.x/tos/platform/mica2/HPLSpiM.nc" uint8_t HPLSpiM$OutgoingByte; void __attribute((signal)) __vector_17(void); static inline result_t HPLSpiM$SpiByteFifo$writeByte(uint8_t data); static inline #line 98 result_t HPLSpiM$SpiByteFifo$enableIntr(void); static result_t HPLSpiM$SpiByteFifo$disableIntr(void); static inline result_t HPLSpiM$SpiByteFifo$initSlave(void); static inline #line 127 result_t HPLSpiM$SpiByteFifo$txMode(void); static inline result_t HPLSpiM$SpiByteFifo$rxMode(void); static # 206 "d:/tinyos-1.x/tos/interfaces/Clock.nc" result_t HPLClock$Clock$fire(void); # 77 "d:/tinyos-1.x/tos/platform/mica/HPLClock.nc" uint8_t HPLClock$set_flag; uint8_t HPLClock$mscale; #line 78 uint8_t HPLClock$nextScale; #line 78 uint8_t HPLClock$minterval; static inline result_t HPLClock$StdControl$init(void); static inline result_t HPLClock$StdControl$start(void); static inline #line 110 void HPLClock$Clock$setInterval(uint8_t value); static inline uint8_t HPLClock$Clock$getInterval(void); static inline #line 157 uint8_t HPLClock$Clock$readCounter(void); static inline void HPLClock$Clock$setCounter(uint8_t n); static result_t HPLClock$Clock$setRate(char interval, char scale); #line 190 void __attribute((interrupt)) __vector_15(void); static # 66 "d:/tinyos-1.x/tos/interfaces/AbsoluteTimer.nc" result_t LogicalTimeM$AbsoluteTimer$fired( # 56 "d:/tinyos-1.x/tos/system/LogicalTimeM.nc" uint8_t arg_0xa535210); static # 59 "d:/tinyos-1.x/tos/interfaces/TimeUtil.nc" tos_time_t LogicalTimeM$TimeUtil$addint32(tos_time_t arg_0xa4fa010, int32_t arg_0xa4fa150); static tos_time_t LogicalTimeM$TimeUtil$addUint32(tos_time_t arg_0xa4fa690, uint32_t arg_0xa4fa7d8); static #line 97 tos_time_t LogicalTimeM$TimeUtil$subtract(tos_time_t arg_0xa4fbf30, tos_time_t arg_0xa5160a0); static #line 87 char LogicalTimeM$TimeUtil$compare(tos_time_t arg_0xa4fb3b8, tos_time_t arg_0xa4fb500); static # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" result_t LogicalTimeM$ClockControl$init(void); static result_t LogicalTimeM$ClockControl$start(void); static # 188 "d:/tinyos-1.x/tos/interfaces/Clock.nc" void LogicalTimeM$Clock$setCounter(uint8_t arg_0xa50c9a8); static #line 131 void LogicalTimeM$Clock$setInterval(uint8_t arg_0xa50ed68); static #line 179 uint8_t LogicalTimeM$Clock$readCounter(void); static #line 147 uint8_t LogicalTimeM$Clock$getInterval(void); static # 104 "d:/tinyos-1.x/tos/interfaces/Timer.nc" result_t LogicalTimeM$Timer$fired( # 55 "d:/tinyos-1.x/tos/system/LogicalTimeM.nc" uint8_t arg_0xa534bd0); #line 69 tos_time_t LogicalTimeM$time; int16_t LogicalTimeM$adjustment; uint32_t LogicalTimeM$mState; uint8_t LogicalTimeM$setIntervalFlag; struct LogicalTimeM$timer_s { uint8_t type; int32_t ticks; int32_t ticksLeft; } LogicalTimeM$mTimerList[NUM_TIMERS + 1]; uint8_t LogicalTimeM$useBit; int8_t LogicalTimeM$baseTimerIndex; tos_time_t LogicalTimeM$aTimer[MAX_NUM_TIMERS]; static void LogicalTimeM$selectBaseTimer(void); static void LogicalTimeM$resetBaseTimer(void); static result_t LogicalTimeM$StdControl$init(void); static inline #line 106 result_t LogicalTimeM$StdControl$start(void); static inline #line 131 tos_time_t LogicalTimeM$Time$get(void); static inline uint32_t LogicalTimeM$Time$getHigh32(void); static inline uint32_t LogicalTimeM$Time$getLow32(void); static inline void LogicalTimeM$TimeSet$set(tos_time_t t); static #line 181 void LogicalTimeM$resetBaseTimer(void); static result_t LogicalTimeM$AbsoluteTimer$set(uint8_t id, tos_time_t in); static #line 225 result_t LogicalTimeM$AbsoluteTimer$cancel(uint8_t id); static #line 246 void LogicalTimeM$selectBaseTimer(void); static inline #line 267 result_t LogicalTimeM$AbsoluteTimer$default$fired(uint8_t id); static inline void LogicalTimeM$timeout(void); #line 295 static void LogicalTimeM$adjustInterval(void); static #line 319 result_t LogicalTimeM$Timer$stop(uint8_t id); static #line 336 result_t LogicalTimeM$Timer$start(uint8_t id, char type, uint32_t interval); static inline #line 363 result_t LogicalTimeM$Timer$default$fired(uint8_t id); static inline void LogicalTimeM$timerHandlingTask(void); static inline #line 416 result_t LogicalTimeM$Clock$fire(void); static # 54 "d:/tinyos-1.x/tos/system/TimeUtilC.nc" char TimeUtilC$TimeUtil$compare(tos_time_t a, tos_time_t b); static inline tos_time_t TimeUtilC$TimeUtil$subtract(tos_time_t a, tos_time_t b); static inline #line 89 tos_time_t TimeUtilC$TimeUtil$addint32(tos_time_t a, int32_t ms); static tos_time_t TimeUtilC$TimeUtil$addUint32(tos_time_t a, uint32_t ms); # 37 "d:/tinyos-1.x/tos/platform/mica2/HPLPowerManagementM.nc" bool HPLPowerManagementM$disabled = TRUE; enum HPLPowerManagementM$__nesc_unnamed4344 { HPLPowerManagementM$IDLE = 0, HPLPowerManagementM$ADC_NR = 1 << 3, HPLPowerManagementM$POWER_DOWN = 1 << 4, HPLPowerManagementM$POWER_SAVE = (1 << 3) + (1 << 4), HPLPowerManagementM$STANDBY = (1 << 2) + (1 << 4), HPLPowerManagementM$EXT_STANDBY = (1 << 3) + (1 << 4) + (1 << 2) }; static inline uint8_t HPLPowerManagementM$getPowerLevel(void); static inline #line 70 void HPLPowerManagementM$doAdjustment(void); static #line 87 uint8_t HPLPowerManagementM$PowerManagement$adjustPower(void); static # 94 "d:/tinyos-1.x/tos/interfaces/BareSendMsg.nc" result_t NoCRCPacket$Send$sendDone(TOS_MsgPtr arg_0xa3e1248, result_t arg_0xa3e1390); static # 89 "d:/tinyos-1.x/tos/interfaces/SendVarLenPacket.nc" result_t NoCRCPacket$SendVarLenPacket$sendDone(uint8_t *arg_0xa3e21b8, result_t arg_0xa3e2300); static # 106 "d:/tinyos-1.x/tos/interfaces/ReceiveMsg.nc" TOS_MsgPtr NoCRCPacket$Receive$receive(TOS_MsgPtr arg_0xa33a580); static # 82 "d:/tinyos-1.x/tos/interfaces/ByteComm.nc" result_t NoCRCPacket$ByteComm$txByte(uint8_t arg_0xa58dab0); static # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" result_t NoCRCPacket$ByteControl$init(void); static result_t NoCRCPacket$ByteControl$start(void); static result_t NoCRCPacket$ByteControl$stop(void); # 89 "d:/tinyos-1.x/tos/system/NoCRCPacket.nc" uint8_t NoCRCPacket$rxCount; #line 89 uint8_t NoCRCPacket$rxLength; #line 89 uint8_t NoCRCPacket$txCount; #line 89 uint8_t NoCRCPacket$txLength; TOS_Msg NoCRCPacket$buffers[2]; TOS_Msg *NoCRCPacket$bufferPtrs[2]; uint8_t NoCRCPacket$bufferIndex; uint8_t *NoCRCPacket$recPtr; uint8_t *NoCRCPacket$sendPtr; enum NoCRCPacket$__nesc_unnamed4345 { NoCRCPacket$IDLE, NoCRCPacket$PACKET, NoCRCPacket$BYTES }; uint8_t NoCRCPacket$state; static inline #line 116 result_t NoCRCPacket$Control$init(void); static inline #line 133 result_t NoCRCPacket$Control$start(void); static inline result_t NoCRCPacket$Control$stop(void); static inline result_t NoCRCPacket$txBytes(uint8_t *bytes, uint8_t numBytes); static inline #line 171 result_t NoCRCPacket$Send$send(TOS_MsgPtr msg); static inline #line 212 void NoCRCPacket$sendDoneFailTask(void); static inline void NoCRCPacket$sendDoneSuccessTask(void); static inline void NoCRCPacket$sendVarLenFailTask(void); static inline void NoCRCPacket$sendVarLenSuccessTask(void); static void NoCRCPacket$sendComplete(result_t success); static inline #line 293 result_t NoCRCPacket$SendVarLenPacket$default$sendDone(uint8_t *packet, result_t success); static inline result_t NoCRCPacket$ByteComm$txByteReady(bool success); static inline #line 331 result_t NoCRCPacket$ByteComm$txDone(void); static inline void NoCRCPacket$receiveTask(void); static #line 357 result_t NoCRCPacket$ByteComm$rxByteReady(uint8_t data, bool error, uint16_t strength); static # 89 "d:/tinyos-1.x/tos/interfaces/HPLUART.nc" result_t UARTM$HPLUART$init(void); static #line 107 result_t UARTM$HPLUART$put(uint8_t arg_0xa5afea8); static #line 97 result_t UARTM$HPLUART$stop(void); static # 110 "d:/tinyos-1.x/tos/interfaces/ByteComm.nc" result_t UARTM$ByteComm$txDone(void); static #line 102 result_t UARTM$ByteComm$txByteReady(bool arg_0xa5a66f0); static #line 93 result_t UARTM$ByteComm$rxByteReady(uint8_t arg_0xa58df30, bool arg_0xa5a6080, uint16_t arg_0xa5a61d0); # 81 "d:/tinyos-1.x/tos/system/UARTM.nc" bool UARTM$state; static inline result_t UARTM$Control$init(void); static inline result_t UARTM$Control$start(void); static inline result_t UARTM$Control$stop(void); static inline result_t UARTM$HPLUART$get(uint8_t data); static result_t UARTM$HPLUART$putDone(void); static #line 133 result_t UARTM$ByteComm$txByte(uint8_t data); static # 115 "d:/tinyos-1.x/tos/interfaces/HPLUART.nc" result_t HPLUART0M$UART$get(uint8_t arg_0xa5c8400); static result_t HPLUART0M$UART$putDone(void); static # 86 "d:/tinyos-1.x/tos/interfaces/Interrupt.nc" result_t HPLUART0M$Interrupt$enable(void); static # 81 "d:/tinyos-1.x/tos/platform/mica2/HPLUART0M.nc" result_t HPLUART0M$UART$init(void); static inline #line 103 result_t HPLUART0M$UART$stop(void); void __attribute((signal)) __vector_18(void); void __attribute((interrupt)) __vector_20(void); static inline result_t HPLUART0M$UART$put(uint8_t data); # 73 "d:/tinyos-1.x/tos/system/LedsC.nc" uint8_t LedsC$ledsOn; enum LedsC$__nesc_unnamed4346 { LedsC$RED_BIT = 1, LedsC$GREEN_BIT = 2, LedsC$YELLOW_BIT = 4 }; static inline result_t LedsC$Leds$init(void); static inline result_t LedsC$Leds$redOn(void); static inline result_t LedsC$Leds$redOff(void); static result_t LedsC$Leds$redToggle(void); static inline result_t LedsC$Leds$greenOn(void); static inline result_t LedsC$Leds$greenOff(void); static result_t LedsC$Leds$greenToggle(void); static inline result_t LedsC$Leds$yellowOn(void); static inline result_t LedsC$Leds$yellowOff(void); static result_t LedsC$Leds$yellowToggle(void); static inline #line 187 result_t LedsC$Leds$set(uint8_t ledsNum); static # 198 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" TinyDBError TupleRouterM$addResults(QueryResult *arg_0xa6366b0, ParsedQuery *arg_0xa636810, Expr *arg_0xa636968); static # 61 "d:/tinyos-1.x/tos/interfaces/AbsoluteTimer.nc" result_t TupleRouterM$AbsoluteTimer$cancel(void); static #line 55 result_t TupleRouterM$AbsoluteTimer$set(tos_time_t arg_0xa4fed40); static # 70 "d:/tinyos-1.x/tos/interfaces/TimeUtil.nc" tos_time_t TupleRouterM$TimeUtil$addUint32(tos_time_t arg_0xa4fa690, uint32_t arg_0xa4fa7d8); static # 65 "d:/tinyos-1.x/tos/interfaces/CommandUse.nc" CommandDescPtr TupleRouterM$CommandUse$getCommand(char *arg_0xa345b78); static # 81 "d:/tinyos-1.x/tos/lib/TinyDB/QueryProcessor.nc" result_t TupleRouterM$QueryProcessor$queryComplete(ParsedQueryPtr arg_0xa30f3e0); static # 151 "d:/tinyos-1.x/tos/lib/TinyDB/TupleIntf.nc" TinyDBError TupleRouterM$TupleIntf$getNextEmptyFieldIdx(ParsedQueryPtr arg_0xa5fd7a0, TuplePtr arg_0xa5fd8e8, uint8_t *arg_0xa5fda48); static #line 144 AttrDescPtr TupleRouterM$TupleIntf$getNextQueryField(ParsedQueryPtr arg_0xa5fd1c8, TuplePtr arg_0xa5fd310); static #line 116 CharPtr TupleRouterM$TupleIntf$getFieldPtr(ParsedQueryPtr arg_0xa5fef10, TuplePtr arg_0xa5ff058, uint8_t arg_0xa5ff1a0); static #line 136 result_t TupleRouterM$TupleIntf$tupleInit(ParsedQueryPtr arg_0xa5fc650, TuplePtr arg_0xa5fc798); static #line 90 result_t TupleRouterM$TupleIntf$setField(ParsedQueryPtr arg_0xa605740, TuplePtr arg_0xa605888, uint8_t arg_0xa6059d0, CharPtr arg_0xa605b10); static #line 75 uint16_t TupleRouterM$TupleIntf$tupleSize(ParsedQueryPtr arg_0xa604d30); static # 88 "d:/tinyos-1.x/tos/lib/TinyDB/Operator.nc" TinyDBError TupleRouterM$SelOperator$processTuple(ParsedQueryPtr arg_0xa60e468, TuplePtr arg_0xa60e5b0, ExprPtr arg_0xa60e6f0); static # 86 "d:/tinyos-1.x/tos/lib/TinyDB/Network.nc" QueryResultPtr TupleRouterM$Network$getDataPayLoad(TOS_MsgPtr arg_0xa317de8); static #line 135 QueryMessagePtr TupleRouterM$Network$getQueryPayLoad(TOS_MsgPtr arg_0xa3201c8); static #line 110 QueryRequestMessagePtr TupleRouterM$Network$getQueryRequestPayLoad(TOS_MsgPtr arg_0xa31af88); static TinyDBError TupleRouterM$Network$sendQueryRequest(TOS_MsgPtr arg_0xa31b588, uint16_t arg_0xa31b6d0); static #line 142 TinyDBError TupleRouterM$Network$sendQueryMessage(TOS_MsgPtr arg_0xa3207b8); static #line 92 TinyDBError TupleRouterM$Network$sendDataMessage(TOS_MsgPtr arg_0xa31a4f0); static # 71 "d:/tinyos-1.x/tos/lib/TinyDB/Table.nc" result_t TupleRouterM$Table$addNamedField(ParsedQuery *arg_0xa623960, uint8_t arg_0xa623aa0, char *arg_0xa623bf0, uint8_t arg_0xa623d30); static # 67 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkMonitor.nc" void TupleRouterM$NetworkMonitor$updateContention(bool arg_0xa326c90, int arg_0xa326dc8); static # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" result_t TupleRouterM$TimerControl$init(void); static result_t TupleRouterM$TimerControl$start(void); static # 72 "d:/tinyos-1.x/tos/interfaces/AttrUse.nc" AttrDescPtr TupleRouterM$AttrUse$getAttrById(uint8_t arg_0xa5e4d58); static #line 66 AttrDescPtr TupleRouterM$AttrUse$getAttr(char *arg_0xa5e4850); static #line 91 result_t TupleRouterM$AttrUse$getAttrValue(char *arg_0xa5e5928, char *arg_0xa5e5a80, SchemaErrorNo *arg_0xa5e5be0); static #line 108 result_t TupleRouterM$AttrUse$startAttr(uint8_t arg_0xa5e2ff0); static # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" result_t TupleRouterM$ChildControl$init(void); static result_t TupleRouterM$ChildControl$start(void); static result_t TupleRouterM$ChildControl$stop(void); static # 56 "d:/tinyos-1.x/tos/interfaces/TimeSet.nc" void TupleRouterM$TimeSet$set(tos_time_t arg_0xa4fc1e8); static # 73 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQueryIntf.nc" bool TupleRouterM$ParsedQueryIntf$queryFieldIsNull(uint8_t arg_0xa601520); static #line 97 short TupleRouterM$ParsedQueryIntf$baseSize(QueryPtr arg_0xa5f7930); static #line 87 uint8_t TupleRouterM$ParsedQueryIntf$getFieldId(ParsedQueryPtr arg_0xa5f68c8, uint8_t arg_0xa5f6a08); static result_t TupleRouterM$ParsedQueryIntf$setExpr(ParsedQueryPtr arg_0xa5f6e38, uint8_t arg_0xa5f6f78, Expr arg_0xa5f70b8); static #line 84 ExprPtr TupleRouterM$ParsedQueryIntf$getExprPtr(ParsedQueryPtr arg_0xa5f6348, uint8_t arg_0xa5f6488); static TuplePtr TupleRouterM$ParsedQueryIntf$getTuplePtr(ParsedQueryPtr arg_0xa5f74f8); static #line 140 bool TupleRouterM$ParsedQueryIntf$typeCheck(ParsedQuery *arg_0xa613b80, ParsedQuery *arg_0xa613ce0); static #line 81 Expr TupleRouterM$ParsedQueryIntf$getExpr(ParsedQueryPtr arg_0xa601da8, uint8_t arg_0xa601ee8); static # 51 "d:/tinyos-1.x/tos/interfaces/Time.nc" tos_time_t TupleRouterM$Time$get(void); static # 113 "d:/tinyos-1.x/tos/lib/TinyDB/Operator.nc" TinyDBError TupleRouterM$AggOperator$processPartialResult(QueryResultPtr arg_0xa60f9b0, ParsedQueryPtr arg_0xa60faf8, ExprPtr arg_0xa60fc38); static #line 88 TinyDBError TupleRouterM$AggOperator$processTuple(ParsedQueryPtr arg_0xa60e468, TuplePtr arg_0xa60e5b0, ExprPtr arg_0xa60e6f0); static #line 123 result_t TupleRouterM$AggOperator$endOfEpoch(ParsedQueryPtr arg_0xa60c1a8, ExprPtr arg_0xa60c2e8); static # 149 "d:/tinyos-1.x/tos/interfaces/Leds.nc" result_t TupleRouterM$Leds$yellowOff(void); static #line 141 result_t TupleRouterM$Leds$yellowOn(void); static #line 124 result_t TupleRouterM$Leds$greenOff(void); static #line 99 result_t TupleRouterM$Leds$redOff(void); static #line 133 result_t TupleRouterM$Leds$greenToggle(void); static #line 158 result_t TupleRouterM$Leds$yellowToggle(void); static #line 108 result_t TupleRouterM$Leds$redToggle(void); static #line 176 result_t TupleRouterM$Leds$set(uint8_t arg_0xa352fa8); static #line 91 result_t TupleRouterM$Leds$redOn(void); static #line 116 result_t TupleRouterM$Leds$greenOn(void); static # 105 "d:/tinyos-1.x/tos/lib/TinyDB/QueryResultIntf.nc" TinyDBError TupleRouterM$QueryResultIntf$initQueryResult(QueryResultPtr arg_0xa617878); static #line 142 TinyDBError TupleRouterM$QueryResultIntf$fromBytes(QueryResultPtr arg_0xa62bb48, QueryResultPtr arg_0xa62bc90, ParsedQueryPtr arg_0xa62bdd8); static short TupleRouterM$QueryResultIntf$numRecords(QueryResultPtr arg_0xa628df8, ParsedQueryPtr arg_0xa628f40); static #line 149 short TupleRouterM$QueryResultIntf$queryIdFromMsg(QueryResultPtr arg_0xa6289b8); static #line 113 TinyDBError TupleRouterM$QueryResultIntf$fromTuple(QueryResultPtr arg_0xa617dd8, ParsedQueryPtr arg_0xa617f20, TuplePtr arg_0xa62a080); static # 140 "d:/tinyos-1.x/tos/lib/TinyDB/DBBuffer.nc" TinyDBError TupleRouterM$DBBuffer$getField(uint8_t arg_0xa6421c8, QueryResult *arg_0xa642328, uint8_t arg_0xa642468, char *arg_0xa6425c0); static #line 85 TinyDBError TupleRouterM$DBBuffer$enqueue(uint8_t arg_0xa62ddd8, QueryResultPtr arg_0xa62df20, bool *arg_0xa61e098, ParsedQueryPtr arg_0xa61e1e0); static #line 122 TinyDBError TupleRouterM$DBBuffer$getResult(uint8_t arg_0xa61f138, uint16_t arg_0xa61f280, QueryResult *arg_0xa61f3e0, bool *arg_0xa61f538); static #line 165 ParsedQuery **TupleRouterM$DBBuffer$getSchema(uint8_t arg_0xa640718); static #line 191 TinyDBError TupleRouterM$DBBuffer$qidFromBufferId(uint8_t arg_0xa641ee8, uint8_t *arg_0xa63e060); static #line 107 TinyDBError TupleRouterM$DBBuffer$peek(uint8_t arg_0xa61e798, QueryResult *arg_0xa61e8f8, bool *arg_0xa61ea50); static #line 188 TinyDBError TupleRouterM$DBBuffer$getBufferIdFromName(char *arg_0xa6418c0, uint8_t *arg_0xa641a20); static #line 131 TinyDBError TupleRouterM$DBBuffer$getFieldId(uint8_t arg_0xa61f950, FieldPtr arg_0xa61fa98, uint8_t *arg_0xa61fbf0); static #line 170 TinyDBError TupleRouterM$DBBuffer$nextUnusedBuffer(uint8_t *arg_0xa640ba8); static #line 155 TinyDBError TupleRouterM$DBBuffer$alloc(uint8_t arg_0xa642bd8, BufferType arg_0xa642d20, uint16_t arg_0xa642e68, BufferPolicy arg_0xa642fb0, ParsedQuery *arg_0xa643120, char *arg_0xa643270, bool *arg_0xa6433c8, long arg_0xa643500); static #line 193 TinyDBError TupleRouterM$DBBuffer$openBuffer(uint8_t arg_0xa63e528, bool *arg_0xa63e680); static #line 181 TinyDBError TupleRouterM$DBBuffer$getBufferId(uint8_t arg_0xa641038, bool arg_0xa641180, uint8_t *arg_0xa6412e0); static #line 162 TinyDBError TupleRouterM$DBBuffer$size(uint8_t arg_0xa640180, uint16_t *arg_0xa6402e0); static # 146 "d:/tinyos-1.x/tos/interfaces/MemAlloc.nc" int16_t TupleRouterM$MemAlloc$size(Handle arg_0xa609bd0); static #line 118 result_t TupleRouterM$MemAlloc$unlock(Handle arg_0xa608ef0); static #line 108 result_t TupleRouterM$MemAlloc$lock(Handle arg_0xa608a00); static #line 97 result_t TupleRouterM$MemAlloc$reallocate(Handle arg_0xa6083e0, int16_t arg_0xa608520); static #line 85 result_t TupleRouterM$MemAlloc$allocate(HandlePtr arg_0xa60bd50, int16_t arg_0xa60be90); static #line 128 int16_t TupleRouterM$MemAlloc$free(Handle arg_0xa6093b0); static # 81 "d:/tinyos-1.x/tos/lib/TinyDB/QueryIntf.nc" Field TupleRouterM$QueryIntf$getField(QueryPtr arg_0xa5e7958, uint8_t arg_0xa5e7a98); static #line 78 short TupleRouterM$QueryIntf$size(QueryPtr arg_0xa5e7528); static #line 101 result_t TupleRouterM$QueryIntf$setExpr(QueryPtr arg_0xa5fb110, uint8_t arg_0xa5fb250, Expr arg_0xa5fb390); static #line 84 Field *TupleRouterM$QueryIntf$getFieldPtr(QueryPtr arg_0xa5e7ec8, uint8_t arg_0xa5fa030); static #line 104 bool TupleRouterM$QueryIntf$fieldsComplete(Query arg_0xa5fb840); static #line 91 result_t TupleRouterM$QueryIntf$setField(QueryPtr arg_0xa5fa488, uint8_t arg_0xa5fa5c8, Field arg_0xa5fa708); static #line 107 bool TupleRouterM$QueryIntf$exprsComplete(Query arg_0xa5fbc70); static #line 94 Expr TupleRouterM$QueryIntf$getExpr(QueryPtr arg_0xa5faba0, uint8_t arg_0xa5face0); static # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" result_t TupleRouterM$NetControl$init(void); static result_t TupleRouterM$NetControl$start(void); static result_t TupleRouterM$NetControl$stop(void); static # 61 "d:/tinyos-1.x/tos/interfaces/ServiceScheduler.nc" result_t TupleRouterM$ServiceScheduler$remove(uint8_t arg_0xa621e00); static #line 39 result_t TupleRouterM$ServiceScheduler$reschedule(uint8_t arg_0xa620f28, tos_service_schedule arg_0xa621098); static # 78 "d:/tinyos-1.x/tos/interfaces/Interrupt.nc" bool TupleRouterM$Interrupt$disable(void); static result_t TupleRouterM$Interrupt$enable(void); # 226 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" enum TupleRouterM$__nesc_unnamed4347 { #line 226 TupleRouterM$kMS_PER_CLOCK_EVENT = 64 }; enum TupleRouterM$__nesc_unnamed4348 { #line 228 TupleRouterM$UDF_WAIT_LOOP = 100 }; #line 229 enum TupleRouterM$__nesc_unnamed4349 { #line 229 TupleRouterM$EPOCHS_TIL_DELETION = 5 }; #line 230 enum TupleRouterM$__nesc_unnamed4350 { #line 230 TupleRouterM$SYNC_US = 1000 }; typedef enum TupleRouterM$__nesc_unnamed4351 { TupleRouterM$STATE_ALLOC_PARSED_QUERY = 0, TupleRouterM$STATE_ALLOC_IN_FLIGHT_QUERY, TupleRouterM$STATE_RESIZE_QUERY, TupleRouterM$STATE_NOT_ALLOCING, TupleRouterM$STATE_ALLOC_QUERY_RESULT } TupleRouterM$AllocState; typedef struct TupleRouterM$__nesc_unnamed4352 { void **next; ParsedQuery q; } *TupleRouterM$QueryListPtr; #line 243 typedef struct TupleRouterM$__nesc_unnamed4352 ** TupleRouterM$QueryListHandle; #line 243 typedef struct TupleRouterM$__nesc_unnamed4352 TupleRouterM$QueryListEl; typedef void (*TupleRouterM$MemoryCallback)(Handle *memory); typedef struct TupleRouterM$__nesc_unnamed4353 { bool isAttr; bool isNull; union TupleRouterM$__nesc_unnamed4354 { AttrDescPtr attr; uint8_t tupleIdx; } u; } TupleRouterM$TupleFieldDesc; enum TupleRouterM$__nesc_unnamed4355 { #line 265 TupleRouterM$READING_BIT = 0x0001, TupleRouterM$PARSING_BIT = 0x0002, TupleRouterM$ALLOCED_BIT = 0x0004, TupleRouterM$FETCHING_BIT = 0x0008, TupleRouterM$ROUTING_BIT = 0x0010, TupleRouterM$DELIVERING_BIT = 0x0020, TupleRouterM$SENDING_BIT = 0x0040, TupleRouterM$AGGREGATING_BIT = 0x0080, TupleRouterM$SENDING_QUERY_BIT = 0x0100, TupleRouterM$IN_QUERY_MSG_BIT = 0x0200, TupleRouterM$SETTING_SAMPLE_RATE_BIT = 0x0400, TupleRouterM$SNOOZING_BIT = 0x0800, TupleRouterM$ATTR_STARTING_BIT = 0x1000, TupleRouterM$OPENING_WRITE_BUF_BIT = 0x2000 }; #line 293 enum TupleRouterM$__nesc_unnamed4356 { #line 293 TupleRouterM$WAKING_CLOCKS = 16 }; char TupleRouterM$mDbgMsg[20]; TOS_Msg TupleRouterM$mMsg; uint16_t TupleRouterM$mPendingMask; uint8_t TupleRouterM$mCycleToSend; TupleRouterM$QueryListHandle TupleRouterM$mQs; TupleRouterM$QueryListHandle TupleRouterM$mTail; Query **TupleRouterM$mCurQuery; Query *TupleRouterM$mCurQueryPtr; Handle TupleRouterM$mTmpHandle; TupleRouterM$MemoryCallback TupleRouterM$mAllocCallback; uint8_t TupleRouterM$mFetchingFieldId; char TupleRouterM$mCurExpr; Tuple *TupleRouterM$mCurTuple; TupleRouterM$QueryListHandle TupleRouterM$mCurRouteQuery; QueryResult TupleRouterM$mResult; #line 322 QueryResult TupleRouterM$mEnqResult; short TupleRouterM$mFetchTries; TupleRouterM$AllocState TupleRouterM$mAllocState; short TupleRouterM$mOldRate; TupleRouterM$QueryListHandle TupleRouterM$mCurSendingQuery; char TupleRouterM$mCurSendingField; char TupleRouterM$mCurSendingExpr; TOS_Msg TupleRouterM$mQmsg; bool TupleRouterM$mTriedAllocWaiting; bool TupleRouterM$mTriedQueryRequest; bool TupleRouterM$mAllQueriesSameRate; bool TupleRouterM$mFixedComm; bool TupleRouterM$mSendQueryNextClock; bool TupleRouterM$mSending; char *TupleRouterM$mResultBuf; ParsedQuery *TupleRouterM$mLastQuery; ParsedQuery *TupleRouterM$mTempPQ; uint8_t TupleRouterM$mCurField; uint16_t TupleRouterM$mLifetime; uint8_t TupleRouterM$mCurSampleRateQuery; uint16_t TupleRouterM$mVoltage; uint16_t TupleRouterM$mNumBlocked; uint16_t TupleRouterM$mClockCount; bool TupleRouterM$mIsRunning; bool TupleRouterM$mStopped; bool TupleRouterM$mRadioWaiting; bool TupleRouterM$mSendingResult; uint8_t TupleRouterM$mCurTupleIdx; uint8_t TupleRouterM$mQidToRemove; bool TupleRouterM$mForceRemove; uint8_t TupleRouterM$mNumAttrs; bool TupleRouterM$mMustTimestamp; TOS_MsgPtr TupleRouterM$mTimestampMsg; uint16_t TupleRouterM$mQueryClockCount; uint8_t TupleRouterM$mSendFailed; static inline void TupleRouterM$SET_READING_QUERY(void); static inline void TupleRouterM$UNSET_READING_QUERY(void); static inline bool TupleRouterM$IS_READING_QUERY(void); static inline void TupleRouterM$SET_PARSING_QUERY(void); static inline void TupleRouterM$UNSET_PARSING_QUERY(void); static inline bool TupleRouterM$IS_SPACE_ALLOCED(void); static inline void TupleRouterM$UNSET_SPACE_ALLOCED(void); static inline void TupleRouterM$SET_SPACE_ALLOCED(void); static inline bool TupleRouterM$IS_FETCHING_ATTRIBUTE(void); static inline void TupleRouterM$UNSET_FETCHING_ATTRIBUTE(void); static inline void TupleRouterM$SET_FETCHING_ATTRIBUTE(void); static inline bool TupleRouterM$IS_STARTING_ATTRIBUTE(void); static inline void TupleRouterM$UNSET_STARTING_ATTRIBUTE(void); static inline void TupleRouterM$SET_STARTING_ATTRIBUTE(void); static inline bool TupleRouterM$IS_ROUTING_TUPLES(void); static inline void TupleRouterM$UNSET_ROUTING_TUPLES(void); static inline void TupleRouterM$SET_ROUTING_TUPLES(void); static inline bool TupleRouterM$IS_DELIVERING_TUPLES(void); static inline void TupleRouterM$UNSET_DELIVERING_TUPLES(void); static inline void TupleRouterM$SET_DELIVERING_TUPLES(void); static inline bool TupleRouterM$IS_SENDING_MESSAGE(void); static inline void TupleRouterM$UNSET_SENDING_MESSAGE(void); static inline void TupleRouterM$SET_SENDING_MESSAGE(void); static inline bool TupleRouterM$IS_AGGREGATING_RESULT(void); static inline void TupleRouterM$UNSET_AGGREGATING_RESULT(void); static inline void TupleRouterM$SET_AGGREGATING_RESULT(void); static inline bool TupleRouterM$IS_SENDING_QUERY(void); static inline void TupleRouterM$UNSET_SENDING_QUERY(void); static inline void TupleRouterM$SET_SENDING_QUERY(void); static inline bool TupleRouterM$IS_IN_QUERY_MSG(void); static inline void TupleRouterM$UNSET_IS_IN_QUERY_MSG(void); static inline void TupleRouterM$SET_IS_IN_QUERY_MSG(void); static inline void TupleRouterM$UNSET_SETTING_SAMPLE_RATE(void); static inline bool TupleRouterM$IS_SNOOZING(void); static inline void TupleRouterM$UNSET_SNOOZING(void); static inline void TupleRouterM$SET_SNOOZING(void); static inline void TupleRouterM$UNSET_OPENING_WRITE_BUF(void); static inline void TupleRouterM$SET_OPENING_WRITE_BUF(void); static inline void TupleRouterM$continueQuery(Handle *memory); static bool TupleRouterM$addQueryField(QueryMessagePtr qmsg); static inline bool TupleRouterM$allocPendingQuery(TupleRouterM$MemoryCallback callback, Query *q); static inline bool TupleRouterM$allocQuery(TupleRouterM$MemoryCallback callback, Query *q); static inline void TupleRouterM$parsedCallback(Handle *memory); static inline bool TupleRouterM$parseQuery(Query *q, ParsedQuery *pq); static void TupleRouterM$parsedQuery(bool success); static void TupleRouterM$continueParsing(result_t success); static inline bool TupleRouterM$queryComplete(Query q); static inline bool TupleRouterM$reallocQueryForTuple(TupleRouterM$MemoryCallback callback, TupleRouterM$QueryListHandle qlh); static inline void TupleRouterM$resizedCallback(Handle *memory); static inline void TupleRouterM$setSampleRate(void); static void TupleRouterM$finishedOpeningWriteBuffer(ParsedQuery *pq); static inline void TupleRouterM$continueFromBufferFetch(TinyDBError err); static inline void TupleRouterM$setRate(uint8_t qid, uint16_t epochDur); static bool TupleRouterM$fetchNextAttr(void); static inline TupleRouterM$TupleFieldDesc TupleRouterM$getNextQueryField(ParsedQuery **q); static TupleRouterM$QueryListHandle TupleRouterM$nextQueryToRoute(TupleRouterM$QueryListHandle curQuery); static inline bool TupleRouterM$routeToQuery(ParsedQuery *q, Tuple *t); static Expr *TupleRouterM$nextExpr(ParsedQuery *q); static bool TupleRouterM$getQuery(uint8_t qid, ParsedQuery **q); static inline void TupleRouterM$startFetchingTuples(void); static inline void TupleRouterM$resetTupleState(ParsedQuery *q); static void TupleRouterM$fillInAttrVal(SchemaErrorNo errorNo); static void TupleRouterM$aggregateResult(ParsedQuery *q, QueryResult *qr, char exprId); static void TupleRouterM$removeQueryTask(void); static TinyDBError TupleRouterM$forwardQuery(QueryMessagePtr qmsg); static void TupleRouterM$finishedBufferSetup(ParsedQuery *pq); static inline void TupleRouterM$keepRouting(void); static inline void TupleRouterM$initConsts(void); static inline void TupleRouterM$decrementQueryCounter(void); static inline void TupleRouterM$failedOpeningWriteBuffer(ParsedQuery *pq); static inline void TupleRouterM$computeRates(uint32_t lifetimeHoursRem, uint32_t curVReading, uint32_t ujSampleCost, uint32_t ujAggCost, uint32_t numMsgs, uint32_t numSamples, uint32_t *epochDur, uint16_t *aggWinSize, uint16_t *vPerDay); static void TupleRouterM$continueSetSampleRate(void); static void TupleRouterM$startQueryAttrs(ParsedQuery *pq); static inline void TupleRouterM$startAllQueryAttrs(void); static #line 548 void TupleRouterM$deliverTuplesTask(void); static void TupleRouterM$routeTask(void); static void TupleRouterM$sendQuery(void); static inline void TupleRouterM$fillInTask(void); static inline void TupleRouterM$mainTask(void); static inline result_t TupleRouterM$StdControl$init(void); static #line 622 result_t TupleRouterM$StdControl$start(void); static #line 656 result_t TupleRouterM$StdControl$stop(void); static inline #line 706 result_t TupleRouterM$Network$querySub(QueryMessagePtr qmsg); static #line 854 TinyDBError TupleRouterM$forwardQuery(QueryMessagePtr qmsg); static inline #line 883 void TupleRouterM$continueQuery(Handle *memory); static #line 932 bool TupleRouterM$addQueryField(QueryMessagePtr qmsg); static #line 981 void TupleRouterM$finishedBufferSetup(ParsedQuery *pq); static inline #line 995 void TupleRouterM$parsedCallback(Handle *memory); static #line 1021 void TupleRouterM$parsedQuery(bool success); static inline #line 1063 void TupleRouterM$resizedCallback(Handle *memory); static inline #line 1172 void TupleRouterM$failedOpeningWriteBuffer(ParsedQuery *pq); static #line 1186 void TupleRouterM$finishedOpeningWriteBuffer(ParsedQuery *pq); static #line 1215 void TupleRouterM$removeQueryTask(void); static #line 1287 void TupleRouterM$sendQuery(void); static inline #line 1396 result_t TupleRouterM$Network$queryRequestSub(QueryRequestMessagePtr qmsg); static inline #line 1453 result_t TupleRouterM$Network$snoopedSub(QueryResultPtr qrMsg, bool isParent, uint16_t senderid); static inline #line 1514 TinyDBError TupleRouterM$SelOperator$processedTuple(Tuple *t, ParsedQuery *q, Expr *e, bool passed); static inline #line 1537 TinyDBError TupleRouterM$AggOperator$processedTuple(Tuple *t, ParsedQuery *q, Expr *e, bool passed); static inline #line 1551 TinyDBError TupleRouterM$AggOperator$processedResult(QueryResult *qr, ParsedQuery *q, Expr *e); static inline #line 1567 result_t TupleRouterM$Network$dataSub(QueryResultPtr qrMsg); static #line 1630 void TupleRouterM$aggregateResult(ParsedQuery *q, QueryResult *qr, char exprId); static inline #line 1657 void TupleRouterM$setSampleRate(void); static inline #line 1782 void TupleRouterM$setRate(uint8_t qid, uint16_t epochDur); #line 1816 enum TupleRouterM$__nesc_unnamed4357 { TupleRouterM$msXmit = 32, TupleRouterM$mahCapacity = 5800, TupleRouterM$maxVReading = 985, TupleRouterM$minVReading = 370, TupleRouterM$Vdraw = 3, TupleRouterM$sPerSample = 1 }; uint32_t TupleRouterM$uaActive; #line 1827 uint32_t TupleRouterM$uaXmit; #line 1827 uint32_t TupleRouterM$uaSleep; static inline void TupleRouterM$initConsts(void); static inline void TupleRouterM$computeRates(uint32_t lifetimeHoursRem, uint32_t curVReading, uint32_t ujSampleCost, uint32_t ujAggCost, uint32_t numMsgs, uint32_t numSamples, uint32_t *epochDur, uint16_t *aggWinSize, uint16_t *mvPerDay); static #line 1913 void TupleRouterM$continueSetSampleRate(void); static #line 1949 result_t TupleRouterM$AbsoluteTimer$fired(void); static inline #line 2005 void TupleRouterM$mainTask(void); static #line 2114 void TupleRouterM$deliverTuplesTask(void); static #line 2276 result_t TupleRouterM$outputDone(TOS_MsgPtr msg); static inline #line 2306 void TupleRouterM$decrementQueryCounter(void); static inline result_t TupleRouterM$Network$sendDataDone(TOS_MsgPtr msg, result_t success); static inline result_t TupleRouterM$Network$sendQueryRequestDone(TOS_MsgPtr msg, result_t success); static inline result_t TupleRouterM$Network$sendQueryDone(TOS_MsgPtr msg, result_t success); static inline void TupleRouterM$startFetchingTuples(void); static inline #line 2383 void TupleRouterM$resetTupleState(ParsedQuery *q); static #line 2412 bool TupleRouterM$fetchNextAttr(void); static inline #line 2505 TupleRouterM$TupleFieldDesc TupleRouterM$getNextQueryField(ParsedQuery **pq); static inline #line 2553 void TupleRouterM$keepRouting(void); static #line 2575 void TupleRouterM$fillInAttrVal(SchemaErrorNo errorNo); static inline #line 2640 void TupleRouterM$fillInTask(void); static inline result_t TupleRouterM$AttrUse$getAttrDone(char *name, char *resultBuf, SchemaErrorNo errorNo); static #line 2670 void TupleRouterM$routeTask(void); static #line 2689 TupleRouterM$QueryListHandle TupleRouterM$nextQueryToRoute(TupleRouterM$QueryListHandle curQuery); static inline #line 2715 bool TupleRouterM$routeToQuery(ParsedQuery *q, Tuple *t); static #line 2745 Expr *TupleRouterM$nextExpr(ParsedQuery *q); static #line 2763 bool TupleRouterM$getQuery(uint8_t qid, ParsedQuery **q); static inline #line 2778 ParsedQueryPtr TupleRouterM$QueryProcessor$getQueryCmd(uint8_t qid); static short TupleRouterM$QueryProcessor$numQueries(void); static #line 2799 ParsedQueryPtr TupleRouterM$QueryProcessor$getQueryIdx(short i); static inline #line 2815 short TupleRouterM$QueryProcessor$msgToQueryRoot(TOS_MsgPtr msg); static inline #line 2846 bool TupleRouterM$parseQuery(Query *q, ParsedQuery *pq); static inline #line 2962 void TupleRouterM$continueFromBufferFetch(TinyDBError err); static #line 3022 void TupleRouterM$continueParsing(result_t success); static inline #line 3076 bool TupleRouterM$allocPendingQuery(TupleRouterM$MemoryCallback callback, Query *q); static inline #line 3090 bool TupleRouterM$allocQuery(TupleRouterM$MemoryCallback callback, Query *q); static inline bool TupleRouterM$reallocQueryForTuple(TupleRouterM$MemoryCallback callback, TupleRouterM$QueryListHandle qlh); static inline #line 3115 bool TupleRouterM$queryComplete(Query q); static #line 3141 result_t TupleRouterM$MemAlloc$allocComplete(Handle *handle, result_t complete); static #line 3188 result_t TupleRouterM$MemAlloc$reallocComplete(Handle handle, result_t complete); static inline #line 3210 result_t TupleRouterM$MemAlloc$compactComplete(void); static inline #line 3227 TinyDBError TupleRouterM$RadioQueue$enqueue(const QueryResultPtr qrMsg, bool *pending); static #line 3264 void TupleRouterM$signalError(TinyDBError err, int lineNo); #line 3321 bool TupleRouterM$mStatus; static inline void TupleRouterM$statusMessage(CharPtr m); static inline #line 3378 result_t TupleRouterM$Table$addNamedFieldDone(result_t success); static inline #line 3422 result_t TupleRouterM$DBBuffer$allocComplete(uint8_t bufferId, TinyDBError result); static inline #line 3439 result_t TupleRouterM$DBBuffer$getComplete(uint8_t bufferId, QueryResult *buf, TinyDBError err); static inline #line 3453 result_t TupleRouterM$DBBuffer$putComplete(uint8_t bufferId, QueryResult *buf, TinyDBError err); static inline #line 3520 result_t TupleRouterM$AttrUse$startAttrDone(uint8_t id); static inline void TupleRouterM$RadioReceiveCoordinator$startSymbol(void); static inline void TupleRouterM$RadioReceiveCoordinator$byte(TOS_MsgPtr msg, uint8_t byteCount); static inline void TupleRouterM$RadioSendCoordinator$startSymbol(void); static inline #line 3554 void TupleRouterM$RadioSendCoordinator$byte(TOS_MsgPtr msg, uint8_t byteCount); static # 75 "d:/tinyos-1.x/tos/interfaces/CommandRegister.nc" result_t Command$Cmd$commandFunc( # 50 "d:/tinyos-1.x/tos/lib/Command.nc" uint8_t arg_0xa77e7b0, # 75 "d:/tinyos-1.x/tos/interfaces/CommandRegister.nc" char *arg_0xa778010, char *arg_0xa778168, SchemaErrorNo *arg_0xa7782c8, ParamVals *arg_0xa778428); # 56 "d:/tinyos-1.x/tos/lib/Command.nc" CommandDescs Command$commandDescs; bool Command$addCmdPending; static #line 81 CommandDescPtr Command$CommandUse$getCommand(char *cmd); static inline #line 97 CommandDescPtr Command$CommandUse$getCommandById(uint8_t id); static #line 119 result_t Command$CommandUse$invoke(char *commandName, char *resultBuf, SchemaErrorNo *errorNo, ParamVals *params); static inline #line 154 result_t Command$CommandUse$invokeBuffer(char *ptr, char *resultBuf, SchemaErrorNo *errorNo); static #line 176 result_t Command$CommandUse$invokeMsg(TOS_MsgPtr msg, char *resultBuf, SchemaErrorNo *errorNo); static #line 202 result_t Command$Cmd$registerCommand(uint8_t id, char *commandName, TOSType retType, uint8_t retLen, ParamList *params); static inline #line 255 result_t Command$Cmd$default$commandFunc(uint8_t id, char *commandName, char *resultBuf, SchemaErrorNo *errorNo, ParamVals *params); static # 66 "d:/tinyos-1.x/tos/interfaces/CommandRegister.nc" result_t CommandResetM$ResetCmd$registerCommand(char *arg_0xa77f610, TOSType arg_0xa77f750, uint8_t arg_0xa77f890, ParamList *arg_0xa77f9f8); static # 141 "d:/tinyos-1.x/tos/interfaces/Leds.nc" result_t CommandResetM$Leds$yellowOn(void); static #line 91 result_t CommandResetM$Leds$redOn(void); static #line 116 result_t CommandResetM$Leds$greenOn(void); static # 46 "d:/tinyos-1.x/tos/interfaces/Reset.nc" void CommandResetM$Reset$reset(void); static inline # 58 "d:/tinyos-1.x/tos/lib/Commands/CommandResetM.nc" result_t CommandResetM$StdControl$init(void); static inline result_t CommandResetM$StdControl$start(void); static inline result_t CommandResetM$StdControl$stop(void); static inline result_t CommandResetM$ResetCmd$commandFunc(char *commandName, char *resultBuf, SchemaErrorNo *errorNo, ParamVals *params); static inline # 52 "d:/tinyos-1.x/tos/lib/ResetC.nc" void ResetC$Reset$reset(void); static # 66 "d:/tinyos-1.x/tos/interfaces/CommandRegister.nc" result_t CommandSounderM$SetSound$registerCommand(char *arg_0xa77f610, TOSType arg_0xa77f750, uint8_t arg_0xa77f890, ParamList *arg_0xa77f9f8); static # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" result_t CommandSounderM$SounderControl$init(void); static result_t CommandSounderM$SounderControl$start(void); static result_t CommandSounderM$SounderControl$stop(void); static #line 52 result_t CommandSounderM$TimerControl$init(void); static # 90 "d:/tinyos-1.x/tos/interfaces/Timer.nc" result_t CommandSounderM$Clock1$start(char arg_0xa3f1240, uint32_t arg_0xa3f1390); # 60 "d:/tinyos-1.x/tos/lib/Commands/CommandSounderM.nc" bool CommandSounderM$commandPending; static inline result_t CommandSounderM$StdControl$init(void); static inline #line 73 result_t CommandSounderM$StdControl$start(void); static inline result_t CommandSounderM$StdControl$stop(void); static inline result_t CommandSounderM$SetSound$commandFunc(char *commandName, char *resultBuf, SchemaErrorNo *errorNo, ParamVals *params); static inline result_t CommandSounderM$Clock1$fired(void); static inline # 73 "d:/tinyos-1.x/tos/sensorboards/micasb/SounderM.nc" result_t SounderM$StdControl$init(void); static inline result_t SounderM$StdControl$start(void); static inline result_t SounderM$StdControl$stop(void); static # 108 "d:/tinyos-1.x/tos/interfaces/Leds.nc" result_t CommandPotM$Leds$redToggle(void); static # 114 "d:/tinyos-1.x/tos/interfaces/Pot.nc" result_t CommandPotM$Pot$set(uint8_t arg_0xa2a5618); static # 66 "d:/tinyos-1.x/tos/interfaces/CommandRegister.nc" result_t CommandPotM$SetPot$registerCommand(char *arg_0xa77f610, TOSType arg_0xa77f750, uint8_t arg_0xa77f890, ParamList *arg_0xa77f9f8); static inline # 58 "d:/tinyos-1.x/tos/lib/Commands/CommandPotM.nc" result_t CommandPotM$StdControl$init(void); static inline result_t CommandPotM$StdControl$start(void); static inline result_t CommandPotM$StdControl$stop(void); static inline result_t CommandPotM$SetPot$commandFunc(char *commandName, char *resultBuf, SchemaErrorNo *errorNo, ParamVals *params); static # 66 "d:/tinyos-1.x/tos/interfaces/CommandRegister.nc" result_t CommandLedsM$YellowLedCmd$registerCommand(char *arg_0xa77f610, TOSType arg_0xa77f750, uint8_t arg_0xa77f890, ParamList *arg_0xa77f9f8); static # 149 "d:/tinyos-1.x/tos/interfaces/Leds.nc" result_t CommandLedsM$Leds$yellowOff(void); static #line 141 result_t CommandLedsM$Leds$yellowOn(void); static #line 83 result_t CommandLedsM$Leds$init(void); static #line 124 result_t CommandLedsM$Leds$greenOff(void); static #line 99 result_t CommandLedsM$Leds$redOff(void); static #line 133 result_t CommandLedsM$Leds$greenToggle(void); static #line 158 result_t CommandLedsM$Leds$yellowToggle(void); static #line 108 result_t CommandLedsM$Leds$redToggle(void); static #line 91 result_t CommandLedsM$Leds$redOn(void); static #line 116 result_t CommandLedsM$Leds$greenOn(void); static # 66 "d:/tinyos-1.x/tos/interfaces/CommandRegister.nc" result_t CommandLedsM$GreenLedCmd$registerCommand(char *arg_0xa77f610, TOSType arg_0xa77f750, uint8_t arg_0xa77f890, ParamList *arg_0xa77f9f8); static #line 66 result_t CommandLedsM$RedLedCmd$registerCommand(char *arg_0xa77f610, TOSType arg_0xa77f750, uint8_t arg_0xa77f890, ParamList *arg_0xa77f9f8); static inline # 61 "d:/tinyos-1.x/tos/lib/Commands/CommandLedsM.nc" result_t CommandLedsM$StdControl$init(void); static inline #line 75 result_t CommandLedsM$StdControl$start(void); static inline result_t CommandLedsM$StdControl$stop(void); static inline result_t CommandLedsM$RedLedCmd$commandFunc(char *commandName, char *resultBuf, SchemaErrorNo *errorNo, ParamVals *params); static inline #line 108 result_t CommandLedsM$GreenLedCmd$commandFunc(char *commandName, char *resultBuf, SchemaErrorNo *errorNo, ParamVals *params); static inline #line 131 result_t CommandLedsM$YellowLedCmd$commandFunc(char *commandName, char *resultBuf, SchemaErrorNo *errorNo, ParamVals *params); static # 66 "d:/tinyos-1.x/tos/interfaces/CommandRegister.nc" result_t CommandAttrM$CommandRegister$registerCommand(char *arg_0xa77f610, TOSType arg_0xa77f750, uint8_t arg_0xa77f890, ParamList *arg_0xa77f9f8); static # 51 "d:/tinyos-1.x/tos/interfaces/AttrRegisterConst.nc" result_t CommandAttrM$AttrRegisterConst$registerAttr(char *arg_0xa7c5ee0, TOSType arg_0xa7ec060, char *arg_0xa7ec1b0); static inline # 57 "d:/tinyos-1.x/tos/lib/Commands/CommandAttrM.nc" result_t CommandAttrM$StdControl$init(void); static inline result_t CommandAttrM$StdControl$start(void); static inline result_t CommandAttrM$StdControl$stop(void); static inline result_t CommandAttrM$CommandRegister$commandFunc(char *commandName, char *resultBuf, SchemaErrorNo *errorNo, ParamVals *params); static # 77 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" result_t Attr$Attr$getAttr( # 50 "d:/tinyos-1.x/tos/lib/Attr.nc" uint8_t arg_0xa7eac68, # 77 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" char *arg_0xa7e42f0, char *arg_0xa7e4448, SchemaErrorNo *arg_0xa7e45a8); static #line 96 result_t Attr$Attr$startAttr( # 50 "d:/tinyos-1.x/tos/lib/Attr.nc" uint8_t arg_0xa7eac68); static # 104 "d:/tinyos-1.x/tos/interfaces/AttrUse.nc" result_t Attr$AttrUse$getAttrDone(char *arg_0xa5e2828, char *arg_0xa5e2980, SchemaErrorNo arg_0xa5e2ac8); static result_t Attr$AttrUse$startAttrDone(uint8_t arg_0xa5e3448); # 57 "d:/tinyos-1.x/tos/lib/Attr.nc" AttrDescs Attr$attrDescs; bool Attr$addAttrPending; uint32_t Attr$constAttrs[MAX_CONST_ATTRS]; int Attr$nConstAttrs; static #line 86 result_t Attr$Attr$registerAttr(uint8_t id, char *attrName, TOSType type, uint8_t attrLen); static #line 133 AttrDescPtr Attr$AttrUse$getAttr(char *name); static #line 149 AttrDescPtr Attr$AttrUse$getAttrById(uint8_t attrIdx); static inline #line 162 uint8_t Attr$AttrUse$numAttrs(void); static inline result_t Attr$AttrUse$getAttrValue(char *name, char *resultBuf, SchemaErrorNo *errorNo); static inline #line 185 result_t Attr$AttrUse$startAttr(uint8_t id); static inline #line 211 result_t Attr$ConstAttr$registerAttr(char *name, TOSType attrType, char *attrVal); static inline #line 259 result_t Attr$Attr$getAttrDone(uint8_t id, char *name, char *resultBuf, SchemaErrorNo errorNo); static inline result_t Attr$Attr$startAttrDone(uint8_t id); static inline result_t Attr$Attr$default$getAttr(uint8_t id, char *name, char *resultBuf, SchemaErrorNo *errorNo); static inline result_t Attr$Attr$default$startAttr(uint8_t id); static # 74 "d:/tinyos-1.x/tos/lib/TinyDB/Table.nc" result_t Tuple$Table$getFieldName(ParsedQuery *arg_0xa63af10, uint8_t arg_0xa63b050, char **arg_0xa63b1b8); static #line 72 result_t Tuple$Table$getType(ParsedQuery *arg_0xa63a178, uint8_t arg_0xa63a2c0, uint8_t *arg_0xa63a418); static # 72 "d:/tinyos-1.x/tos/interfaces/AttrUse.nc" AttrDescPtr Tuple$AttrUse$getAttrById(uint8_t arg_0xa5e4d58); static #line 66 AttrDescPtr Tuple$AttrUse$getAttr(char *arg_0xa5e4850); static # 78 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQueryIntf.nc" bool Tuple$ParsedQueryIntf$queryFieldIsTyped(uint8_t arg_0xa601948); static #line 73 bool Tuple$ParsedQueryIntf$queryFieldIsNull(uint8_t arg_0xa601520); static # 71 "d:/tinyos-1.x/tos/lib/TinyDB/CatalogTable.nc" uint8_t Tuple$CatalogTable$catalogFieldSize(uint8_t arg_0xa7f7b98, uint8_t arg_0xa7f7cd8); static # 165 "d:/tinyos-1.x/tos/lib/TinyDB/DBBuffer.nc" ParsedQuery **Tuple$DBBuffer$getSchema(uint8_t arg_0xa640718); static #line 181 TinyDBError Tuple$DBBuffer$getBufferId(uint8_t arg_0xa641038, bool arg_0xa641180, uint8_t *arg_0xa6412e0); static inline # 90 "d:/tinyos-1.x/tos/lib/TinyDB/Tuple.nc" uint16_t Tuple$typeToSize(TOSType type); static uint16_t Tuple$TupleIntf$tupleSize(ParsedQueryPtr q); static #line 106 uint16_t Tuple$TupleIntf$fieldSize(ParsedQueryPtr q, uint8_t fieldNo); static #line 170 result_t Tuple$TupleIntf$setField(ParsedQueryPtr q, TuplePtr t, uint8_t fieldIdx, CharPtr data); static inline #line 183 result_t Tuple$TupleIntf$setFieldNoQuery(TuplePtr t, uint8_t fieldIdx, uint8_t numFields, uint8_t sizes[], uint8_t types[], CharPtr data); static #line 202 CharPtr Tuple$TupleIntf$getFieldPtr(ParsedQueryPtr q, TuplePtr t, uint8_t fieldIdx); static #line 219 CharPtr Tuple$TupleIntf$getFieldPtrNoQuery(TuplePtr t, uint8_t fieldIdx, uint8_t numFields, uint8_t sizes[], uint8_t types[]); static inline result_t Tuple$TupleIntf$tupleInit(ParsedQueryPtr q, TuplePtr t); static inline #line 258 AttrDescPtr Tuple$TupleIntf$getNextQueryField(ParsedQueryPtr q, TuplePtr t); static #line 272 TinyDBError Tuple$TupleIntf$getNextEmptyFieldIdx(ParsedQueryPtr q, TuplePtr t, uint8_t *fieldIdx); static inline #line 286 uint16_t Tuple$typeToSize(TOSType type); static inline result_t Tuple$AttrUse$getAttrDone(char *name, char *resultBuf, SchemaErrorNo errorNo); static inline result_t Tuple$AttrUse$startAttrDone(uint8_t id); static inline result_t Tuple$QueryProcessor$queryComplete(ParsedQueryPtr q); static inline result_t Tuple$Table$addNamedFieldDone(result_t success); static inline #line 314 result_t Tuple$DBBuffer$allocComplete(uint8_t bufferId, TinyDBError result); static inline result_t Tuple$DBBuffer$getComplete(uint8_t bufferId, QueryResult *buf, TinyDBError result); static inline result_t Tuple$DBBuffer$putComplete(uint8_t bufferId, QueryResult *buf, TinyDBError err); static inline # 68 "d:/tinyos-1.x/tos/lib/TinyDB/Query.nc" short Query$QueryIntf$size(QueryPtr q); static inline Field Query$QueryIntf$getField(QueryPtr q, uint8_t idx); static inline Field *Query$QueryIntf$getFieldPtr(QueryPtr q, uint8_t idx); static inline result_t Query$QueryIntf$setField(QueryPtr q, uint8_t idx, Field f); static Expr Query$QueryIntf$getExpr(QueryPtr q, uint8_t idx); static inline result_t Query$QueryIntf$setExpr(QueryPtr q, uint8_t idx, Expr e); static inline bool Query$QueryIntf$fieldsComplete(Query q); static inline bool Query$QueryIntf$exprsComplete(Query q); static # 80 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQuery.nc" short ParsedQuery$getGroupNoFromQr(QueryResult *arg_0xa829df0); static # 116 "d:/tinyos-1.x/tos/lib/TinyDB/TupleIntf.nc" CharPtr ParsedQuery$TupleIntf$getFieldPtr(ParsedQueryPtr arg_0xa5fef10, TuplePtr arg_0xa5ff058, uint8_t arg_0xa5ff1a0); static #line 80 uint16_t ParsedQuery$TupleIntf$fieldSize(ParsedQueryPtr arg_0xa605180, uint8_t arg_0xa6052c0); static # 73 "d:/tinyos-1.x/tos/lib/TinyDB/Table.nc" result_t ParsedQuery$Table$getNamedField(ParsedQuery *arg_0xa63a840, char *arg_0xa63a990, uint8_t *arg_0xa63aae8); static #line 72 result_t ParsedQuery$Table$getType(ParsedQuery *arg_0xa63a178, uint8_t arg_0xa63a2c0, uint8_t *arg_0xa63a418); static # 72 "d:/tinyos-1.x/tos/interfaces/AttrUse.nc" AttrDescPtr ParsedQuery$AttrUse$getAttrById(uint8_t arg_0xa5e4d58); static #line 66 AttrDescPtr ParsedQuery$AttrUse$getAttr(char *arg_0xa5e4850); static # 94 "d:/tinyos-1.x/tos/lib/TinyDB/Operator.nc" bool ParsedQuery$AggOperator$resultIsForExpr(QueryResultPtr arg_0xa60ebb8, ExprPtr arg_0xa60ecf8); static # 159 "d:/tinyos-1.x/tos/lib/TinyDB/QueryResultIntf.nc" ResultTuple ParsedQuery$QueryResultIntf$getResultTuple(QueryResultPtr arg_0xa629378, short arg_0xa6294b0, ParsedQueryPtr arg_0xa6295f8); static #line 153 short ParsedQuery$QueryResultIntf$numRecords(QueryResultPtr arg_0xa628df8, ParsedQueryPtr arg_0xa628f40); static #line 146 TinyDBError ParsedQuery$QueryResultIntf$fromResultTuple(ResultTuple arg_0xa6282f8, QueryResultPtr arg_0xa628440, ParsedQueryPtr arg_0xa628588); static #line 122 TinyDBError ParsedQuery$QueryResultIntf$toTuplePtr(QueryResultPtr arg_0xa62a598, ParsedQueryPtr arg_0xa62a6e0, TupleHandle arg_0xa62a828); static # 165 "d:/tinyos-1.x/tos/lib/TinyDB/DBBuffer.nc" ParsedQuery **ParsedQuery$DBBuffer$getSchema(uint8_t arg_0xa640718); static #line 181 TinyDBError ParsedQuery$DBBuffer$getBufferId(uint8_t arg_0xa641038, bool arg_0xa641180, uint8_t *arg_0xa6412e0); static # 79 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQuery.nc" TinyDBError ParsedQuery$finalizeAggExpr(QueryResult *arg_0xa8295d0, ParsedQueryPtr arg_0xa829718, Expr *arg_0xa829870, char *arg_0xa8299c8); static inline bool ParsedQuery$ParsedQueryIntf$queryFieldIsNull(uint8_t field); static inline bool ParsedQuery$ParsedQueryIntf$queryFieldIsTyped(uint8_t field); static Expr ParsedQuery$ParsedQueryIntf$getExpr(ParsedQueryPtr q, uint8_t n); static ExprPtr ParsedQuery$ParsedQueryIntf$getExprPtr(ParsedQueryPtr q, uint8_t n); static inline uint8_t ParsedQuery$ParsedQueryIntf$getFieldId(ParsedQueryPtr q, uint8_t n); static inline result_t ParsedQuery$ParsedQueryIntf$setExpr(ParsedQueryPtr q, uint8_t n, Expr e); static TuplePtr ParsedQuery$ParsedQueryIntf$getTuplePtr(ParsedQueryPtr q); static inline short ParsedQuery$ParsedQueryIntf$baseSize(QueryPtr q); static short ParsedQuery$ParsedQueryIntf$pqSize(ParsedQueryPtr pq); static inline #line 150 TinyDBError ParsedQuery$ParsedQueryIntf$getResultField(ParsedQueryPtr q, QueryResultPtr qr, uint8_t resultid, char *result_buf); static inline #line 212 TinyDBError ParsedQuery$ParsedQueryIntf$getResultId(ParsedQueryPtr q, Field *f, uint8_t *id); static #line 291 result_t ParsedQuery$ParsedQueryIntf$getFieldType(ParsedQuery *pq, uint8_t fieldIdx, uint8_t *type); static inline #line 342 bool ParsedQuery$ParsedQueryIntf$typeCheck(ParsedQuery *dest, ParsedQuery *select); static inline #line 379 result_t ParsedQuery$AttrUse$getAttrDone(char *name, char *resultBuf, SchemaErrorNo errorNo); static inline result_t ParsedQuery$AttrUse$startAttrDone(uint8_t id); static inline TinyDBError ParsedQuery$AggOperator$processedResult(QueryResultPtr qr, ParsedQueryPtr q, ExprPtr e); static inline TinyDBError ParsedQuery$AggOperator$processedTuple(TuplePtr t, ParsedQueryPtr q, ExprPtr e, bool passed); static inline result_t ParsedQuery$Table$addNamedFieldDone(result_t success); static inline #line 407 result_t ParsedQuery$DBBuffer$allocComplete(uint8_t bufferId, TinyDBError result); static inline result_t ParsedQuery$DBBuffer$getComplete(uint8_t bufferId, QueryResult *buf, TinyDBError result); static inline result_t ParsedQuery$DBBuffer$putComplete(uint8_t bufferId, QueryResult *buf, TinyDBError err); static # 116 "d:/tinyos-1.x/tos/lib/TinyDB/TupleIntf.nc" CharPtr SelOperator$TupleIntf$getFieldPtr(ParsedQueryPtr arg_0xa5fef10, TuplePtr arg_0xa5ff058, uint8_t arg_0xa5ff1a0); static #line 80 uint16_t SelOperator$TupleIntf$fieldSize(ParsedQueryPtr arg_0xa605180, uint8_t arg_0xa6052c0); static # 136 "d:/tinyos-1.x/tos/lib/TinyDB/Operator.nc" TinyDBError SelOperator$Operator$processedTuple(TuplePtr arg_0xa60d0b0, ParsedQueryPtr arg_0xa60d1f8, ExprPtr arg_0xa60d338, bool arg_0xa60d478); static # 70 "d:/tinyos-1.x/tos/lib/TinyDB/ExprEval.nc" short SelOperator$ExprEval$evaluate(Expr *arg_0xa88daf0, short arg_0xa88dc30); # 83 "d:/tinyos-1.x/tos/lib/TinyDB/SelOperator.nc" ParsedQuery *SelOperator$mQs; Tuple *SelOperator$mT; Expr *SelOperator$mE; static inline void SelOperator$doFilter(void); static inline TinyDBError SelOperator$Operator$processTuple(ParsedQueryPtr qs, TuplePtr t, ExprPtr e); static inline #line 106 void SelOperator$doFilter(void); static # 75 "d:/tinyos-1.x/tos/lib/TinyDB/TupleIntf.nc" uint16_t QueryResult$TupleIntf$tupleSize(ParsedQueryPtr arg_0xa604d30); # 94 "d:/tinyos-1.x/tos/lib/TinyDB/QueryResult.nc" enum QueryResult$__nesc_unnamed4358 { QueryResult$BUF_SIZE = 30 }; static inline TinyDBError QueryResult$QueryResultIntf$initQueryResult(QueryResultPtr qr); static inline #line 113 TinyDBError QueryResult$QueryResultIntf$fromTuple(QueryResultPtr qr, ParsedQueryPtr pq, TuplePtr t); static inline #line 131 TinyDBError QueryResult$QueryResultIntf$toTuplePtr(QueryResultPtr qr, ParsedQueryPtr q, TupleHandle t); static TinyDBError QueryResult$QueryResultIntf$toBytes(QueryResultPtr qr, ParsedQueryPtr pq, CharPtr bytes); static #line 189 TinyDBError QueryResult$QueryResultIntf$fromBytes(QueryResultPtr bytes, QueryResultPtr qr, ParsedQueryPtr pq); static #line 222 TinyDBError QueryResult$QueryResultIntf$fromResultTuple(ResultTuple r, QueryResultPtr qr, ParsedQueryPtr pq); static inline #line 243 short QueryResult$QueryResultIntf$queryIdFromMsg(QueryResultPtr qr); static uint16_t QueryResult$QueryResultIntf$resultSize(QueryResultPtr qr, ParsedQueryPtr q); static #line 274 short QueryResult$QueryResultIntf$numRecords(QueryResultPtr qr, ParsedQueryPtr q); static #line 288 ResultTuple QueryResult$QueryResultIntf$getResultTuple(QueryResultPtr qr, short i, ParsedQueryPtr q); static inline #line 338 TinyDBError QueryResult$QueryResultIntf$addAggResult(QueryResultPtr qr, int16_t groupNo, char *bytes, int16_t size, ParsedQueryPtr q, short exprIdx); static inline #line 363 result_t QueryResult$MemAlloc$allocComplete(HandlePtr handle, result_t success); static inline result_t QueryResult$MemAlloc$reallocComplete(Handle handle, result_t success); static inline result_t QueryResult$MemAlloc$compactComplete(void); static # 203 "d:/tinyos-1.x/tos/interfaces/MemAlloc.nc" result_t TinyAlloc$MemAlloc$compactComplete(void); static #line 194 result_t TinyAlloc$MemAlloc$reallocComplete(Handle arg_0xa624f58, result_t arg_0xa6250a0); static #line 181 result_t TinyAlloc$MemAlloc$allocComplete(HandlePtr arg_0xa624908, result_t arg_0xa624a50); # 125 "d:/tinyos-1.x/tos/lib/TinyAlloc.nc" enum TinyAlloc$__nesc_unnamed4359 { TinyAlloc$FRAME_SIZE = 256, TinyAlloc$FREE_SIZE = TinyAlloc$FRAME_SIZE >> 3, TinyAlloc$MAX_SIZE = 32765, TinyAlloc$HEADER_SIZE = 2, TinyAlloc$MAX_HANDLES = 32 }; uint8_t TinyAlloc$mFrame[TinyAlloc$FRAME_SIZE]; uint8_t TinyAlloc$mFree[TinyAlloc$FREE_SIZE]; int8_t TinyAlloc$mAllocing; int8_t TinyAlloc$mCompacting; int16_t TinyAlloc$mSize; int16_t TinyAlloc$mLast; Handle *TinyAlloc$mHandle; int8_t **TinyAlloc$mTmpHandle; Handle TinyAlloc$mOldHandle; int8_t *TinyAlloc$mHandles[TinyAlloc$MAX_HANDLES]; int8_t TinyAlloc$mReallocing; int8_t TinyAlloc$mCompacted; int8_t TinyAlloc$mNeedFree; int16_t TinyAlloc$mContig; int16_t TinyAlloc$mStartByte; uint16_t TinyAlloc$mFreeBytes; static void TinyAlloc$doAlloc(int16_t startByte, int16_t endByte); static inline void TinyAlloc$shiftUp(Handle handle, int bytes); static inline int16_t TinyAlloc$start_offset(int8_t *ptr); static void TinyAlloc$setFreeBits(int16_t startByte, int16_t endByte, int8_t on); static void TinyAlloc$remapAddr(int8_t *oldAddr, int8_t *newAddr); static inline int8_t TinyAlloc$isValid(Handle h); static inline int16_t TinyAlloc$getSize(int8_t *p); static inline int8_t TinyAlloc$isLocked(int8_t *ptr); static int8_t TinyAlloc$finish_realloc(Handle *handle, int8_t success); static inline Handle TinyAlloc$getH(int8_t *p); static inline int16_t TinyAlloc$getNewHandleIdx(void); static void TinyAlloc$markHandleFree(Handle hand); static __inline int8_t *TinyAlloc$deref(Handle h); static void TinyAlloc$compactTask(void); static void TinyAlloc$allocTask(void); static inline void TinyAlloc$reallocDone(void); static inline result_t TinyAlloc$StdControl$init(void); static inline #line 196 result_t TinyAlloc$StdControl$start(void); static result_t TinyAlloc$MemAlloc$allocate(HandlePtr handlePtr, int16_t size); static #line 222 void TinyAlloc$allocTask(void); static #line 309 void TinyAlloc$doAlloc(int16_t startByte, int16_t endByte); static #line 337 void TinyAlloc$compactTask(void); static inline #line 427 void TinyAlloc$shiftUp(Handle hand, int bytes); static #line 455 int16_t TinyAlloc$MemAlloc$free(Handle hand); static #line 491 result_t TinyAlloc$MemAlloc$reallocate(Handle hand, int16_t newSize); static inline #line 534 void TinyAlloc$reallocDone(void); static int8_t TinyAlloc$finish_realloc(Handle *hand, int8_t success); static inline #line 573 result_t TinyAlloc$MemAlloc$lock(Handle handle); static inline result_t TinyAlloc$MemAlloc$unlock(Handle handle); static inline int8_t TinyAlloc$isLocked(int8_t *ptr); static inline int8_t TinyAlloc$isLocked(int8_t *ptr); static int16_t TinyAlloc$MemAlloc$size(Handle h); static inline int16_t TinyAlloc$getSize(int8_t *ptr); static inline uint16_t TinyAlloc$MemAlloc$freeBytes(void); static inline int8_t TinyAlloc$isValid(Handle h); static #line 632 void TinyAlloc$remapAddr(int8_t *oldAddr, int8_t *newAddr); static inline Handle TinyAlloc$getH(int8_t *p); static inline int16_t TinyAlloc$getNewHandleIdx(void); static void TinyAlloc$markHandleFree(Handle hand); static #line 683 void TinyAlloc$setFreeBits(int16_t startByte, int16_t endByte, int8_t on); static inline #line 724 int16_t TinyAlloc$start_offset(int8_t *ptr); static # 116 "d:/tinyos-1.x/tos/lib/TinyDB/TupleIntf.nc" CharPtr AggOperator$TupleIntf$getFieldPtr(ParsedQueryPtr arg_0xa5fef10, TuplePtr arg_0xa5ff058, uint8_t arg_0xa5ff1a0); static #line 80 uint16_t AggOperator$TupleIntf$fieldSize(ParsedQueryPtr arg_0xa605180, uint8_t arg_0xa6052c0); static # 91 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AggregateUse.nc" bool AggOperator$AggregateUse$hasData(uint8_t arg_0xa929e50, char *arg_0xa926010, ParamList *arg_0xa926170, ParamVals *arg_0xa9262d8); static TinyDBError AggOperator$AggregateUse$finalize(uint8_t arg_0xa9266e8, char *arg_0xa926838, char *arg_0xa926990, ParamList *arg_0xa926af0, ParamVals *arg_0xa926c58); static #line 89 uint16_t AggOperator$AggregateUse$stateSize(uint8_t arg_0xa929790, ParamList *arg_0xa9298f0, ParamVals *arg_0xa929a58); static #line 87 result_t AggOperator$AggregateUse$init(uint8_t arg_0xa928da0, char *arg_0xa928ef0, ParamList *arg_0xa929050, ParamVals *arg_0xa9291b8, bool arg_0xa929300); static #line 78 result_t AggOperator$AggregateUse$merge(uint8_t arg_0xa8f59a0, char *arg_0xa8f5af8, char *arg_0xa8f5c50, ParamList *arg_0xa8f5db0, ParamVals *arg_0xa8f5f18); static result_t AggOperator$AggregateUse$update(uint8_t arg_0xa928428, char *arg_0xa928578, char *arg_0xa9286c8, ParamList *arg_0xa928828, ParamVals *arg_0xa928990); static # 88 "d:/tinyos-1.x/tos/lib/TinyDB/AggOperator.nc" void AggOperator$signalError(TinyDBError arg_0xa927b40, int arg_0xa927c78); static # 81 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQueryIntf.nc" Expr AggOperator$ParsedQueryIntf$getExpr(ParsedQueryPtr arg_0xa601da8, uint8_t arg_0xa601ee8); static # 136 "d:/tinyos-1.x/tos/lib/TinyDB/Operator.nc" TinyDBError AggOperator$Operator$processedTuple(TuplePtr arg_0xa60d0b0, ParsedQueryPtr arg_0xa60d1f8, ExprPtr arg_0xa60d338, bool arg_0xa60d478); static #line 127 TinyDBError AggOperator$Operator$processedResult(QueryResultPtr arg_0xa60c9d0, ParsedQueryPtr arg_0xa60cb18, ExprPtr arg_0xa60cc58); static # 97 "d:/tinyos-1.x/tos/interfaces/MemAlloc.nc" result_t AggOperator$MemAlloc$reallocate(Handle arg_0xa6083e0, int16_t arg_0xa608520); static #line 85 result_t AggOperator$MemAlloc$allocate(HandlePtr arg_0xa60bd50, int16_t arg_0xa60be90); static #line 128 int16_t AggOperator$MemAlloc$free(Handle arg_0xa6093b0); static # 177 "d:/tinyos-1.x/tos/lib/TinyDB/QueryResultIntf.nc" TinyDBError AggOperator$QueryResultIntf$addAggResult(QueryResultPtr arg_0xa629ae0, int16_t arg_0xa629c20, char *arg_0xa629d70, int16_t arg_0xa629eb0, ParsedQueryPtr arg_0xa60a010, short arg_0xa60a148); static # 73 "d:/tinyos-1.x/tos/lib/TinyDB/ExprEval.nc" short AggOperator$ExprEval$evaluateGroupBy(AggregateExpression arg_0xa886060, short arg_0xa8861a0); static #line 70 short AggOperator$ExprEval$evaluate(Expr *arg_0xa88daf0, short arg_0xa88dc30); # 95 "d:/tinyos-1.x/tos/lib/TinyDB/AggOperator.nc" typedef struct AggOperator$__nesc_unnamed4360 { int numGroups; int groupSize; char groupData[1]; } AggOperator$GroupData; #line 95 typedef struct AggOperator$__nesc_unnamed4360 * AggOperator$GroupDataPtr; #line 95 typedef struct AggOperator$__nesc_unnamed4360 ** AggOperator$GroupDataHandle; typedef struct AggOperator$__nesc_unnamed4361 { short groupNo; union AggOperator$__nesc_unnamed4362 { bool empty; char exprIdx; } u; char aggdata[1]; } __attribute((packed)) AggOperator$GroupRecord; typedef void (*AggOperator$GroupDataCallback)(AggOperator$GroupRecord *d); AggOperator$GroupDataCallback AggOperator$mCallback; ParsedQuery *AggOperator$mCurQuery; Expr *AggOperator$mCurExpr; QueryResult *AggOperator$mCurResult; Tuple *AggOperator$mCurTuple; short AggOperator$mCurGroup; Handle AggOperator$mAlloced; AggOperator$GroupRecord *AggOperator$mGroupRecord; enum AggOperator$__nesc_unnamed4363 { AggOperator$QUERY_DONE_STATE = 0x1010 }; static void AggOperator$getGroupData(ParsedQuery *pq, short groupNo, Expr *e, AggOperator$GroupDataCallback callback); static inline void AggOperator$updateGroupForTuple(AggOperator$GroupRecord *d); static short AggOperator$groupSize(Expr *e); static inline void AggOperator$mergeAggregateValues(AggOperator$GroupRecord *dest, AggOperator$GroupRecord *merge, Expr *e); static inline void AggOperator$updateAggregateValue(AggOperator$GroupRecord *d, Expr *e, short fieldValue); static void AggOperator$initAggregateValue(AggOperator$GroupRecord *d, Expr *e, bool isFirstTime); static inline void AggOperator$updateGroupForPartialResult(AggOperator$GroupRecord *d); static inline bool AggOperator$aggHasData(AggOperator$GroupRecord *gr, Expr *e); static inline AggOperator$GroupRecord *AggOperator$findGroup(AggOperator$GroupDataHandle dh, short groupNum); static AggOperator$GroupRecord *AggOperator$addGroup(AggOperator$GroupDataHandle dh, short groupNum); static inline bool AggOperator$removeEmptyGroup(AggOperator$GroupDataHandle dh); static inline short AggOperator$getGroupNo(Tuple *t, ParsedQuery *q, Expr *e); static inline AggOperator$GroupRecord *AggOperator$GET_GROUP_DATA(AggOperator$GroupDataHandle dHan, uint8_t n); static void AggOperator$SET_GROUP_DATA(AggOperator$GroupDataHandle dHan, uint8_t n, char *dataptr); static inline #line 177 TinyDBError AggOperator$Operator$processPartialResult(QueryResultPtr qr, ParsedQueryPtr qs, ExprPtr e); static inline #line 197 bool AggOperator$Operator$resultIsForExpr(QueryResultPtr qr, ExprPtr e); static inline void AggOperator$updateGroupForPartialResult(AggOperator$GroupRecord *d); static inline #line 265 TinyDBError AggOperator$addResults(QueryResult *qr, ParsedQuery *pq, ExprPtr e); static inline #line 300 TinyDBError AggOperator$Operator$processTuple(ParsedQueryPtr qs, TuplePtr t, ExprPtr e); static inline #line 314 result_t AggOperator$Operator$endOfEpoch(ParsedQueryPtr q, ExprPtr e); static inline #line 331 result_t AggOperator$QueryProcessor$queryComplete(ParsedQuery *q); static inline #line 349 void AggOperator$updateGroupForTuple(AggOperator$GroupRecord *d); static #line 371 result_t AggOperator$MemAlloc$allocComplete(HandlePtr h, uint8_t success); static #line 395 result_t AggOperator$MemAlloc$reallocComplete(Handle h, uint8_t success); static inline #line 417 result_t AggOperator$MemAlloc$compactComplete(void); static inline AggOperator$GroupRecord *AggOperator$findGroup(AggOperator$GroupDataHandle dh, short groupNum); static inline #line 445 bool AggOperator$removeEmptyGroup(AggOperator$GroupDataHandle dh); static #line 474 AggOperator$GroupRecord *AggOperator$addGroup(AggOperator$GroupDataHandle dh, short groupNum); static #line 514 void AggOperator$getGroupData(ParsedQuery *pq, short groupNo, Expr *e, AggOperator$GroupDataCallback callback); static inline #line 556 short AggOperator$getGroupNo(Tuple *t, ParsedQuery *q, Expr *e); static inline #line 578 short AggOperator$getGroupNoFromQr(QueryResult *qr); static #line 602 short AggOperator$groupSize(Expr *e); static inline #line 615 void AggOperator$mergeAggregateValues(AggOperator$GroupRecord *dest, AggOperator$GroupRecord *merge, Expr *e); static inline #line 630 void AggOperator$updateAggregateValue(AggOperator$GroupRecord *d, Expr *e, short fieldValue); static #line 649 void AggOperator$initAggregateValue(AggOperator$GroupRecord *d, Expr *e, bool isFirstTime); static inline #line 664 bool AggOperator$aggHasData(AggOperator$GroupRecord *gr, Expr *e); static inline TinyDBError AggOperator$finalizeAggExpr(QueryResult *qr, ParsedQueryPtr q, Expr *e, char *result_buf); static # 80 "d:/tinyos-1.x/tos/lib/TinyDB/ExprEvalC.nc" short ExprEvalC$evaluateSimpleExpr(short a, short op, short b); static inline short ExprEvalC$ExprEval$evaluate(Expr *e, short fieldValue); static inline short ExprEvalC$ExprEval$evaluateGroupBy(AggregateExpression a, short grpByFieldValue); static #line 101 short ExprEvalC$evaluateSimpleExpr(short a, short op, short b); static # 102 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/Aggregate.nc" bool AggregateUseM$Agg$hasData( # 15 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AggregateUseM.nc" uint8_t arg_0xa9500a0, # 102 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/Aggregate.nc" char *arg_0xa9835f0, ParamList *arg_0xa983750, ParamVals *arg_0xa9838b8); static #line 92 TinyDBError AggregateUseM$Agg$finalize( # 15 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AggregateUseM.nc" uint8_t arg_0xa9500a0, # 92 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/Aggregate.nc" char *arg_0xa9827f0, char *arg_0xa982948, ParamList *arg_0xa982aa8, ParamVals *arg_0xa982c10); static uint16_t AggregateUseM$Agg$stateSize( # 15 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AggregateUseM.nc" uint8_t arg_0xa9500a0, # 97 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/Aggregate.nc" ParamList *arg_0xa983050, ParamVals *arg_0xa9831b8); static #line 87 result_t AggregateUseM$Agg$init( # 15 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AggregateUseM.nc" uint8_t arg_0xa9500a0, # 87 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/Aggregate.nc" char *arg_0xa951f28, ParamList *arg_0xa982098, ParamVals *arg_0xa982200, bool arg_0xa982348); static #line 75 result_t AggregateUseM$Agg$merge( # 15 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AggregateUseM.nc" uint8_t arg_0xa9500a0, # 75 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/Aggregate.nc" char *arg_0xa950e50, char *arg_0xa950fa8, ParamList *arg_0xa951108, ParamVals *arg_0xa951270); static result_t AggregateUseM$Agg$update( # 15 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AggregateUseM.nc" uint8_t arg_0xa9500a0, # 80 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/Aggregate.nc" char *arg_0xa9516c8, char *arg_0xa951818, ParamList *arg_0xa951978, ParamVals *arg_0xa951ae0); static inline # 21 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AggregateUseM.nc" result_t AggregateUseM$AggregateUse$merge(uint8_t id, char *destdata, char *mergedata, ParamList *params, ParamVals *paramValues); static inline result_t AggregateUseM$AggregateUse$update(uint8_t id, char *destdata, char *value, ParamList *params, ParamVals *paramValues); static inline result_t AggregateUseM$AggregateUse$init(uint8_t id, char *data, ParamList *params, ParamVals *paramValues, bool isFirstTime); static inline uint16_t AggregateUseM$AggregateUse$stateSize(uint8_t id, ParamList *params, ParamVals *paramValues); static inline bool AggregateUseM$AggregateUse$hasData(uint8_t id, char *data, ParamList *params, ParamVals *paramValues); static inline TinyDBError AggregateUseM$AggregateUse$finalize(uint8_t id, char *data, char *result_buf, ParamList *params, ParamVals *paramValues); static inline result_t AggregateUseM$Agg$default$merge(uint8_t id, char *destdata, char *mergedata, ParamList *params, ParamVals *paramValues); static inline result_t AggregateUseM$Agg$default$update(uint8_t id, char *destdata, char *value, ParamList *params, ParamVals *paramValues); static inline result_t AggregateUseM$Agg$default$init(uint8_t id, char *data, ParamList *params, ParamVals *paramValues, bool isFirstTime); static inline uint16_t AggregateUseM$Agg$default$stateSize(uint8_t id, ParamList *params, ParamVals *paramValues); static inline bool AggregateUseM$Agg$default$hasData(uint8_t id, char *data, ParamList *params, ParamVals *paramValues); static inline TinyDBError AggregateUseM$Agg$default$finalize(uint8_t id, char *data, char *result_buf, ParamList *params, ParamVals *paramValues); static inline # 17 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/MaxM.nc" result_t MaxM$Aggregate$merge(char *destdata, char *mergedata, ParamList *params, ParamVals *paramValues); static inline #line 30 result_t MaxM$Aggregate$update(char *destdata, char *value, ParamList *params, ParamVals *paramValues); static inline #line 43 result_t MaxM$Aggregate$init(char *data, ParamList *params, ParamVals *paramValues, bool isFirstTime); static inline uint16_t MaxM$Aggregate$stateSize(ParamList *params, ParamVals *paramValues); static inline bool MaxM$Aggregate$hasData(char *data, ParamList *params, ParamVals *paramValues); static inline TinyDBError MaxM$Aggregate$finalize(char *data, char *result_buf, ParamList *params, ParamVals *paramValues); static inline # 17 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/MinM.nc" result_t MinM$Aggregate$merge(char *destdata, char *mergedata, ParamList *params, ParamVals *paramValues); static inline #line 30 result_t MinM$Aggregate$update(char *destdata, char *value, ParamList *params, ParamVals *paramValues); static inline #line 43 result_t MinM$Aggregate$init(char *data, ParamList *params, ParamVals *paramValues, bool isFirstTime); static inline uint16_t MinM$Aggregate$stateSize(ParamList *params, ParamVals *paramValues); static inline bool MinM$Aggregate$hasData(char *data, ParamList *params, ParamVals *paramValues); static inline TinyDBError MinM$Aggregate$finalize(char *data, char *result_buf, ParamList *params, ParamVals *paramValues); static inline # 17 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/CountM.nc" result_t CountM$Aggregate$merge(char *destdata, char *mergedata, ParamList *params, ParamVals *paramValues); static inline result_t CountM$Aggregate$update(char *destdata, char *value, ParamList *params, ParamVals *paramValues); static inline result_t CountM$Aggregate$init(char *data, ParamList *params, ParamVals *paramValues, bool isFirstTime); static inline uint16_t CountM$Aggregate$stateSize(ParamList *params, ParamVals *paramValues); static inline bool CountM$Aggregate$hasData(char *data, ParamList *params, ParamVals *paramValues); static inline TinyDBError CountM$Aggregate$finalize(char *data, char *result_buf, ParamList *params, ParamVals *paramValues); static inline # 17 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/SumM.nc" result_t SumM$Aggregate$merge(char *destdata, char *mergedata, ParamList *params, ParamVals *paramValues); static inline result_t SumM$Aggregate$update(char *destdata, char *value, ParamList *params, ParamVals *paramValues); static inline result_t SumM$Aggregate$init(char *data, ParamList *params, ParamVals *paramValues, bool isFirstTime); static inline uint16_t SumM$Aggregate$stateSize(ParamList *params, ParamVals *paramValues); static inline bool SumM$Aggregate$hasData(char *data, ParamList *params, ParamVals *paramValues); static inline TinyDBError SumM$Aggregate$finalize(char *data, char *result_buf, ParamList *params, ParamVals *paramValues); static inline # 16 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AvgM.nc" result_t AvgM$Aggregate$merge(char *destdata, char *mergedata, ParamList *params, ParamVals *paramValues); static inline result_t AvgM$Aggregate$update(char *destdata, char *value, ParamList *params, ParamVals *paramValues); static inline result_t AvgM$Aggregate$init(char *data, ParamList *params, ParamVals *paramValues, bool isFirstTime); static inline uint16_t AvgM$Aggregate$stateSize(ParamList *params, ParamVals *paramValues); static inline bool AvgM$Aggregate$hasData(char *data, ParamList *params, ParamVals *paramValues); static inline TinyDBError AvgM$Aggregate$finalize(char *data, char *result_buf, ParamList *params, ParamVals *paramValues); # 15 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/ExpAvgM.nc" typedef struct ExpAvgM$__nesc_unnamed4364 { int16_t value; uint8_t epochsLeft; } ExpAvgM$ExpAvgData; static inline result_t ExpAvgM$Aggregate$merge(char *destdata, char *mergedata, ParamList *params, ParamVals *paramValues); static inline #line 32 result_t ExpAvgM$Aggregate$update(char *destdata, char *value, ParamList *params, ParamVals *paramValues); static inline result_t ExpAvgM$Aggregate$init(char *data, ParamList *params, ParamVals *paramValues, bool isFirstTime); static inline uint16_t ExpAvgM$Aggregate$stateSize(ParamList *params, ParamVals *paramValues); static inline bool ExpAvgM$Aggregate$hasData(char *data, ParamList *params, ParamVals *paramValues); static inline TinyDBError ExpAvgM$Aggregate$finalize(char *data, char *result_buf, ParamList *params, ParamVals *paramValues); static inline # 16 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinMinM.nc" result_t WinMinM$Aggregate$merge(char *destdata, char *mergedata, ParamList *params, ParamVals *paramValues); static inline #line 41 result_t WinMinM$Aggregate$update(char *destdata, char *value, ParamList *params, ParamVals *paramValues); static inline #line 59 result_t WinMinM$Aggregate$init(char *data, ParamList *params, ParamVals *paramValues, bool isFirstTime); static inline #line 89 uint16_t WinMinM$Aggregate$stateSize(ParamList *params, ParamVals *paramValues); static inline #line 102 bool WinMinM$Aggregate$hasData(char *data, ParamList *params, ParamVals *paramValues); static inline TinyDBError WinMinM$Aggregate$finalize(char *data, char *result_buf, ParamList *params, ParamVals *paramValues); static inline # 17 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinMaxM.nc" result_t WinMaxM$Aggregate$merge(char *destdata, char *mergedata, ParamList *params, ParamVals *paramValues); static inline #line 42 result_t WinMaxM$Aggregate$update(char *destdata, char *value, ParamList *params, ParamVals *paramValues); static inline #line 60 result_t WinMaxM$Aggregate$init(char *data, ParamList *params, ParamVals *paramValues, bool isFirstTime); static inline #line 90 uint16_t WinMaxM$Aggregate$stateSize(ParamList *params, ParamVals *paramValues); static inline #line 103 bool WinMaxM$Aggregate$hasData(char *data, ParamList *params, ParamVals *paramValues); static inline TinyDBError WinMaxM$Aggregate$finalize(char *data, char *result_buf, ParamList *params, ParamVals *paramValues); static inline # 17 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinCountM.nc" result_t WinCountM$Aggregate$merge(char *destdata, char *mergedata, ParamList *params, ParamVals *paramValues); static inline #line 36 result_t WinCountM$Aggregate$update(char *destdata, char *value, ParamList *params, ParamVals *paramValues); static inline #line 51 result_t WinCountM$Aggregate$init(char *data, ParamList *params, ParamVals *paramValues, bool isFirstTime); static inline #line 80 uint16_t WinCountM$Aggregate$stateSize(ParamList *params, ParamVals *paramValues); static inline #line 93 bool WinCountM$Aggregate$hasData(char *data, ParamList *params, ParamVals *paramValues); static inline TinyDBError WinCountM$Aggregate$finalize(char *data, char *result_buf, ParamList *params, ParamVals *paramValues); static inline # 17 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinSumM.nc" result_t WinSumM$Aggregate$merge(char *destdata, char *mergedata, ParamList *params, ParamVals *paramValues); static inline #line 36 result_t WinSumM$Aggregate$update(char *destdata, char *value, ParamList *params, ParamVals *paramValues); static inline #line 51 result_t WinSumM$Aggregate$init(char *data, ParamList *params, ParamVals *paramValues, bool isFirstTime); static inline #line 80 uint16_t WinSumM$Aggregate$stateSize(ParamList *params, ParamVals *paramValues); static inline #line 93 bool WinSumM$Aggregate$hasData(char *data, ParamList *params, ParamVals *paramValues); static inline TinyDBError WinSumM$Aggregate$finalize(char *data, char *result_buf, ParamList *params, ParamVals *paramValues); # 17 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinAvgM.nc" typedef struct WinAvgM$__nesc_unnamed4365 { AverageData lastResult; uint8_t head; uint8_t tail; uint8_t size; uint8_t nvals; uint8_t epochsLeft; AverageData value[1]; } WinAvgM$TemporalAverageData; static inline void WinAvgM$addData(WinAvgM$TemporalAverageData *tad, int16_t sum, uint16_t count); static inline result_t WinAvgM$Aggregate$merge(char *destdata, char *mergedata, ParamList *params, ParamVals *paramValues); static inline #line 55 result_t WinAvgM$Aggregate$update(char *destdata, char *value, ParamList *params, ParamVals *paramValues); static inline #line 71 result_t WinAvgM$Aggregate$init(char *data, ParamList *params, ParamVals *paramValues, bool isFirstTime); static inline #line 102 uint16_t WinAvgM$Aggregate$stateSize(ParamList *params, ParamVals *paramValues); static inline #line 115 bool WinAvgM$Aggregate$hasData(char *data, ParamList *params, ParamVals *paramValues); static inline TinyDBError WinAvgM$Aggregate$finalize(char *data, char *result_buf, ParamList *params, ParamVals *paramValues); static inline void WinAvgM$addData(WinAvgM$TemporalAverageData *tad, int16_t sum, uint16_t count); static # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" result_t AttrPotM$AttrRegister$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68); static #line 100 result_t AttrPotM$AttrRegister$startAttrDone(void); static # 139 "d:/tinyos-1.x/tos/interfaces/Pot.nc" uint8_t AttrPotM$Pot$get(void); static inline # 59 "d:/tinyos-1.x/tos/lib/Attributes/AttrPotM.nc" result_t AttrPotM$StdControl$init(void); static inline result_t AttrPotM$StdControl$start(void); static inline result_t AttrPotM$StdControl$stop(void); static inline result_t AttrPotM$AttrRegister$startAttr(void); static inline result_t AttrPotM$AttrRegister$getAttr(char *name, char *resultBuf, SchemaErrorNo *errorNo); static # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" result_t AttrGlobalM$NodeIdAttr$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68); static #line 100 result_t AttrGlobalM$NodeIdAttr$startAttrDone(void); static #line 67 result_t AttrGlobalM$GroupAttr$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68); static #line 100 result_t AttrGlobalM$GroupAttr$startAttrDone(void); static inline # 58 "d:/tinyos-1.x/tos/lib/Attributes/AttrGlobalM.nc" result_t AttrGlobalM$StdControl$init(void); static inline result_t AttrGlobalM$StdControl$start(void); static inline result_t AttrGlobalM$StdControl$stop(void); static inline result_t AttrGlobalM$NodeIdAttr$startAttr(void); static inline result_t AttrGlobalM$NodeIdAttr$getAttr(char *name, char *resultBuf, SchemaErrorNo *errorNo); static inline #line 95 result_t AttrGlobalM$GroupAttr$startAttr(void); static inline result_t AttrGlobalM$GroupAttr$getAttr(char *name, char *resultBuf, SchemaErrorNo *errorNo); static # 96 "d:/tinyos-1.x/tos/lib/TinyDB/QueryProcessor.nc" short TinyDBAttrM$QueryProcessor$numQueries(void); static ParsedQueryPtr TinyDBAttrM$QueryProcessor$getQueryIdx(short arg_0xa2ec580); static # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" result_t TinyDBAttrM$FreeSpaceAttr$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68); static #line 100 result_t TinyDBAttrM$FreeSpaceAttr$startAttrDone(void); static #line 67 result_t TinyDBAttrM$QueueLenAttr$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68); static #line 100 result_t TinyDBAttrM$QueueLenAttr$startAttrDone(void); static #line 67 result_t TinyDBAttrM$MHQueueLenAttr$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68); static #line 100 result_t TinyDBAttrM$MHQueueLenAttr$startAttrDone(void); static #line 67 result_t TinyDBAttrM$QualityAttr$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68); static #line 100 result_t TinyDBAttrM$QualityAttr$startAttrDone(void); static # 66 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkMonitor.nc" uint8_t TinyDBAttrM$NetworkMonitor$getMHopQueueLength(void); static uint8_t TinyDBAttrM$NetworkMonitor$getDepth(void); static uint8_t TinyDBAttrM$NetworkMonitor$getQuality(void); static #line 64 uint16_t TinyDBAttrM$NetworkMonitor$getParent(void); static uint8_t TinyDBAttrM$NetworkMonitor$getQueueLength(void); static # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" result_t TinyDBAttrM$ParentAttr$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68); static #line 100 result_t TinyDBAttrM$ParentAttr$startAttrDone(void); static #line 67 result_t TinyDBAttrM$QidAttr$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68); static #line 100 result_t TinyDBAttrM$QidAttr$startAttrDone(void); static # 168 "d:/tinyos-1.x/tos/interfaces/MemAlloc.nc" uint16_t TinyDBAttrM$MemAlloc$freeBytes(void); static # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" result_t TinyDBAttrM$DepthAttr$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68); static #line 100 result_t TinyDBAttrM$DepthAttr$startAttrDone(void); static inline # 85 "d:/tinyos-1.x/tos/lib/TinyDB/TinyDBAttrM.nc" result_t TinyDBAttrM$StdControl$init(void); static inline #line 101 result_t TinyDBAttrM$StdControl$start(void); static inline result_t TinyDBAttrM$StdControl$stop(void); static inline result_t TinyDBAttrM$ParentAttr$startAttr(void); static inline result_t TinyDBAttrM$ParentAttr$getAttr(char *name, char *resultBuf, SchemaErrorNo *err); static inline #line 147 result_t TinyDBAttrM$FreeSpaceAttr$startAttr(void); static inline result_t TinyDBAttrM$FreeSpaceAttr$getAttr(char *name, char *resultBuf, SchemaErrorNo *err); static inline #line 166 result_t TinyDBAttrM$MemAlloc$reallocComplete(Handle handle, result_t success); static inline result_t TinyDBAttrM$MemAlloc$compactComplete(void); static inline result_t TinyDBAttrM$MemAlloc$allocComplete(HandlePtr handle, result_t success); static inline result_t TinyDBAttrM$QueueLenAttr$startAttr(void); static inline result_t TinyDBAttrM$QueueLenAttr$getAttr(char *name, char *resultBuf, SchemaErrorNo *err); static inline #line 215 result_t TinyDBAttrM$QualityAttr$startAttr(void); static inline result_t TinyDBAttrM$QualityAttr$getAttr(char *name, char *resultBuf, SchemaErrorNo *err); static inline #line 235 result_t TinyDBAttrM$MHQueueLenAttr$startAttr(void); static inline result_t TinyDBAttrM$MHQueueLenAttr$getAttr(char *name, char *resultBuf, SchemaErrorNo *err); static inline #line 255 result_t TinyDBAttrM$DepthAttr$startAttr(void); static inline result_t TinyDBAttrM$DepthAttr$getAttr(char *name, char *resultBuf, SchemaErrorNo *err); static inline #line 275 result_t TinyDBAttrM$QidAttr$startAttr(void); static inline result_t TinyDBAttrM$QidAttr$getAttr(char *name, char *resultBuf, SchemaErrorNo *err); static inline #line 302 result_t TinyDBAttrM$QueryProcessor$queryComplete(ParsedQueryPtr q); static # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" result_t AttrTimeM$TimeHighAttr$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68); static #line 100 result_t AttrTimeM$TimeHighAttr$startAttrDone(void); static # 54 "d:/tinyos-1.x/tos/interfaces/Time.nc" uint32_t AttrTimeM$Time$getHigh32(void); static uint32_t AttrTimeM$Time$getLow32(void); static # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" result_t AttrTimeM$TimeLowAttr$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68); static #line 100 result_t AttrTimeM$TimeLowAttr$startAttrDone(void); static inline # 57 "d:/tinyos-1.x/tos/lib/Attributes/AttrTimeM.nc" result_t AttrTimeM$StdControl$init(void); static inline result_t AttrTimeM$StdControl$start(void); static inline result_t AttrTimeM$StdControl$stop(void); static inline result_t AttrTimeM$TimeLowAttr$startAttr(void); static inline result_t AttrTimeM$TimeLowAttr$getAttr(char *name, char *resultBuf, SchemaErrorNo *errorNo); static inline #line 93 result_t AttrTimeM$TimeHighAttr$startAttr(void); static inline result_t AttrTimeM$TimeHighAttr$getAttr(char *name, char *resultBuf, SchemaErrorNo *errorNo); static # 116 "d:/tinyos-1.x/tos/interfaces/ADCControl.nc" result_t VoltageM$ADCControl$bindPort(uint8_t arg_0xa41fbc0, uint8_t arg_0xa41fd00); static #line 77 result_t VoltageM$ADCControl$init(void); static inline # 75 "d:/tinyos-1.x/tos/system/VoltageM.nc" result_t VoltageM$StdControl$init(void); static inline result_t VoltageM$StdControl$start(void); static inline result_t VoltageM$StdControl$stop(void); static # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" result_t AttrVoltageM$AttrRegister$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68); static #line 91 result_t AttrVoltageM$AttrRegister$getAttrDone(char *arg_0xa7e5138, char *arg_0xa7e5290, SchemaErrorNo arg_0xa7e53d8); static result_t AttrVoltageM$AttrRegister$startAttrDone(void); static # 82 "d:/tinyos-1.x/tos/interfaces/ADC.nc" result_t AttrVoltageM$ADC$getData(void); # 57 "d:/tinyos-1.x/tos/lib/Attributes/AttrVoltageM.nc" char *AttrVoltageM$result; char *AttrVoltageM$attrName; static inline result_t AttrVoltageM$StdControl$init(void); static inline result_t AttrVoltageM$StdControl$start(void); static inline result_t AttrVoltageM$StdControl$stop(void); static inline result_t AttrVoltageM$AttrRegister$startAttr(void); static inline result_t AttrVoltageM$AttrRegister$getAttr(char *name, char *resultBuf, SchemaErrorNo *errorNo); static inline #line 98 result_t AttrVoltageM$ADC$dataReady(uint16_t data); static # 82 "d:/tinyos-1.x/tos/interfaces/ADC.nc" result_t PhotoTempM$InternalTempADC$getData(void); static # 116 "d:/tinyos-1.x/tos/interfaces/ADCControl.nc" result_t PhotoTempM$ADCControl$bindPort(uint8_t arg_0xa41fbc0, uint8_t arg_0xa41fd00); static #line 77 result_t PhotoTempM$ADCControl$init(void); static # 100 "d:/tinyos-1.x/tos/interfaces/ADC.nc" result_t PhotoTempM$ExternalTempADC$dataReady(uint16_t arg_0xa445aa0); static #line 100 result_t PhotoTempM$ExternalPhotoADC$dataReady(uint16_t arg_0xa445aa0); static #line 82 result_t PhotoTempM$InternalPhotoADC$getData(void); # 94 "d:/tinyos-1.x/tos/sensorboards/micasb/PhotoTempM.nc" enum PhotoTempM$__nesc_unnamed4366 { PhotoTempM$IDLE = 1, PhotoTempM$BUSY = 2, PhotoTempM$CONTINUOUS = 3 }; int PhotoTempM$state; static result_t PhotoTempM$PhotoStdControl$init(void); static inline result_t PhotoTempM$PhotoStdControl$start(void); static inline result_t PhotoTempM$PhotoStdControl$stop(void); static result_t PhotoTempM$TempStdControl$init(void); static inline result_t PhotoTempM$TempStdControl$start(void); static inline result_t PhotoTempM$TempStdControl$stop(void); static inline result_t PhotoTempM$ExternalTempADC$getData(void); static inline #line 169 result_t PhotoTempM$ExternalPhotoADC$getData(void); static inline #line 227 result_t PhotoTempM$InternalPhotoADC$dataReady(uint16_t data); static inline #line 258 result_t PhotoTempM$InternalTempADC$dataReady(uint16_t data); static # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" result_t AttrTempM$AttrRegister$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68); static #line 91 result_t AttrTempM$AttrRegister$getAttrDone(char *arg_0xa7e5138, char *arg_0xa7e5290, SchemaErrorNo arg_0xa7e53d8); static result_t AttrTempM$AttrRegister$startAttrDone(void); static # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" result_t AttrTempM$SubControl$init(void); static result_t AttrTempM$SubControl$start(void); static result_t AttrTempM$SubControl$stop(void); static # 82 "d:/tinyos-1.x/tos/interfaces/ADC.nc" result_t AttrTempM$ADC$getData(void); # 57 "d:/tinyos-1.x/tos/lib/Attributes/AttrTempM.nc" char *AttrTempM$result; char *AttrTempM$attrName; static inline result_t AttrTempM$StdControl$init(void); static inline result_t AttrTempM$StdControl$start(void); static inline result_t AttrTempM$StdControl$stop(void); static inline result_t AttrTempM$AttrRegister$startAttr(void); static inline result_t AttrTempM$AttrRegister$getAttr(char *name, char *resultBuf, SchemaErrorNo *errorNo); static result_t AttrTempM$ADC$dataReady(uint16_t data); static # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" result_t AttrPhotoM$AttrRegister$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68); static #line 91 result_t AttrPhotoM$AttrRegister$getAttrDone(char *arg_0xa7e5138, char *arg_0xa7e5290, SchemaErrorNo arg_0xa7e53d8); static result_t AttrPhotoM$AttrRegister$startAttrDone(void); static # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" result_t AttrPhotoM$SubControl$init(void); static result_t AttrPhotoM$SubControl$start(void); static result_t AttrPhotoM$SubControl$stop(void); static # 82 "d:/tinyos-1.x/tos/interfaces/ADC.nc" result_t AttrPhotoM$ADC$getData(void); # 57 "d:/tinyos-1.x/tos/lib/Attributes/AttrPhotoM.nc" char *AttrPhotoM$result; char *AttrPhotoM$attrName; static inline result_t AttrPhotoM$StdControl$init(void); static inline result_t AttrPhotoM$StdControl$start(void); static inline result_t AttrPhotoM$StdControl$stop(void); static inline result_t AttrPhotoM$AttrRegister$startAttr(void); static inline result_t AttrPhotoM$AttrRegister$getAttr(char *name, char *resultBuf, SchemaErrorNo *errorNo); static result_t AttrPhotoM$ADC$dataReady(uint16_t data); static # 116 "d:/tinyos-1.x/tos/interfaces/ADCControl.nc" result_t AccelM$ADCControl$bindPort(uint8_t arg_0xa41fbc0, uint8_t arg_0xa41fd00); static #line 77 result_t AccelM$ADCControl$init(void); static inline # 76 "d:/tinyos-1.x/tos/sensorboards/micasb/AccelM.nc" result_t AccelM$StdControl$init(void); static inline result_t AccelM$StdControl$start(void); static inline result_t AccelM$StdControl$stop(void); static # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" result_t AttrAccelM$AttrAccelX$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68); static #line 91 result_t AttrAccelM$AttrAccelX$getAttrDone(char *arg_0xa7e5138, char *arg_0xa7e5290, SchemaErrorNo arg_0xa7e53d8); static result_t AttrAccelM$AttrAccelX$startAttrDone(void); static # 82 "d:/tinyos-1.x/tos/interfaces/ADC.nc" result_t AttrAccelM$AccelX$getData(void); static # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" result_t AttrAccelM$AttrAccelY$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68); static #line 91 result_t AttrAccelM$AttrAccelY$getAttrDone(char *arg_0xa7e5138, char *arg_0xa7e5290, SchemaErrorNo arg_0xa7e53d8); static result_t AttrAccelM$AttrAccelY$startAttrDone(void); static # 82 "d:/tinyos-1.x/tos/interfaces/ADC.nc" result_t AttrAccelM$AccelY$getData(void); static # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" result_t AttrAccelM$AccelControl$init(void); static result_t AttrAccelM$AccelControl$start(void); static result_t AttrAccelM$AccelControl$stop(void); # 59 "d:/tinyos-1.x/tos/lib/Attributes/AttrAccelM.nc" char *AttrAccelM$resultX; char *AttrAccelM$attrNameX; char *AttrAccelM$resultY; char *AttrAccelM$attrNameY; static inline result_t AttrAccelM$StdControl$init(void); static inline result_t AttrAccelM$StdControl$start(void); static inline result_t AttrAccelM$StdControl$stop(void); static inline result_t AttrAccelM$AttrAccelX$startAttr(void); static inline result_t AttrAccelM$AttrAccelX$getAttr(char *name, char *resultBuf, SchemaErrorNo *errorNo); static inline #line 105 result_t AttrAccelM$AccelX$dataReady(uint16_t data); static inline result_t AttrAccelM$AttrAccelY$startAttr(void); static inline result_t AttrAccelM$AttrAccelY$getAttr(char *name, char *resultBuf, SchemaErrorNo *errorNo); static inline #line 134 result_t AttrAccelM$AccelY$dataReady(uint16_t data); static # 63 "d:/tinyos-1.x/tos/interfaces/I2CPot.nc" result_t MicM$I2CPot$writePot(char arg_0xab15418, char arg_0xab15550, char arg_0xab15688); static # 116 "d:/tinyos-1.x/tos/interfaces/ADCControl.nc" result_t MicM$ADCControl$bindPort(uint8_t arg_0xa41fbc0, uint8_t arg_0xa41fd00); static #line 77 result_t MicM$ADCControl$init(void); static # 91 "d:/tinyos-1.x/tos/interfaces/MicInterrupt.nc" result_t MicM$MicInterrupt$toneDetected(void); static # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" result_t MicM$PotControl$init(void); static inline # 93 "d:/tinyos-1.x/tos/sensorboards/micasb/MicM.nc" result_t MicM$StdControl$init(void); static inline result_t MicM$StdControl$start(void); static inline result_t MicM$StdControl$stop(void); static inline result_t MicM$Mic$muxSel(uint8_t sel); static inline #line 133 result_t MicM$MicInterrupt$disable(void); static inline result_t MicM$Mic$gainAdjust(uint8_t val); static inline result_t MicM$I2CPot$readPotDone(char data, bool result); static inline result_t MicM$I2CPot$writePotDone(bool result); static inline uint8_t MicM$Mic$readToneDetector(void); static inline result_t MicM$MicInterrupt$default$toneDetected(void); void __attribute((signal)) __vector_4(void); static # 107 "d:/tinyos-1.x/tos/interfaces/I2C.nc" result_t I2CM$I2C$sendEndDone(void); static #line 100 result_t I2CM$I2C$sendStartDone(void); static #line 123 result_t I2CM$I2C$writeDone(bool arg_0xab067d8); static #line 114 result_t I2CM$I2C$readDone(char arg_0xab06370); # 78 "d:/tinyos-1.x/tos/platform/mica/I2CM.nc" char I2CM$state; char I2CM$local_data; enum I2CM$__nesc_unnamed4367 { #line 83 I2CM$READ_DATA = 1, I2CM$WRITE_DATA, I2CM$SEND_START, I2CM$SEND_END }; static inline void I2CM$wait(void); static inline void I2CM$SET_CLOCK(void); static inline void I2CM$CLEAR_CLOCK(void); static inline void I2CM$MAKE_CLOCK_OUTPUT(void); static inline void I2CM$SET_DATA(void); static inline void I2CM$CLEAR_DATA(void); static inline void I2CM$MAKE_DATA_OUTPUT(void); static inline void I2CM$MAKE_DATA_INPUT(void); static inline char I2CM$GET_DATA(void); static inline void I2CM$pulse_clock(void); static char I2CM$read_bit(void); static inline #line 121 char I2CM$i2c_read(void); static inline #line 133 char I2CM$i2c_write(char c); static inline #line 149 void I2CM$i2c_start(void); static inline void I2CM$i2c_ack(void); static inline void I2CM$i2c_nack(void); static inline void I2CM$i2c_end(void); static void I2CM$I2C_task(void); static inline #line 200 result_t I2CM$StdControl$init(void); static inline #line 218 result_t I2CM$I2C$sendStart(void); static inline result_t I2CM$I2C$sendEnd(void); static inline result_t I2CM$I2C$read(bool ack); static result_t I2CM$I2C$write(char data); static # 79 "d:/tinyos-1.x/tos/interfaces/I2C.nc" result_t I2CPotM$I2C$sendEnd(void); static result_t I2CPotM$I2C$read(bool arg_0xaacd410); static #line 72 result_t I2CPotM$I2C$sendStart(void); static #line 93 result_t I2CPotM$I2C$write(char arg_0xaacd878); static # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" result_t I2CPotM$I2CControl$init(void); static # 65 "d:/tinyos-1.x/tos/interfaces/I2CPot.nc" result_t I2CPotM$I2CPot$readPotDone(char arg_0xab0e010, bool arg_0xab0e150); static result_t I2CPotM$I2CPot$writePotDone(bool arg_0xab0e550); # 85 "d:/tinyos-1.x/tos/sensorboards/micasb/I2CPotM.nc" enum I2CPotM$__nesc_unnamed4368 { #line 85 I2CPotM$IDLE = 0, I2CPotM$READ_POT_START = 11, I2CPotM$READ_COMMAND = 13, I2CPotM$READ_COMMAND_2 = 14, I2CPotM$READ_COMMAND_3 = 15, I2CPotM$READ_COMMAND_4 = 16, I2CPotM$READ_COMMAND_5 = 17, I2CPotM$READ_POT_READING_DATA = 18, I2CPotM$READ_FAIL = 19, I2CPotM$WRITE_POT_START = 30, I2CPotM$WRITE_COMMAND = 31, I2CPotM$WRITE_COMMAND_2 = 32, I2CPotM$WRITING_TO_POT = 33, I2CPotM$WRITE_POT_STOP = 40, I2CPotM$WRITE_FAIL = 49, I2CPotM$READ_POT_STOP = 41 }; char I2CPotM$data; char I2CPotM$state; char I2CPotM$addr; char I2CPotM$pot; static inline result_t I2CPotM$StdControl$init(void); static inline #line 124 result_t I2CPotM$I2CPot$writePot(char line_addr, char pot_addr, char in_data); static inline #line 165 result_t I2CPotM$I2C$sendStartDone(void); static inline #line 180 result_t I2CPotM$I2C$sendEndDone(void); static inline #line 203 result_t I2CPotM$I2C$writeDone(bool result); static inline #line 229 result_t I2CPotM$I2C$readDone(char in_data); static # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" result_t AttrMicM$AttrTones$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68); static #line 100 result_t AttrMicM$AttrTones$startAttrDone(void); static # 82 "d:/tinyos-1.x/tos/interfaces/ADC.nc" result_t AttrMicM$MicADC$getData(void); static # 90 "d:/tinyos-1.x/tos/interfaces/Timer.nc" result_t AttrMicM$NoiseSampleTimer$start(char arg_0xa3f1240, uint32_t arg_0xa3f1390); static result_t AttrMicM$NoiseSampleTimer$stop(void); static # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" result_t AttrMicM$MicControl$init(void); static result_t AttrMicM$MicControl$start(void); static result_t AttrMicM$MicControl$stop(void); static # 91 "d:/tinyos-1.x/tos/interfaces/Mic.nc" result_t AttrMicM$Mic$gainAdjust(uint8_t arg_0xaad99d8); static uint8_t AttrMicM$Mic$readToneDetector(void); static #line 87 result_t AttrMicM$Mic$muxSel(uint8_t arg_0xaad95e0); static # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" result_t AttrMicM$AttrNoise$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68); static #line 100 result_t AttrMicM$AttrNoise$startAttrDone(void); static # 90 "d:/tinyos-1.x/tos/interfaces/Timer.nc" result_t AttrMicM$ToneDetectTimer$start(char arg_0xa3f1240, uint32_t arg_0xa3f1390); static result_t AttrMicM$ToneDetectTimer$stop(void); # 67 "d:/tinyos-1.x/tos/lib/Attributes/AttrMicM.nc" uint16_t AttrMicM$tones; bool AttrMicM$toneDetectRunning; bool AttrMicM$noiseSampleRunning; uint16_t AttrMicM$maxNoise; static inline void AttrMicM$startNoiseSample(void); static inline void AttrMicM$stopNoiseSample(void); static inline void AttrMicM$toneDetectStart(void); static inline void AttrMicM$toneDetectStop(void); static inline result_t AttrMicM$StdControl$init(void); static inline #line 101 result_t AttrMicM$StdControl$start(void); static inline result_t AttrMicM$StdControl$stop(void); static inline void AttrMicM$startNoiseSample(void); static inline void AttrMicM$stopNoiseSample(void); static inline result_t AttrMicM$AttrNoise$startAttr(void); static inline result_t AttrMicM$AttrNoise$getAttr(char *name, char *resultBuf, SchemaErrorNo *errorNo); static inline result_t AttrMicM$NoiseSampleTimer$fired(void); static inline #line 157 result_t AttrMicM$MicADC$dataReady(uint16_t data); static inline void AttrMicM$toneDetectStart(void); static inline void AttrMicM$toneDetectStop(void); static inline result_t AttrMicM$AttrTones$startAttr(void); static inline result_t AttrMicM$AttrTones$getAttr(char *name, char *resultBuf, SchemaErrorNo *errorNo); static inline result_t AttrMicM$ToneDetectTimer$fired(void); static # 70 "d:/tinyos-1.x/tos/interfaces/CommandUse.nc" CommandDescPtr DBBufferC$CommandUse$getCommandById(uint8_t arg_0xa3400a0); static #line 86 result_t DBBufferC$CommandUse$invoke(char *arg_0xa340b70, char *arg_0xa340cc8, SchemaErrorNo *arg_0xa340e28, ParamVals *arg_0xa340f88); static # 102 "d:/tinyos-1.x/tos/lib/TinyDB/TupleIntf.nc" result_t DBBufferC$TupleIntf$setFieldNoQuery(TuplePtr arg_0xa5fe160, uint8_t arg_0xa5fe2b8, uint8_t arg_0xa5fe410, uint8_t arg_0xa5fe580[], uint8_t arg_0xa5fe6f0[], CharPtr arg_0xa5fe840); static #line 128 CharPtr DBBufferC$TupleIntf$getFieldPtrNoQuery(TuplePtr arg_0xa5ff718, uint8_t arg_0xa5ff870, uint8_t arg_0xa5ff9c8, uint8_t arg_0xa5ffb38[], uint8_t arg_0xa5ffca8[]); static # 72 "d:/tinyos-1.x/tos/interfaces/AttrUse.nc" AttrDescPtr DBBufferC$AttrUse$getAttrById(uint8_t arg_0xa5e4d58); static uint8_t DBBufferC$AttrUse$numAttrs(void); static # 76 "d:/tinyos-1.x/tos/lib/TinyDB/RadioQueue.nc" TinyDBError DBBufferC$RadioQueue$enqueue(const QueryResultPtr arg_0xa63cfd0, bool *arg_0xa63d128); static # 101 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQueryIntf.nc" short DBBufferC$ParsedQueryIntf$pqSize(ParsedQueryPtr arg_0xa5f7da8); static #line 122 TinyDBError DBBufferC$ParsedQueryIntf$getResultField(ParsedQueryPtr arg_0xa612860, QueryResultPtr arg_0xa6129a8, uint8_t arg_0xa612af0, char *arg_0xa612c48); static TinyDBError DBBufferC$ParsedQueryIntf$getResultId(ParsedQueryPtr arg_0xa613320, Field *arg_0xa613478, uint8_t *arg_0xa6135d0); static # 135 "d:/tinyos-1.x/tos/lib/TinyDB/QueryResultIntf.nc" TinyDBError DBBufferC$QueryResultIntf$toBytes(QueryResultPtr arg_0xa62b368, ParsedQueryPtr arg_0xa62b4b0, CharPtr arg_0xa62b5f0); static #line 126 uint16_t DBBufferC$QueryResultIntf$resultSize(QueryResultPtr arg_0xa62adb8, ParsedQueryPtr arg_0xa62af00); static #line 142 TinyDBError DBBufferC$QueryResultIntf$fromBytes(QueryResultPtr arg_0xa62bb48, QueryResultPtr arg_0xa62bc90, ParsedQueryPtr arg_0xa62bdd8); static #line 159 ResultTuple DBBufferC$QueryResultIntf$getResultTuple(QueryResultPtr arg_0xa629378, short arg_0xa6294b0, ParsedQueryPtr arg_0xa6295f8); static #line 153 short DBBufferC$QueryResultIntf$numRecords(QueryResultPtr arg_0xa628df8, ParsedQueryPtr arg_0xa628f40); static #line 146 TinyDBError DBBufferC$QueryResultIntf$fromResultTuple(ResultTuple arg_0xa6282f8, QueryResultPtr arg_0xa628440, ParsedQueryPtr arg_0xa628588); static # 146 "d:/tinyos-1.x/tos/interfaces/MemAlloc.nc" int16_t DBBufferC$MemAlloc$size(Handle arg_0xa609bd0); static #line 118 result_t DBBufferC$MemAlloc$unlock(Handle arg_0xa608ef0); static #line 108 result_t DBBufferC$MemAlloc$lock(Handle arg_0xa608a00); static #line 97 result_t DBBufferC$MemAlloc$reallocate(Handle arg_0xa6083e0, int16_t arg_0xa608520); static #line 85 result_t DBBufferC$MemAlloc$allocate(HandlePtr arg_0xa60bd50, int16_t arg_0xa60be90); static #line 128 int16_t DBBufferC$MemAlloc$free(Handle arg_0xa6093b0); static # 223 "d:/tinyos-1.x/tos/lib/TinyDB/DBBuffer.nc" result_t DBBufferC$DBBuffer$putComplete(uint8_t arg_0xa61c0f0, QueryResult *arg_0xa61c250, TinyDBError arg_0xa61c398); static #line 220 result_t DBBufferC$DBBuffer$getComplete(uint8_t arg_0xa63f9f8, QueryResult *arg_0xa63fb58, TinyDBError arg_0xa63fca0); static #line 217 result_t DBBufferC$DBBuffer$allocComplete(uint8_t arg_0xa63f468, TinyDBError arg_0xa63f5b0); # 157 "d:/tinyos-1.x/tos/lib/TinyDB/DBBufferC.nc" enum DBBufferC$__nesc_unnamed4369 { DBBufferC$kNUM_BUFS = 4, DBBufferC$kATTR_BUF = DBBufferC$kNUM_BUFS + 1, DBBufferC$kCOMMAND_BUF = DBBufferC$kATTR_BUF + 1, DBBufferC$kEVENT_BUF = DBBufferC$kCOMMAND_BUF + 1, DBBufferC$kQUERY_BUF = DBBufferC$kEVENT_BUF + 1 }; typedef enum DBBufferC$__nesc_unnamed4370 { DBBufferC$kIDLE, DBBufferC$kALLOC_SCHEMA, DBBufferC$kALLOC_BUFFER, DBBufferC$kALLOC_ROW, DBBufferC$kALLOC_NAME, DBBufferC$kREAD_ROW, DBBufferC$kEEPROM_WRITE, DBBufferC$kEEPROM_ALLOC_ROW, DBBufferC$kREADING_LENGTH, DBBufferC$kALLOC_FOR_READ, DBBufferC$kREADING_DATA, DBBufferC$kWRITE_BUFFER, DBBufferC$kHEADER_READ, DBBufferC$kWRITE_FILE_COUNT, DBBufferC$kREAD_FILE_COUNT, DBBufferC$kREAD_OPEN, DBBufferC$kREAD_LENGTHS, DBBufferC$kSKIP_BYTES, DBBufferC$kREAD_NAME, DBBufferC$kREAD_FIELD_LEN, DBBufferC$kALLOC_FIELD_DATA, DBBufferC$kREAD_FIELD_DATA, DBBufferC$kALLOC_QUERY, DBBufferC$kREAD_QUERY, DBBufferC$kREAD_BUFFER, DBBufferC$kWRITING_LENGTHS, DBBufferC$kWRITING_NAME, DBBufferC$kWRITING_QUERY, DBBufferC$kWRITING_BUFFER, DBBufferC$kWRITE_FIELD_LEN, DBBufferC$kWRITE_FIELD_DATA, DBBufferC$kWRITE_NEXT_BUFFER, DBBufferC$kNOT_READY, DBBufferC$kOPEN_BUFFER, DBBufferC$kCLEANUP } DBBufferC$AllocState; typedef struct DBBufferC$__nesc_unnamed4371 { BufferType type; BufferPolicy policy; ParsedQuery **qh; uint16_t numRows; uint16_t nextFree; uint16_t nextFull; uint16_t len; uint16_t rowSize; long data; char **name; union DBBufferC$__nesc_unnamed4372 { char **bufdata; struct DBBufferC$__nesc_unnamed4373 { bool isOpen; bool isWrite; } eeprom; } u; } DBBufferC$Buffer; DBBufferC$Buffer DBBufferC$mBuffers[DBBufferC$kNUM_BUFS]; long DBBufferC$mUsedBufs; uint8_t DBBufferC$mCurBuffer; uint16_t DBBufferC$mCurRow; Handle DBBufferC$mCurRowHandle; Handle DBBufferC$mEepromRow; QueryResultPtr DBBufferC$mCurResult; ParsedQuery *DBBufferC$mAllocSchema; DBBufferC$AllocState DBBufferC$mState; char *DBBufferC$mNamePtr; #line 260 enum DBBufferC$__nesc_unnamed4374 { #line 260 DBBufferC$NUM_ATTR_FIELDS = 1 }; #line 261 uint8_t DBBufferC$ATTR_TYPES[DBBufferC$NUM_ATTR_FIELDS]; uint8_t DBBufferC$ATTR_SIZES[DBBufferC$NUM_ATTR_FIELDS]; char DBBufferC$ATTR_NAMES[DBBufferC$NUM_ATTR_FIELDS][STRING_SIZE]; static TinyDBError DBBufferC$calcNextFreeRow(DBBufferC$Buffer *buf); static TinyDBError DBBufferC$getBuf(uint8_t bufId, DBBufferC$Buffer **buf); static void DBBufferC$cleanupBuffer(int i, int lineno); static inline void DBBufferC$initCatalog(void); static TinyDBError DBBufferC$getSpecialBufferId(BufferType type, uint8_t *bufferId); static inline #line 313 result_t DBBufferC$StdControl$init(void); static inline #line 334 result_t DBBufferC$StdControl$start(void); static inline #line 387 result_t DBBufferC$StdControl$stop(void); static inline void DBBufferC$initCatalog(void); static #line 457 TinyDBError DBBufferC$DBBuffer$enqueue(uint8_t bufferId, QueryResultPtr r, bool *pending, ParsedQuery *pq); static inline #line 672 TinyDBError DBBufferC$DBBuffer$peek(uint8_t bufferId, QueryResult *qr, bool *pending); static inline #line 855 TinyDBError DBBufferC$DBBuffer$getResult(uint8_t bufferId, uint16_t idx, QueryResult *qr, bool *pending); static #line 939 TinyDBError DBBufferC$DBBuffer$size(uint8_t bufferId, uint16_t *size); static #line 983 TinyDBError DBBufferC$DBBuffer$alloc(uint8_t bufferId, BufferType type, uint16_t size, BufferPolicy policy, ParsedQuery *schema, char *name, bool *pending, long data); static #line 1073 ParsedQuery **DBBufferC$DBBuffer$getSchema(uint8_t bufferId); static inline TinyDBError DBBufferC$DBBuffer$getFieldId(uint8_t bufferId, FieldPtr f, uint8_t *id); static inline #line 1110 TinyDBError DBBufferC$DBBuffer$getField(uint8_t bufferId, QueryResult *qr, uint8_t idx, char *resultBuf); static #line 1138 TinyDBError DBBufferC$DBBuffer$nextUnusedBuffer(uint8_t *bufferId); static #line 1158 TinyDBError DBBufferC$DBBuffer$getBufferIdFromName(char *name, uint8_t *bufferId); static #line 1180 TinyDBError DBBufferC$DBBuffer$qidFromBufferId(uint8_t bufId, uint8_t *qid); static #line 1194 TinyDBError DBBufferC$DBBuffer$getBufferId(uint8_t bufIdx, bool special, uint8_t *bufferId); static inline #line 1219 uint8_t DBBufferC$CatalogTable$catalogFieldSize(uint8_t bufIdx, uint8_t fieldNo); static inline #line 1302 TinyDBError DBBufferC$DBBuffer$openBuffer(uint8_t bufIdx, bool *pending); static #line 2146 result_t DBBufferC$MemAlloc$allocComplete(HandlePtr handle, result_t success); static inline #line 2325 result_t DBBufferC$MemAlloc$compactComplete(void); static result_t DBBufferC$MemAlloc$reallocComplete(Handle handle, result_t success); static inline result_t DBBufferC$QueryProcessor$queryComplete(ParsedQueryPtr q); static inline #line 2385 result_t DBBufferC$AttrUse$getAttrDone(char *name, char *resultBuf, SchemaErrorNo errorNo); static inline result_t DBBufferC$AttrUse$startAttrDone(uint8_t id); static #line 2504 TinyDBError DBBufferC$calcNextFreeRow(DBBufferC$Buffer *buf); static #line 2540 TinyDBError DBBufferC$getBuf(uint8_t bufId, DBBufferC$Buffer **buf); static #line 2554 void DBBufferC$cleanupBuffer(int b, int lineNo); static #line 2615 TinyDBError DBBufferC$getSpecialBufferId(BufferType type, uint8_t *bufferId); static # 76 "d:/tinyos-1.x/tos/lib/TinyDB/Table.nc" result_t TableM$Table$addNamedFieldDone(result_t arg_0xa63b9e0); static # 146 "d:/tinyos-1.x/tos/interfaces/MemAlloc.nc" int16_t TableM$MemAlloc$size(Handle arg_0xa609bd0); static #line 97 result_t TableM$MemAlloc$reallocate(Handle arg_0xa6083e0, int16_t arg_0xa608520); static #line 85 result_t TableM$MemAlloc$allocate(HandlePtr arg_0xa60bd50, int16_t arg_0xa60be90); # 14 "d:/tinyos-1.x/tos/lib/TinyDB/TableM.nc" uint8_t TableM$mIdx; char *TableM$mName; uint8_t TableM$mType; ParsedQuery *TableM$mQuery; bool TableM$mAllocing; static uint8_t TableM$nameSize(char *names, uint8_t i); static inline uint8_t *TableM$getTypes(ParsedQuery *pq); static inline char *TableM$getAliases(ParsedQuery *pq); static uint8_t TableM$nameOffset(char *names, uint8_t i); static inline #line 50 result_t TableM$Table$addNamedField(ParsedQuery *pq, uint8_t idx, char *name, uint8_t type); static inline #line 74 uint8_t *TableM$getTypes(ParsedQuery *pq); static inline char *TableM$getAliases(ParsedQuery *pq); static #line 97 result_t TableM$Table$getType(ParsedQuery *pq, uint8_t fieldIdx, uint8_t *type); static inline #line 110 result_t TableM$Table$getNamedField(ParsedQuery *pq, char *field, uint8_t *fieldId); static inline #line 130 result_t TableM$Table$getFieldName(ParsedQuery *pq, uint8_t idx, char **name); static void TableM$addField(void); static result_t TableM$MemAlloc$allocComplete(HandlePtr handle, result_t success); static #line 168 uint8_t TableM$nameOffset(char *names, uint8_t i); static uint8_t TableM$nameSize(char *names, uint8_t i); static inline #line 191 uint8_t TableM$totalNameSize(ParsedQuery *pq); static result_t TableM$MemAlloc$reallocComplete(Handle handle, result_t success); static inline #line 218 result_t TableM$MemAlloc$compactComplete(void); static # 61 "d:/tinyos-1.x/tos/interfaces/AbsoluteTimer.nc" result_t ServiceSchedulerM$AbsoluteTimer$cancel(void); static #line 55 result_t ServiceSchedulerM$AbsoluteTimer$set(tos_time_t arg_0xa4fed40); static # 70 "d:/tinyos-1.x/tos/interfaces/TimeUtil.nc" tos_time_t ServiceSchedulerM$TimeUtil$addUint32(tos_time_t arg_0xa4fa690, uint32_t arg_0xa4fa7d8); static #line 87 char ServiceSchedulerM$TimeUtil$compare(tos_time_t arg_0xa4fb3b8, tos_time_t arg_0xa4fb500); static # 59 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" result_t ServiceSchedulerM$Services$start( # 35 "d:/tinyos-1.x/tos/lib/ServiceSchedulerM.nc" uint8_t arg_0xabf1558); static # 67 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" result_t ServiceSchedulerM$Services$stop( # 35 "d:/tinyos-1.x/tos/lib/ServiceSchedulerM.nc" uint8_t arg_0xabf1558); enum ServiceSchedulerM$__nesc_unnamed4375 { ServiceSchedulerM$MAX_SERVICES = 2 }; struct ServiceSchedulerM$__nesc_unnamed4376 { char (*compare)(pq_element e1, pq_element e2); uint8_t size; uint8_t n_elements; pq_element heap[10]; } ServiceSchedulerM$event_q; tos_service_schedule ServiceSchedulerM$sched_info[ServiceSchedulerM$MAX_SERVICES]; static inline char ServiceSchedulerM$compare_elts(pq_element i, pq_element j); static result_t ServiceSchedulerM$AbsoluteTimer$fired(void); static inline #line 111 result_t ServiceSchedulerM$Services$default$start(uint8_t id); static inline result_t ServiceSchedulerM$Services$default$stop(uint8_t id); static inline result_t ServiceSchedulerM$SchedulerClt$init(void); static inline #line 142 result_t ServiceSchedulerM$SchedulerClt$start(void); static inline #line 154 result_t ServiceSchedulerM$SchedulerClt$stop(void); static inline result_t ServiceSchedulerM$ServiceScheduler$reschedule(uint8_t svc_id, tos_service_schedule sched); static inline #line 216 result_t ServiceSchedulerM$ServiceScheduler$remove(uint8_t svc_id); # 176 "d:/tinyos-1.x/tos/platform/avrmote/avrhardware.h" __inline __nesc_atomic_t __nesc_atomic_start(void ) { __nesc_atomic_t result = * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x3F + 0x20); #line 179 __asm volatile ("cli"); return result; } __inline void __nesc_atomic_end(__nesc_atomic_t oldSreg) { * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x3F + 0x20) = oldSreg; } static inline # 84 "d:/tinyos-1.x/tos/platform/avrmote/HPLInterrupt.nc" bool HPLInterrupt$Interrupt$disable(void) #line 84 { bool result = (* (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x3F + 0x20) & 0x80) != 0; #line 86 __asm volatile ("cli"); return result; } static inline bool TOSH_interrupt_disable(void) #line 94 { return HPLInterrupt$Interrupt$disable(); } static inline #line 79 result_t HPLInterrupt$Interrupt$enable(void) #line 79 { __asm volatile ("sei"); return SUCCESS; } static inline void TOSH_interrupt_enable(void) #line 90 { HPLInterrupt$Interrupt$enable(); } # 111 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_SET_GREEN_LED_PIN(void) #line 111 { #line 111 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) |= 1 << 1; } #line 112 static __inline void TOSH_SET_YELLOW_LED_PIN(void) #line 112 { #line 112 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) |= 1 << 0; } #line 110 static __inline void TOSH_SET_RED_LED_PIN(void) #line 110 { #line 110 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) |= 1 << 2; } #line 125 static __inline void TOSH_SET_FLASH_SELECT_PIN(void) #line 125 { #line 125 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) |= 1 << 3; } #line 126 static __inline void TOSH_MAKE_FLASH_CLK_OUTPUT(void) #line 126 { #line 126 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x11 + 0x20) |= 1 << 5; } #line 127 static __inline void TOSH_MAKE_FLASH_OUT_OUTPUT(void) #line 127 { #line 127 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x11 + 0x20) |= 1 << 3; } #line 125 static __inline void TOSH_MAKE_FLASH_SELECT_OUTPUT(void) #line 125 { #line 125 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) |= 1 << 3; } #line 139 static __inline void TOSH_MAKE_SPI_OC1C_INPUT(void) #line 139 { #line 139 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x17 + 0x20) &= ~(1 << 7); } #line 138 static __inline void TOSH_MAKE_MISO_INPUT(void) #line 138 { #line 138 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x17 + 0x20) &= ~(1 << 3); } #line 121 static __inline void TOSH_MAKE_CC_PCLK_OUTPUT(void) #line 121 { #line 121 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x11 + 0x20) |= 1 << 6; } #line 120 static __inline void TOSH_MAKE_CC_PDATA_OUTPUT(void) #line 120 { #line 120 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x11 + 0x20) |= 1 << 7; } #line 122 static __inline void TOSH_MAKE_CC_PALE_OUTPUT(void) #line 122 { #line 122 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x11 + 0x20) |= 1 << 4; } #line 143 static __inline void TOSH_MAKE_PW0_OUTPUT(void) #line 143 { #line 143 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 0; } #line 144 static __inline void TOSH_MAKE_PW1_OUTPUT(void) #line 144 { #line 144 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 1; } #line 145 static __inline void TOSH_MAKE_PW2_OUTPUT(void) #line 145 { #line 145 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 2; } #line 146 static __inline void TOSH_MAKE_PW3_OUTPUT(void) #line 146 { #line 146 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 3; } #line 147 static __inline void TOSH_MAKE_PW4_OUTPUT(void) #line 147 { #line 147 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 4; } #line 148 static __inline void TOSH_MAKE_PW5_OUTPUT(void) #line 148 { #line 148 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 5; } #line 149 static __inline void TOSH_MAKE_PW6_OUTPUT(void) #line 149 { #line 149 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 6; } #line 150 static __inline void TOSH_MAKE_PW7_OUTPUT(void) #line 150 { #line 150 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x14 + 0x20) |= 1 << 7; } #line 119 static __inline void TOSH_MAKE_CC_CHP_OUT_INPUT(void) #line 119 { #line 119 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) &= ~(1 << 6); } #line 111 static __inline void TOSH_MAKE_GREEN_LED_OUTPUT(void) #line 111 { #line 111 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) |= 1 << 1; } #line 112 static __inline void TOSH_MAKE_YELLOW_LED_OUTPUT(void) #line 112 { #line 112 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) |= 1 << 0; } #line 110 static __inline void TOSH_MAKE_RED_LED_OUTPUT(void) #line 110 { #line 110 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1A + 0x20) |= 1 << 2; } static inline #line 165 void TOSH_SET_PIN_DIRECTIONS(void ) { TOSH_MAKE_RED_LED_OUTPUT(); TOSH_MAKE_YELLOW_LED_OUTPUT(); TOSH_MAKE_GREEN_LED_OUTPUT(); TOSH_MAKE_CC_CHP_OUT_INPUT(); TOSH_MAKE_PW7_OUTPUT(); TOSH_MAKE_PW6_OUTPUT(); TOSH_MAKE_PW5_OUTPUT(); TOSH_MAKE_PW4_OUTPUT(); TOSH_MAKE_PW3_OUTPUT(); TOSH_MAKE_PW2_OUTPUT(); TOSH_MAKE_PW1_OUTPUT(); TOSH_MAKE_PW0_OUTPUT(); TOSH_MAKE_CC_PALE_OUTPUT(); TOSH_MAKE_CC_PDATA_OUTPUT(); TOSH_MAKE_CC_PCLK_OUTPUT(); TOSH_MAKE_MISO_INPUT(); TOSH_MAKE_SPI_OC1C_INPUT(); TOSH_MAKE_FLASH_SELECT_OUTPUT(); TOSH_MAKE_FLASH_OUT_OUTPUT(); TOSH_MAKE_FLASH_CLK_OUTPUT(); TOSH_SET_FLASH_SELECT_PIN(); TOSH_SET_RED_LED_PIN(); TOSH_SET_YELLOW_LED_PIN(); TOSH_SET_GREEN_LED_PIN(); } static inline # 80 "d:/tinyos-1.x/tos/platform/avrmote/HPLInit.nc" result_t HPLInit$init(void) #line 80 { TOSH_SET_PIN_DIRECTIONS(); return SUCCESS; } # 70 "d:/tinyos-1.x/tos/system/RealMain.nc" inline static result_t RealMain$hardwareInit(void){ #line 70 unsigned char result; #line 70 #line 70 result = HPLInit$init(); #line 70 #line 70 return result; #line 70 } #line 70 static inline # 129 "d:/tinyos-1.x/tos/system/PotM.nc" result_t PotM$Pot$init(uint8_t initialSetting) #line 129 { PotM$setPot(initialSetting); return SUCCESS; } # 105 "d:/tinyos-1.x/tos/interfaces/Pot.nc" inline static result_t RealMain$Pot$init(uint8_t arg_0xa2a50c8){ #line 105 unsigned char result; #line 105 #line 105 result = PotM$Pot$init(arg_0xa2a50c8); #line 105 #line 105 return result; #line 105 } #line 105 static inline # 80 "d:/tinyos-1.x/tos/platform/mica2/HPLPotC.nc" result_t HPLPotC$Pot$decrease(void) #line 80 { return SUCCESS; } # 86 "d:/tinyos-1.x/tos/interfaces/HPLPot.nc" inline static result_t PotM$HPLPot$decrease(void){ #line 86 unsigned char result; #line 86 #line 86 result = HPLPotC$Pot$decrease(); #line 86 #line 86 return result; #line 86 } #line 86 static inline # 89 "d:/tinyos-1.x/tos/platform/mica2/HPLPotC.nc" result_t HPLPotC$Pot$increase(void) #line 89 { return SUCCESS; } # 94 "d:/tinyos-1.x/tos/interfaces/HPLPot.nc" inline static result_t PotM$HPLPot$increase(void){ #line 94 unsigned char result; #line 94 #line 94 result = HPLPotC$Pot$increase(); #line 94 #line 94 return result; #line 94 } #line 94 static inline # 98 "d:/tinyos-1.x/tos/platform/mica2/HPLPotC.nc" result_t HPLPotC$Pot$finalise(void) #line 98 { return SUCCESS; } # 101 "d:/tinyos-1.x/tos/interfaces/HPLPot.nc" inline static result_t PotM$HPLPot$finalise(void){ #line 101 unsigned char result; #line 101 #line 101 result = HPLPotC$Pot$finalise(); #line 101 #line 101 return result; #line 101 } #line 101 static inline # 108 "d:/tinyos-1.x/tos/system/sched.c" void TOSH_sched_init(void ) { TOSH_sched_free = 0; TOSH_sched_full = 0; } static inline # 113 "d:/tinyos-1.x/tos/system/tos.h" result_t rcombine(result_t r1, result_t r2) { return r1 == FAIL ? FAIL : r2; } static inline # 182 "d:/tinyos-1.x/tos/lib/TinyAlloc.nc" result_t TinyAlloc$StdControl$init(void) #line 182 { int16_t i; #line 184 TinyAlloc$mAllocing = 0; TinyAlloc$mReallocing = 0; for (i = 0; i < TinyAlloc$FREE_SIZE >> 4; i++) { ((int32_t *)TinyAlloc$mFree)[i] = 0; } for (i = 0; i < TinyAlloc$MAX_HANDLES; i++) { TinyAlloc$mHandles[i] = 0; } TinyAlloc$mFreeBytes = TinyAlloc$FRAME_SIZE; return SUCCESS; } # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t TupleRouterM$TimerControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = LogicalTimeM$StdControl$init(); #line 52 #line 52 return result; #line 52 } #line 52 inline static result_t CC1000RadioIntM$TimerControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = LogicalTimeM$StdControl$init(); #line 52 #line 52 return result; #line 52 } #line 52 static inline # 82 "d:/tinyos-1.x/tos/system/RandomLFSR.nc" result_t RandomLFSR$Random$init(void) #line 82 { { } #line 83 ; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 84 { RandomLFSR$shiftReg = 119 * 119 * (TOS_LOCAL_ADDRESS + 1); RandomLFSR$initSeed = RandomLFSR$shiftReg; RandomLFSR$mask = 137 * 29 * (TOS_LOCAL_ADDRESS + 1); } #line 88 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 80 "d:/tinyos-1.x/tos/interfaces/Random.nc" inline static result_t CC1000RadioIntM$Random$init(void){ #line 80 unsigned char result; #line 80 #line 80 result = RandomLFSR$Random$init(); #line 80 #line 80 return result; #line 80 } #line 80 static inline # 118 "d:/tinyos-1.x/tos/platform/mica2/HPLADCM.nc" result_t HPLADCM$ADC$init(void) #line 118 { HPLADCM$init_portmap(); { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 123 { * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x06 + 0x20) = ((1 << 7) | (1 << 3)) | (6 << 0); * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x07 + 0x20) = 0; } #line 127 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 81 "d:/tinyos-1.x/tos/interfaces/HPLADC.nc" inline static result_t ADCM$HPLADC$init(void){ #line 81 unsigned char result; #line 81 #line 81 result = HPLADCM$ADC$init(); #line 81 #line 81 return result; #line 81 } #line 81 static inline # 102 "d:/tinyos-1.x/tos/platform/mica2/ADCM.nc" result_t ADCM$ADCControl$init(void) #line 102 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 103 { ADCM$ReqPort = 0; ADCM$ReqVector = ADCM$ContReqMask = 0; } #line 106 __nesc_atomic_end(__nesc_atomic); } { } #line 107 ; return ADCM$HPLADC$init(); } # 77 "d:/tinyos-1.x/tos/interfaces/ADCControl.nc" inline static result_t CC1000RadioIntM$ADCControl$init(void){ #line 77 unsigned char result; #line 77 #line 77 result = ADCM$ADCControl$init(); #line 77 #line 77 return result; #line 77 } #line 77 # 97 "d:/tinyos-1.x/tos/interfaces/HPLADC.nc" inline static result_t ADCM$HPLADC$bindPort(uint8_t arg_0xa4c74d8, uint8_t arg_0xa4c7618){ #line 97 unsigned char result; #line 97 #line 97 result = HPLADCM$ADC$bindPort(arg_0xa4c74d8, arg_0xa4c7618); #line 97 #line 97 return result; #line 97 } #line 97 static inline # 116 "d:/tinyos-1.x/tos/platform/mica2/ADCM.nc" result_t ADCM$ADCControl$bindPort(uint8_t port, uint8_t adcPort) #line 116 { return ADCM$HPLADC$bindPort(port, adcPort); } # 116 "d:/tinyos-1.x/tos/interfaces/ADCControl.nc" inline static result_t CC1000RadioIntM$ADCControl$bindPort(uint8_t arg_0xa41fbc0, uint8_t arg_0xa41fd00){ #line 116 unsigned char result; #line 116 #line 116 result = ADCM$ADCControl$bindPort(arg_0xa41fbc0, arg_0xa41fd00); #line 116 #line 116 return result; #line 116 } #line 116 static inline # 289 "d:/tinyos-1.x/tos/platform/mica2/CC1000ControlM.nc" bool CC1000ControlM$CC1000Control$GetLOStatus(void) #line 289 { return ({ #line 291 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_Params[CC1000ControlM$tunefreq][0x1e]; #line 291 unsigned char __result; #line 291 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } ); } # 175 "d:/tinyos-1.x/tos/platform/mica2/CC1000Control.nc" inline static bool CC1000RadioIntM$CC1000Control$GetLOStatus(void){ #line 175 unsigned char result; #line 175 #line 175 result = CC1000ControlM$CC1000Control$GetLOStatus(); #line 175 #line 175 return result; #line 175 } #line 175 # 81 "d:/tinyos-1.x/tos/platform/mica2/HPLCC1000.nc" inline static result_t CC1000ControlM$HPLChipcon$write(uint8_t arg_0xa48af10, uint8_t arg_0xa48b050){ #line 81 unsigned char result; #line 81 #line 81 result = HPLCC1000M$HPLCC1000$write(arg_0xa48af10, arg_0xa48b050); #line 81 #line 81 return result; #line 81 } #line 81 static inline # 278 "d:/tinyos-1.x/tos/platform/mica2/CC1000ControlM.nc" result_t CC1000ControlM$CC1000Control$SelectLock(uint8_t Value) #line 278 { CC1000ControlM$LockVal = Value; return CC1000ControlM$HPLChipcon$write(0x0D, CC1000ControlM$LockVal << 4); } # 155 "d:/tinyos-1.x/tos/platform/mica2/CC1000Control.nc" inline static result_t CC1000RadioIntM$CC1000Control$SelectLock(uint8_t arg_0xa408d10){ #line 155 unsigned char result; #line 155 #line 155 result = CC1000ControlM$CC1000Control$SelectLock(arg_0xa408d10); #line 155 #line 155 return result; #line 155 } #line 155 # 88 "d:/tinyos-1.x/tos/platform/mica2/HPLCC1000.nc" inline static uint8_t CC1000ControlM$HPLChipcon$read(uint8_t arg_0xa48b498){ #line 88 unsigned char result; #line 88 #line 88 result = HPLCC1000M$HPLCC1000$read(arg_0xa48b498); #line 88 #line 88 return result; #line 88 } #line 88 static inline # 96 "d:/tinyos-1.x/tos/platform/mica2/CC1000ControlM.nc" result_t CC1000ControlM$chipcon_cal(void) { int freq = CC1000ControlM$tunefreq; CC1000ControlM$HPLChipcon$write(0x0B, 0x00); CC1000ControlM$HPLChipcon$write(0x42, 0x3f); CC1000ControlM$HPLChipcon$write(0x00, ( 1 << 4) | (1 << 0)); CC1000ControlM$HPLChipcon$write(0x0E, (( 1 << 7) | ( 1 << 5)) | (6 << 0)); while ((CC1000ControlM$HPLChipcon$read(0x0E) & (1 << 3)) == 0) ; CC1000ControlM$HPLChipcon$write(0x0E, ( 1 << 5) | (6 << 0)); CC1000ControlM$HPLChipcon$write(0x00, ((( 1 << 7) | (1 << 6)) | (1 << 5)) | ( 1 << 0)); CC1000ControlM$HPLChipcon$write(0x09, ({ #line 129 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_Params[freq][29]; #line 129 unsigned char __result; #line 129 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } )); #line 130 CC1000ControlM$HPLChipcon$write(0x0B, 0x00); CC1000ControlM$HPLChipcon$write(0x0E, (( 1 << 7) | ( 1 << 5)) | (6 << 0)); while ((CC1000ControlM$HPLChipcon$read(0x0E) & (1 << 3)) == 0) ; CC1000ControlM$HPLChipcon$write(0x0E, ( 1 << 5) | (6 << 0)); return SUCCESS; } static inline #line 178 result_t CC1000ControlM$CC1000Control$Tune(uint8_t freq) #line 178 { int i; #line 180 CC1000ControlM$tunefreq = freq; CC1000ControlM$rfpower = ({ #line 181 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_Params[freq][0xb]; #line 181 unsigned char __result; #line 181 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } ); #line 182 CC1000ControlM$LockVal = ({ #line 182 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_Params[freq][0xd]; #line 182 unsigned char __result; #line 182 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } ); #line 184 for (i = 1; i < 0x14; i++) CC1000ControlM$HPLChipcon$write(i, ({ #line 185 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_Params[freq][i]; #line 185 unsigned char __result; #line 185 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } )); #line 187 CC1000ControlM$HPLChipcon$write(0x1C, ({ #line 187 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_Params[freq][0x1c]; #line 187 unsigned char __result; #line 187 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } )); #line 189 CC1000ControlM$chipcon_cal(); return SUCCESS; } static # 95 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" void __inline TOSH_uwait(int u_sec) #line 95 { while (u_sec > 0) { __asm volatile ("nop"); __asm volatile ("nop"); __asm volatile ("nop"); __asm volatile ("nop"); __asm volatile ("nop"); __asm volatile ("nop"); __asm volatile ("nop"); __asm volatile ("nop"); u_sec--; } } #line 121 static __inline void TOSH_SET_CC_PCLK_PIN(void) #line 121 { #line 121 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x12 + 0x20) |= 1 << 6; } #line 120 static __inline void TOSH_SET_CC_PDATA_PIN(void) #line 120 { #line 120 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x12 + 0x20) |= 1 << 7; } #line 122 static __inline void TOSH_SET_CC_PALE_PIN(void) #line 122 { #line 122 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x12 + 0x20) |= 1 << 4; } static inline # 79 "d:/tinyos-1.x/tos/platform/mica2/HPLCC1000M.nc" result_t HPLCC1000M$HPLCC1000$init(void) #line 79 { TOSH_MAKE_CC_CHP_OUT_INPUT(); TOSH_MAKE_CC_PALE_OUTPUT(); TOSH_MAKE_CC_PCLK_OUTPUT(); TOSH_MAKE_CC_PDATA_OUTPUT(); TOSH_SET_CC_PALE_PIN(); TOSH_SET_CC_PDATA_PIN(); TOSH_SET_CC_PCLK_PIN(); return SUCCESS; } # 74 "d:/tinyos-1.x/tos/platform/mica2/HPLCC1000.nc" inline static result_t CC1000ControlM$HPLChipcon$init(void){ #line 74 unsigned char result; #line 74 #line 74 result = HPLCC1000M$HPLCC1000$init(); #line 74 #line 74 return result; #line 74 } #line 74 static inline # 156 "d:/tinyos-1.x/tos/platform/mica2/CC1000ControlM.nc" result_t CC1000ControlM$StdControl$init(void) #line 156 { CC1000ControlM$HPLChipcon$init(); CC1000ControlM$HPLChipcon$write(0x00, ((( 1 << 5) | (1 << 4)) | ( 1 << 3)) | (1 << 1)); CC1000ControlM$HPLChipcon$write(0x00, (((( 1 << 5) | (1 << 4)) | ( 1 << 3)) | (1 << 1)) | ( 1 << 0)); TOSH_uwait(2000); CC1000ControlM$CC1000Control$Tune(0x01); return SUCCESS; } # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t CC1000RadioIntM$CC1000StdControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = CC1000ControlM$StdControl$init(); #line 52 #line 52 return result; #line 52 } #line 52 # 137 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_MAKE_MOSI_INPUT(void) #line 137 { #line 137 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x17 + 0x20) &= ~(1 << 2); } static __inline void TOSH_MAKE_SPI_SCK_INPUT(void) #line 140 { #line 140 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x17 + 0x20) &= ~(1 << 1); } static inline # 114 "d:/tinyos-1.x/tos/platform/mica2/HPLSpiM.nc" result_t HPLSpiM$SpiByteFifo$initSlave(void) #line 114 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 115 { TOSH_MAKE_SPI_SCK_INPUT(); TOSH_MAKE_MISO_INPUT(); TOSH_MAKE_MOSI_INPUT(); * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0D + 0x20) &= ~(1 << 3); * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0D + 0x20) &= ~(1 << 2); * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0D + 0x20) |= 1 << 7; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0D + 0x20) |= 1 << 6; } #line 123 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 68 "d:/tinyos-1.x/tos/platform/mica2/SpiByteFifo.nc" inline static result_t CC1000RadioIntM$SpiByteFifo$initSlave(void){ #line 68 unsigned char result; #line 68 #line 68 result = HPLSpiM$SpiByteFifo$initSlave(); #line 68 #line 68 return result; #line 68 } #line 68 static inline # 210 "d:/tinyos-1.x/tos/platform/mica2/CC1000RadioIntM.nc" result_t CC1000RadioIntM$StdControl$init(void) #line 210 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 212 { CC1000RadioIntM$RadioState = CC1000RadioIntM$DISABLED_STATE; CC1000RadioIntM$RadioTxState = CC1000RadioIntM$TXSTATE_PREAMBLE; CC1000RadioIntM$rxbufptr = &CC1000RadioIntM$RxBuf; CC1000RadioIntM$rxlength = MSG_DATA_SIZE - 2; CC1000RadioIntM$RxBitOffset = 0; CC1000RadioIntM$PreambleCount = 0; CC1000RadioIntM$RSSISampleFreq = 0; CC1000RadioIntM$RxShiftBuf.W = 0; CC1000RadioIntM$bTxPending = FALSE; CC1000RadioIntM$bTxBusy = FALSE; CC1000RadioIntM$bRSSIValid = FALSE; CC1000RadioIntM$sMacDelay = -1; CC1000RadioIntM$usRSSIVal = -1; CC1000RadioIntM$lplpower = CC1000RadioIntM$lplpowertx = 0; CC1000RadioIntM$usSquelchVal = ({ #line 228 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_LPL_SquelchInit[CC1000RadioIntM$lplpower]; #line 228 unsigned char __result; #line 228 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } ); } #line 231 __nesc_atomic_end(__nesc_atomic); } #line 231 CC1000RadioIntM$SpiByteFifo$initSlave(); CC1000RadioIntM$CC1000StdControl$init(); CC1000RadioIntM$CC1000Control$SelectLock(0x9); CC1000RadioIntM$bInvertRxData = CC1000RadioIntM$CC1000Control$GetLOStatus(); CC1000RadioIntM$ADCControl$bindPort(TOS_ADC_CC_RSSI_PORT, TOSH_ACTUAL_CC_RSSI_PORT); CC1000RadioIntM$ADCControl$init(); CC1000RadioIntM$Random$init(); CC1000RadioIntM$TimerControl$init(); CC1000RadioIntM$LocalAddr = TOS_LOCAL_ADDRESS; return SUCCESS; } # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t AMStandard$RadioControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = CC1000RadioIntM$StdControl$init(); #line 52 #line 52 return result; #line 52 } #line 52 # 89 "d:/tinyos-1.x/tos/interfaces/HPLUART.nc" inline static result_t UARTM$HPLUART$init(void){ #line 89 unsigned char result; #line 89 #line 89 result = HPLUART0M$UART$init(); #line 89 #line 89 return result; #line 89 } #line 89 static inline # 83 "d:/tinyos-1.x/tos/system/UARTM.nc" result_t UARTM$Control$init(void) #line 83 { { } #line 84 ; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 85 { UARTM$state = FALSE; } #line 87 __nesc_atomic_end(__nesc_atomic); } return UARTM$HPLUART$init(); } # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t NoCRCPacket$ByteControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = UARTM$Control$init(); #line 52 #line 52 return result; #line 52 } #line 52 static inline # 116 "d:/tinyos-1.x/tos/system/NoCRCPacket.nc" result_t NoCRCPacket$Control$init(void) #line 116 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 117 { NoCRCPacket$recPtr = (uint8_t *)&NoCRCPacket$buffers[0]; NoCRCPacket$bufferIndex = 0; NoCRCPacket$bufferPtrs[0] = &NoCRCPacket$buffers[0]; NoCRCPacket$bufferPtrs[1] = &NoCRCPacket$buffers[1]; NoCRCPacket$state = NoCRCPacket$IDLE; NoCRCPacket$txCount = NoCRCPacket$rxCount = 0; NoCRCPacket$rxLength = (size_t )& ((TOS_Msg *)0)->type + 1; { } #line 127 ; } #line 128 __nesc_atomic_end(__nesc_atomic); } return NoCRCPacket$ByteControl$init(); } # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t AMStandard$UARTControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = NoCRCPacket$Control$init(); #line 52 #line 52 return result; #line 52 } #line 52 inline static result_t AMStandard$TimerControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = LogicalTimeM$StdControl$init(); #line 52 #line 52 return result; #line 52 } #line 52 static inline # 111 "d:/tinyos-1.x/tos/system/AMStandard.nc" bool AMStandard$Control$init(void) #line 111 { result_t ok1; #line 112 result_t ok2; #line 113 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 113 { AMStandard$TimerControl$init(); ok1 = AMStandard$UARTControl$init(); ok2 = AMStandard$RadioControl$init(); AMStandard$state = FALSE; AMStandard$lastCount = 0; AMStandard$counter = 0; { } #line 120 ; } #line 121 __nesc_atomic_end(__nesc_atomic); } return rcombine(ok1, ok2); } # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t NetworkM$SubControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = AMStandard$Control$init(); #line 52 #line 52 return result; #line 52 } #line 52 static inline # 252 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkM.nc" result_t NetworkM$StdControl$init(void) #line 252 { int i; NetworkM$mSendCount = 0; NetworkM$mLastCheck = 0; NetworkM$mLastHeard = 0; NetworkM$mContention = 0; NetworkM$mRem = 0; NetworkM$mNextMsg = 0; for (i = 0; i < NetworkM$NUM_RECENT_MSGS; i++) NetworkM$mRecentMsgs[i] = 0xFFFFFFFF; NetworkM$mRelOccupiedBits = 0; for (i = 0; i < NetworkM$NUM_ROOTS; i++) { NetworkM$mParentIx[i] = NetworkM$PARENT_UNKNOWN; NetworkM$mRoots[i] = NetworkM$UNKNOWN_ROOT; } NetworkM$mIdx = 0; NetworkM$mFanout = 0xFF; NetworkM$mCentralized = FALSE; NetworkM$mFanout = 0; NetworkM$mRadio = FALSE; NetworkM$mForceTopology = FALSE; NetworkM$mWasCommand = FALSE; NetworkM$mUart = FALSE; NetworkM$mRetryCnt = 0; return NetworkM$SubControl$init(); } # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t TupleRouterM$NetControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = NetworkM$StdControl$init(); #line 52 #line 52 return result; #line 52 } #line 52 # 87 "d:/tinyos-1.x/tos/interfaces/TimeUtil.nc" inline static char ServiceSchedulerM$TimeUtil$compare(tos_time_t arg_0xa4fb3b8, tos_time_t arg_0xa4fb500){ #line 87 char result; #line 87 #line 87 result = TimeUtilC$TimeUtil$compare(arg_0xa4fb3b8, arg_0xa4fb500); #line 87 #line 87 return result; #line 87 } #line 87 static inline # 65 "d:/tinyos-1.x/tos/lib/ServiceSchedulerM.nc" char ServiceSchedulerM$compare_elts(pq_element i, pq_element j) #line 65 { return ServiceSchedulerM$TimeUtil$compare(ServiceSchedulerM$sched_info[i].start_time, ServiceSchedulerM$sched_info[j].start_time); } static inline # 40 "d:/tinyos-1.x/tos/interfaces/pqueue.h" void pqueue_init(pqueue_t *pq, uint8_t size, char (*compare)(pq_element , pq_element )) #line 40 { pq->size = size; pq->n_elements = 0; pq->compare = compare; } static inline # 125 "d:/tinyos-1.x/tos/lib/ServiceSchedulerM.nc" result_t ServiceSchedulerM$SchedulerClt$init(void) #line 125 { int i; #line 127 pqueue_init((pqueue_t *)&ServiceSchedulerM$event_q, ServiceSchedulerM$MAX_SERVICES, ServiceSchedulerM$compare_elts); for (i = 0; i < ServiceSchedulerM$MAX_SERVICES; i++) { ServiceSchedulerM$sched_info[i].flags = DISABLED; } return SUCCESS; } static inline # 392 "d:/tinyos-1.x/tos/lib/TinyDB/DBBufferC.nc" void DBBufferC$initCatalog(void) #line 392 { DBBufferC$ATTR_TYPES[0] = STRING; DBBufferC$ATTR_SIZES[0] = sizeOf(STRING); strcpy(DBBufferC$ATTR_NAMES[0], "name"); } static inline #line 313 result_t DBBufferC$StdControl$init(void) #line 313 { DBBufferC$mUsedBufs = 1; DBBufferC$mState = DBBufferC$kIDLE; DBBufferC$initCatalog(); DBBufferC$mEepromRow = (void *)0; return SUCCESS; } # 66 "d:/tinyos-1.x/tos/interfaces/CommandRegister.nc" inline static result_t CommandAttrM$CommandRegister$registerCommand(char *arg_0xa77f610, TOSType arg_0xa77f750, uint8_t arg_0xa77f890, ParamList *arg_0xa77f9f8){ #line 66 unsigned char result; #line 66 #line 66 result = Command$Cmd$registerCommand(6, arg_0xa77f610, arg_0xa77f750, arg_0xa77f890, arg_0xa77f9f8); #line 66 #line 66 return result; #line 66 } #line 66 static inline # 57 "d:/tinyos-1.x/tos/lib/Commands/CommandAttrM.nc" result_t CommandAttrM$StdControl$init(void) { ParamList paramList; #line 60 setParamList(¶mList, 3, STRING, UINT8, UINT32); if (CommandAttrM$CommandRegister$registerCommand("addattr", VOID, 0, ¶mList) != SUCCESS) { return FAIL; } #line 63 return SUCCESS; } # 66 "d:/tinyos-1.x/tos/interfaces/CommandRegister.nc" inline static result_t CommandPotM$SetPot$registerCommand(char *arg_0xa77f610, TOSType arg_0xa77f750, uint8_t arg_0xa77f890, ParamList *arg_0xa77f9f8){ #line 66 unsigned char result; #line 66 #line 66 result = Command$Cmd$registerCommand(2, arg_0xa77f610, arg_0xa77f750, arg_0xa77f890, arg_0xa77f9f8); #line 66 #line 66 return result; #line 66 } #line 66 static inline # 58 "d:/tinyos-1.x/tos/lib/Commands/CommandPotM.nc" result_t CommandPotM$StdControl$init(void) { ParamList paramList; #line 61 setParamList(¶mList, 1, UINT8); if (CommandPotM$SetPot$registerCommand("SetPot", VOID, 0, ¶mList) != SUCCESS) { return FAIL; } #line 64 return SUCCESS; } # 66 "d:/tinyos-1.x/tos/interfaces/CommandRegister.nc" inline static result_t CommandLedsM$YellowLedCmd$registerCommand(char *arg_0xa77f610, TOSType arg_0xa77f750, uint8_t arg_0xa77f890, ParamList *arg_0xa77f9f8){ #line 66 unsigned char result; #line 66 #line 66 result = Command$Cmd$registerCommand(5, arg_0xa77f610, arg_0xa77f750, arg_0xa77f890, arg_0xa77f9f8); #line 66 #line 66 return result; #line 66 } #line 66 # 66 "d:/tinyos-1.x/tos/interfaces/CommandRegister.nc" inline static result_t CommandLedsM$GreenLedCmd$registerCommand(char *arg_0xa77f610, TOSType arg_0xa77f750, uint8_t arg_0xa77f890, ParamList *arg_0xa77f9f8){ #line 66 unsigned char result; #line 66 #line 66 result = Command$Cmd$registerCommand(4, arg_0xa77f610, arg_0xa77f750, arg_0xa77f890, arg_0xa77f9f8); #line 66 #line 66 return result; #line 66 } #line 66 # 66 "d:/tinyos-1.x/tos/interfaces/CommandRegister.nc" inline static result_t CommandLedsM$RedLedCmd$registerCommand(char *arg_0xa77f610, TOSType arg_0xa77f750, uint8_t arg_0xa77f890, ParamList *arg_0xa77f9f8){ #line 66 unsigned char result; #line 66 #line 66 result = Command$Cmd$registerCommand(3, arg_0xa77f610, arg_0xa77f750, arg_0xa77f890, arg_0xa77f9f8); #line 66 #line 66 return result; #line 66 } #line 66 static inline # 81 "d:/tinyos-1.x/tos/system/LedsC.nc" result_t LedsC$Leds$init(void) #line 81 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 82 { LedsC$ledsOn = 0; { } #line 84 ; TOSH_SET_RED_LED_PIN(); TOSH_SET_YELLOW_LED_PIN(); TOSH_SET_GREEN_LED_PIN(); } #line 88 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 83 "d:/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t CommandLedsM$Leds$init(void){ #line 83 unsigned char result; #line 83 #line 83 result = LedsC$Leds$init(); #line 83 #line 83 return result; #line 83 } #line 83 static inline # 61 "d:/tinyos-1.x/tos/lib/Commands/CommandLedsM.nc" result_t CommandLedsM$StdControl$init(void) { ParamList paramList; #line 64 CommandLedsM$Leds$init(); setParamList(¶mList, 1, UINT8); if (CommandLedsM$RedLedCmd$registerCommand("SetLedR", VOID, 0, ¶mList) != SUCCESS) { return FAIL; } #line 68 if (CommandLedsM$GreenLedCmd$registerCommand("SetLedG", VOID, 0, ¶mList) != SUCCESS) { return FAIL; } #line 70 if (CommandLedsM$YellowLedCmd$registerCommand("SetLedY", VOID, 0, ¶mList) != SUCCESS) { return FAIL; } #line 72 return SUCCESS; } # 66 "d:/tinyos-1.x/tos/interfaces/CommandRegister.nc" inline static result_t CommandSounderM$SetSound$registerCommand(char *arg_0xa77f610, TOSType arg_0xa77f750, uint8_t arg_0xa77f890, ParamList *arg_0xa77f9f8){ #line 66 unsigned char result; #line 66 #line 66 result = Command$Cmd$registerCommand(1, arg_0xa77f610, arg_0xa77f750, arg_0xa77f890, arg_0xa77f9f8); #line 66 #line 66 return result; #line 66 } #line 66 # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t CommandSounderM$TimerControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = LogicalTimeM$StdControl$init(); #line 52 #line 52 return result; #line 52 } #line 52 # 145 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_CLR_PW2_PIN(void) #line 145 { #line 145 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x15 + 0x20) &= ~(1 << 2); } # 98 "d:/tinyos-1.x/tos/sensorboards/micasb/sensorboard.h" static __inline void TOSH_CLR_SOUNDER_CTL_PIN(void) #line 98 { #line 98 TOSH_CLR_PW2_PIN(); } #line 98 static __inline void TOSH_MAKE_SOUNDER_CTL_OUTPUT(void) #line 98 { } static inline # 73 "d:/tinyos-1.x/tos/sensorboards/micasb/SounderM.nc" result_t SounderM$StdControl$init(void) #line 73 { TOSH_MAKE_SOUNDER_CTL_OUTPUT(); TOSH_CLR_SOUNDER_CTL_PIN(); { } #line 76 ; return SUCCESS; } # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t CommandSounderM$SounderControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = SounderM$StdControl$init(); #line 52 #line 52 return result; #line 52 } #line 52 static inline # 61 "d:/tinyos-1.x/tos/lib/Commands/CommandSounderM.nc" result_t CommandSounderM$StdControl$init(void) { ParamList paramList; #line 64 CommandSounderM$SounderControl$init(); CommandSounderM$TimerControl$init(); setParamList(¶mList, 1, INT16); if (CommandSounderM$SetSound$registerCommand("SetSnd", VOID, 0, ¶mList) != SUCCESS) { return FAIL; } #line 69 CommandSounderM$commandPending = FALSE; return SUCCESS; } # 66 "d:/tinyos-1.x/tos/interfaces/CommandRegister.nc" inline static result_t CommandResetM$ResetCmd$registerCommand(char *arg_0xa77f610, TOSType arg_0xa77f750, uint8_t arg_0xa77f890, ParamList *arg_0xa77f9f8){ #line 66 unsigned char result; #line 66 #line 66 result = Command$Cmd$registerCommand(0, arg_0xa77f610, arg_0xa77f750, arg_0xa77f890, arg_0xa77f9f8); #line 66 #line 66 return result; #line 66 } #line 66 static inline # 58 "d:/tinyos-1.x/tos/lib/Commands/CommandResetM.nc" result_t CommandResetM$StdControl$init(void) { ParamList paramList; #line 61 paramList.numParams = 0; if (CommandResetM$ResetCmd$registerCommand("Reset", VOID, 0, ¶mList) != SUCCESS) { return FAIL; } #line 64 return SUCCESS; } # 154 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_MAKE_I2C_BUS1_SDA_OUTPUT(void) #line 154 { #line 154 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x11 + 0x20) |= 1 << 1; } static inline # 98 "d:/tinyos-1.x/tos/platform/mica/I2CM.nc" void I2CM$MAKE_DATA_OUTPUT(void) #line 98 { #line 98 TOSH_MAKE_I2C_BUS1_SDA_OUTPUT(); } # 153 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_MAKE_I2C_BUS1_SCL_OUTPUT(void) #line 153 { #line 153 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x11 + 0x20) |= 1 << 0; } static inline # 93 "d:/tinyos-1.x/tos/platform/mica/I2CM.nc" void I2CM$MAKE_CLOCK_OUTPUT(void) #line 93 { #line 93 TOSH_MAKE_I2C_BUS1_SCL_OUTPUT(); } # 154 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_SET_I2C_BUS1_SDA_PIN(void) #line 154 { #line 154 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x12 + 0x20) |= 1 << 1; } static inline # 96 "d:/tinyos-1.x/tos/platform/mica/I2CM.nc" void I2CM$SET_DATA(void) #line 96 { #line 96 TOSH_SET_I2C_BUS1_SDA_PIN(); } # 153 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_SET_I2C_BUS1_SCL_PIN(void) #line 153 { #line 153 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x12 + 0x20) |= 1 << 0; } static inline # 91 "d:/tinyos-1.x/tos/platform/mica/I2CM.nc" void I2CM$SET_CLOCK(void) #line 91 { #line 91 TOSH_SET_I2C_BUS1_SCL_PIN(); } static inline #line 200 result_t I2CM$StdControl$init(void) #line 200 { I2CM$SET_CLOCK(); I2CM$SET_DATA(); I2CM$MAKE_CLOCK_OUTPUT(); I2CM$MAKE_DATA_OUTPUT(); I2CM$state = 0; I2CM$local_data = 0; return SUCCESS; } # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t I2CPotM$I2CControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = I2CM$StdControl$init(); #line 52 #line 52 return result; #line 52 } #line 52 static inline # 109 "d:/tinyos-1.x/tos/sensorboards/micasb/I2CPotM.nc" result_t I2CPotM$StdControl$init(void) #line 109 { I2CPotM$I2CControl$init(); I2CPotM$state = I2CPotM$IDLE; return SUCCESS; } # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t MicM$PotControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = I2CPotM$StdControl$init(); #line 52 #line 52 return result; #line 52 } #line 52 # 77 "d:/tinyos-1.x/tos/interfaces/ADCControl.nc" inline static result_t MicM$ADCControl$init(void){ #line 77 unsigned char result; #line 77 #line 77 result = ADCM$ADCControl$init(); #line 77 #line 77 return result; #line 77 } #line 77 static inline # 133 "d:/tinyos-1.x/tos/sensorboards/micasb/MicM.nc" result_t MicM$MicInterrupt$disable(void) #line 133 { * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x39 + 0x20) &= ~(1 << 3); return SUCCESS; } # 134 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_MAKE_INT3_INPUT(void) #line 134 { #line 134 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x02 + 0x20) &= ~(1 << 7); } # 96 "d:/tinyos-1.x/tos/sensorboards/micasb/sensorboard.h" static __inline void TOSH_MAKE_TONE_DECODE_SIGNAL_INPUT(void) #line 96 { #line 96 TOSH_MAKE_INT3_INPUT(); } # 149 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_CLR_PW6_PIN(void) #line 149 { #line 149 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x15 + 0x20) &= ~(1 << 6); } # 101 "d:/tinyos-1.x/tos/sensorboards/micasb/sensorboard.h" static __inline void TOSH_CLR_MIC_MUX_SEL_PIN(void) #line 101 { #line 101 TOSH_CLR_PW6_PIN(); } #line 101 static __inline void TOSH_MAKE_MIC_MUX_SEL_OUTPUT(void) #line 101 { } # 146 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_CLR_PW3_PIN(void) #line 146 { #line 146 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x15 + 0x20) &= ~(1 << 3); } # 97 "d:/tinyos-1.x/tos/sensorboards/micasb/sensorboard.h" static __inline void TOSH_CLR_MIC_CTL_PIN(void) #line 97 { #line 97 TOSH_CLR_PW3_PIN(); } #line 97 static __inline void TOSH_MAKE_MIC_CTL_OUTPUT(void) #line 97 { } # 116 "d:/tinyos-1.x/tos/interfaces/ADCControl.nc" inline static result_t MicM$ADCControl$bindPort(uint8_t arg_0xa41fbc0, uint8_t arg_0xa41fd00){ #line 116 unsigned char result; #line 116 #line 116 result = ADCM$ADCControl$bindPort(arg_0xa41fbc0, arg_0xa41fd00); #line 116 #line 116 return result; #line 116 } #line 116 static inline # 93 "d:/tinyos-1.x/tos/sensorboards/micasb/MicM.nc" result_t MicM$StdControl$init(void) #line 93 { MicM$ADCControl$bindPort(TOS_ADC_MIC_PORT, TOSH_ACTUAL_MIC_PORT); TOSH_MAKE_MIC_CTL_OUTPUT(); TOSH_CLR_MIC_CTL_PIN(); TOSH_MAKE_MIC_MUX_SEL_OUTPUT(); TOSH_CLR_MIC_MUX_SEL_PIN(); TOSH_MAKE_TONE_DECODE_SIGNAL_INPUT(); MicM$MicInterrupt$disable(); return rcombine(MicM$ADCControl$init(), MicM$PotControl$init()); } # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t AttrMicM$MicControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = MicM$StdControl$init(); #line 52 #line 52 return result; #line 52 } #line 52 # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t AttrMicM$AttrTones$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68){ #line 67 unsigned char result; #line 67 #line 67 result = Attr$Attr$registerAttr(18, arg_0xa7ebae0, arg_0xa7ebc28, arg_0xa7ebd68); #line 67 #line 67 return result; #line 67 } #line 67 # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t AttrMicM$AttrNoise$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68){ #line 67 unsigned char result; #line 67 #line 67 result = Attr$Attr$registerAttr(17, arg_0xa7ebae0, arg_0xa7ebc28, arg_0xa7ebd68); #line 67 #line 67 return result; #line 67 } #line 67 static inline # 80 "d:/tinyos-1.x/tos/lib/Attributes/AttrMicM.nc" result_t AttrMicM$StdControl$init(void) { if (AttrMicM$AttrNoise$registerAttr("noise", UINT16, 2) != SUCCESS) { return FAIL; } if (AttrMicM$AttrTones$registerAttr("tones", UINT16, 2) != SUCCESS) { return FAIL; } AttrMicM$toneDetectRunning = FALSE; AttrMicM$noiseSampleRunning = FALSE; return AttrMicM$MicControl$init(); } # 77 "d:/tinyos-1.x/tos/interfaces/ADCControl.nc" inline static result_t AccelM$ADCControl$init(void){ #line 77 unsigned char result; #line 77 #line 77 result = ADCM$ADCControl$init(); #line 77 #line 77 return result; #line 77 } #line 77 # 147 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_SET_PW4_PIN(void) #line 147 { #line 147 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x15 + 0x20) |= 1 << 4; } # 99 "d:/tinyos-1.x/tos/sensorboards/micasb/sensorboard.h" static __inline void TOSH_SET_ACCEL_CTL_PIN(void) #line 99 { #line 99 TOSH_SET_PW4_PIN(); } #line 99 static __inline void TOSH_MAKE_ACCEL_CTL_OUTPUT(void) #line 99 { } # 116 "d:/tinyos-1.x/tos/interfaces/ADCControl.nc" inline static result_t AccelM$ADCControl$bindPort(uint8_t arg_0xa41fbc0, uint8_t arg_0xa41fd00){ #line 116 unsigned char result; #line 116 #line 116 result = ADCM$ADCControl$bindPort(arg_0xa41fbc0, arg_0xa41fd00); #line 116 #line 116 return result; #line 116 } #line 116 static inline # 76 "d:/tinyos-1.x/tos/sensorboards/micasb/AccelM.nc" result_t AccelM$StdControl$init(void) #line 76 { AccelM$ADCControl$bindPort(TOS_ADC_ACCEL_X_PORT, TOSH_ACTUAL_ACCEL_X_PORT); AccelM$ADCControl$bindPort(TOS_ADC_ACCEL_Y_PORT, TOSH_ACTUAL_ACCEL_Y_PORT); TOSH_MAKE_ACCEL_CTL_OUTPUT(); TOSH_SET_ACCEL_CTL_PIN(); { } #line 81 ; return AccelM$ADCControl$init(); } # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t AttrAccelM$AccelControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = AccelM$StdControl$init(); #line 52 #line 52 return result; #line 52 } #line 52 # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t AttrAccelM$AttrAccelY$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68){ #line 67 unsigned char result; #line 67 #line 67 result = Attr$Attr$registerAttr(16, arg_0xa7ebae0, arg_0xa7ebc28, arg_0xa7ebd68); #line 67 #line 67 return result; #line 67 } #line 67 # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t AttrAccelM$AttrAccelX$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68){ #line 67 unsigned char result; #line 67 #line 67 result = Attr$Attr$registerAttr(15, arg_0xa7ebae0, arg_0xa7ebc28, arg_0xa7ebd68); #line 67 #line 67 return result; #line 67 } #line 67 static inline # 64 "d:/tinyos-1.x/tos/lib/Attributes/AttrAccelM.nc" result_t AttrAccelM$StdControl$init(void) { if (AttrAccelM$AttrAccelX$registerAttr("accel_x", UINT16, 2) != SUCCESS) { return FAIL; } #line 68 if (AttrAccelM$AttrAccelY$registerAttr("accel_y", UINT16, 2) != SUCCESS) { return FAIL; } #line 70 return AttrAccelM$AccelControl$init(); } # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t AttrTempM$AttrRegister$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68){ #line 67 unsigned char result; #line 67 #line 67 result = Attr$Attr$registerAttr(13, arg_0xa7ebae0, arg_0xa7ebc28, arg_0xa7ebd68); #line 67 #line 67 return result; #line 67 } #line 67 # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t AttrTempM$SubControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = PhotoTempM$TempStdControl$init(); #line 52 #line 52 return result; #line 52 } #line 52 static inline # 60 "d:/tinyos-1.x/tos/lib/Attributes/AttrTempM.nc" result_t AttrTempM$StdControl$init(void) { AttrTempM$SubControl$init(); if (AttrTempM$AttrRegister$registerAttr("temp", UINT16, 2) != SUCCESS) { return FAIL; } #line 65 return SUCCESS; } # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t AttrPhotoM$AttrRegister$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68){ #line 67 unsigned char result; #line 67 #line 67 result = Attr$Attr$registerAttr(14, arg_0xa7ebae0, arg_0xa7ebc28, arg_0xa7ebd68); #line 67 #line 67 return result; #line 67 } #line 67 # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t AttrPhotoM$SubControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = PhotoTempM$PhotoStdControl$init(); #line 52 #line 52 return result; #line 52 } #line 52 static inline # 60 "d:/tinyos-1.x/tos/lib/Attributes/AttrPhotoM.nc" result_t AttrPhotoM$StdControl$init(void) { AttrPhotoM$SubControl$init(); if (AttrPhotoM$AttrRegister$registerAttr("light", UINT16, 2) != SUCCESS) { return FAIL; } #line 65 return SUCCESS; } # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t AttrVoltageM$AttrRegister$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68){ #line 67 unsigned char result; #line 67 #line 67 result = Attr$Attr$registerAttr(12, arg_0xa7ebae0, arg_0xa7ebc28, arg_0xa7ebd68); #line 67 #line 67 return result; #line 67 } #line 67 static inline # 60 "d:/tinyos-1.x/tos/lib/Attributes/AttrVoltageM.nc" result_t AttrVoltageM$StdControl$init(void) { if (AttrVoltageM$AttrRegister$registerAttr("voltage", UINT16, 2) != SUCCESS) { return FAIL; } #line 64 return SUCCESS; } # 77 "d:/tinyos-1.x/tos/interfaces/ADCControl.nc" inline static result_t VoltageM$ADCControl$init(void){ #line 77 unsigned char result; #line 77 #line 77 result = ADCM$ADCControl$init(); #line 77 #line 77 return result; #line 77 } #line 77 #line 116 inline static result_t VoltageM$ADCControl$bindPort(uint8_t arg_0xa41fbc0, uint8_t arg_0xa41fd00){ #line 116 unsigned char result; #line 116 #line 116 result = ADCM$ADCControl$bindPort(arg_0xa41fbc0, arg_0xa41fd00); #line 116 #line 116 return result; #line 116 } #line 116 static inline # 75 "d:/tinyos-1.x/tos/system/VoltageM.nc" result_t VoltageM$StdControl$init(void) #line 75 { VoltageM$ADCControl$bindPort(TOS_ADC_VOLTAGE_PORT, TOSH_ACTUAL_VOLTAGE_PORT); { } #line 77 ; return VoltageM$ADCControl$init(); } # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t TinyDBAttrM$QualityAttr$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68){ #line 67 unsigned char result; #line 67 #line 67 result = Attr$Attr$registerAttr(6, arg_0xa7ebae0, arg_0xa7ebc28, arg_0xa7ebd68); #line 67 #line 67 return result; #line 67 } #line 67 # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t TinyDBAttrM$QidAttr$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68){ #line 67 unsigned char result; #line 67 #line 67 result = Attr$Attr$registerAttr(5, arg_0xa7ebae0, arg_0xa7ebc28, arg_0xa7ebd68); #line 67 #line 67 return result; #line 67 } #line 67 # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t TinyDBAttrM$DepthAttr$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68){ #line 67 unsigned char result; #line 67 #line 67 result = Attr$Attr$registerAttr(4, arg_0xa7ebae0, arg_0xa7ebc28, arg_0xa7ebd68); #line 67 #line 67 return result; #line 67 } #line 67 # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t TinyDBAttrM$MHQueueLenAttr$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68){ #line 67 unsigned char result; #line 67 #line 67 result = Attr$Attr$registerAttr(3, arg_0xa7ebae0, arg_0xa7ebc28, arg_0xa7ebd68); #line 67 #line 67 return result; #line 67 } #line 67 # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t TinyDBAttrM$QueueLenAttr$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68){ #line 67 unsigned char result; #line 67 #line 67 result = Attr$Attr$registerAttr(2, arg_0xa7ebae0, arg_0xa7ebc28, arg_0xa7ebd68); #line 67 #line 67 return result; #line 67 } #line 67 # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t TinyDBAttrM$FreeSpaceAttr$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68){ #line 67 unsigned char result; #line 67 #line 67 result = Attr$Attr$registerAttr(1, arg_0xa7ebae0, arg_0xa7ebc28, arg_0xa7ebd68); #line 67 #line 67 return result; #line 67 } #line 67 # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t TinyDBAttrM$ParentAttr$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68){ #line 67 unsigned char result; #line 67 #line 67 result = Attr$Attr$registerAttr(0, arg_0xa7ebae0, arg_0xa7ebc28, arg_0xa7ebd68); #line 67 #line 67 return result; #line 67 } #line 67 static inline # 85 "d:/tinyos-1.x/tos/lib/TinyDB/TinyDBAttrM.nc" result_t TinyDBAttrM$StdControl$init(void) { TinyDBAttrM$ParentAttr$registerAttr("parent", UINT16, 2); TinyDBAttrM$FreeSpaceAttr$registerAttr("freeRAM", UINT16, 2); TinyDBAttrM$QueueLenAttr$registerAttr("qlen", UINT8, 1); TinyDBAttrM$MHQueueLenAttr$registerAttr("mhqlen", UINT8, 1); TinyDBAttrM$DepthAttr$registerAttr("depth", UINT8, 1); TinyDBAttrM$QidAttr$registerAttr("qids", UINT16, 2); TinyDBAttrM$QualityAttr$registerAttr("qual", UINT8, 1); return SUCCESS; } # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t AttrTimeM$TimeHighAttr$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68){ #line 67 unsigned char result; #line 67 #line 67 result = Attr$Attr$registerAttr(11, arg_0xa7ebae0, arg_0xa7ebc28, arg_0xa7ebd68); #line 67 #line 67 return result; #line 67 } #line 67 # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t AttrTimeM$TimeLowAttr$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68){ #line 67 unsigned char result; #line 67 #line 67 result = Attr$Attr$registerAttr(10, arg_0xa7ebae0, arg_0xa7ebc28, arg_0xa7ebd68); #line 67 #line 67 return result; #line 67 } #line 67 static inline # 57 "d:/tinyos-1.x/tos/lib/Attributes/AttrTimeM.nc" result_t AttrTimeM$StdControl$init(void) { if (AttrTimeM$TimeLowAttr$registerAttr("timelo", UINT32, 4) != SUCCESS) { return FAIL; } #line 61 if (AttrTimeM$TimeHighAttr$registerAttr("timehi", UINT32, 4) != SUCCESS) { return FAIL; } #line 63 return SUCCESS; } # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t AttrPotM$AttrRegister$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68){ #line 67 unsigned char result; #line 67 #line 67 result = Attr$Attr$registerAttr(7, arg_0xa7ebae0, arg_0xa7ebc28, arg_0xa7ebd68); #line 67 #line 67 return result; #line 67 } #line 67 static inline # 59 "d:/tinyos-1.x/tos/lib/Attributes/AttrPotM.nc" result_t AttrPotM$StdControl$init(void) { if (AttrPotM$AttrRegister$registerAttr("pot", UINT8, 1) != SUCCESS) { return FAIL; } #line 63 return SUCCESS; } # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t AttrGlobalM$GroupAttr$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68){ #line 67 unsigned char result; #line 67 #line 67 result = Attr$Attr$registerAttr(9, arg_0xa7ebae0, arg_0xa7ebc28, arg_0xa7ebd68); #line 67 #line 67 return result; #line 67 } #line 67 # 67 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t AttrGlobalM$NodeIdAttr$registerAttr(char *arg_0xa7ebae0, TOSType arg_0xa7ebc28, uint8_t arg_0xa7ebd68){ #line 67 unsigned char result; #line 67 #line 67 result = Attr$Attr$registerAttr(8, arg_0xa7ebae0, arg_0xa7ebc28, arg_0xa7ebd68); #line 67 #line 67 return result; #line 67 } #line 67 static inline # 58 "d:/tinyos-1.x/tos/lib/Attributes/AttrGlobalM.nc" result_t AttrGlobalM$StdControl$init(void) { if (AttrGlobalM$NodeIdAttr$registerAttr("nodeid", UINT16, 2) != SUCCESS) { return FAIL; } #line 62 if (AttrGlobalM$GroupAttr$registerAttr("group", UINT8, 1) != SUCCESS) { return FAIL; } #line 64 return SUCCESS; } # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t TupleRouterM$ChildControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = AttrGlobalM$StdControl$init(); #line 52 result = rcombine(result, AttrPotM$StdControl$init()); #line 52 result = rcombine(result, AttrTimeM$StdControl$init()); #line 52 result = rcombine(result, TinyDBAttrM$StdControl$init()); #line 52 result = rcombine(result, VoltageM$StdControl$init()); #line 52 result = rcombine(result, AttrVoltageM$StdControl$init()); #line 52 result = rcombine(result, PhotoTempM$PhotoStdControl$init()); #line 52 result = rcombine(result, AttrPhotoM$StdControl$init()); #line 52 result = rcombine(result, PhotoTempM$TempStdControl$init()); #line 52 result = rcombine(result, AttrTempM$StdControl$init()); #line 52 result = rcombine(result, AttrAccelM$StdControl$init()); #line 52 result = rcombine(result, AttrMicM$StdControl$init()); #line 52 result = rcombine(result, CommandResetM$StdControl$init()); #line 52 result = rcombine(result, CommandSounderM$StdControl$init()); #line 52 result = rcombine(result, CommandLedsM$StdControl$init()); #line 52 result = rcombine(result, CommandPotM$StdControl$init()); #line 52 result = rcombine(result, CommandAttrM$StdControl$init()); #line 52 result = rcombine(result, DBBufferC$StdControl$init()); #line 52 result = rcombine(result, ServiceSchedulerM$SchedulerClt$init()); #line 52 #line 52 return result; #line 52 } #line 52 static inline # 1829 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$initConsts(void) #line 1829 { TupleRouterM$uaActive = 16900; TupleRouterM$uaXmit = 17320; TupleRouterM$uaSleep = 220; } static inline #line 559 result_t TupleRouterM$StdControl$init(void) #line 559 { TupleRouterM$mPendingMask = 0; TupleRouterM$mCycleToSend = 0; TupleRouterM$mQs = (void *)0; TupleRouterM$mTail = (void *)0; TupleRouterM$mCurQuery = (void *)0; TupleRouterM$mNumBlocked = 0; TupleRouterM$mOldRate = 0; TupleRouterM$mFetchTries = 0; TupleRouterM$mTriedAllocWaiting = FALSE; TupleRouterM$mTriedQueryRequest = FALSE; TupleRouterM$mFixedComm = FALSE; TupleRouterM$mSendQueryNextClock = FALSE; TupleRouterM$mSending = FALSE; TupleRouterM$mClockCount = 0; TupleRouterM$mQueryClockCount = 0; TupleRouterM$mAllocState = TupleRouterM$STATE_NOT_ALLOCING; TupleRouterM$mLastQuery = (void *)0; TupleRouterM$mIsRunning = FALSE; TupleRouterM$mRadioWaiting = FALSE; TupleRouterM$mSendingResult = FALSE; TupleRouterM$mMustTimestamp = FALSE; TupleRouterM$initConsts(); TupleRouterM$ChildControl$init(); TupleRouterM$NetControl$init(); TupleRouterM$TimerControl$init(); TupleRouterM$mStopped = TRUE; TupleRouterM$mSendFailed = 0; return SUCCESS; } # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t RealMain$StdControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = TupleRouterM$StdControl$init(); #line 52 result = rcombine(result, TinyAlloc$StdControl$init()); #line 52 #line 52 return result; #line 52 } #line 52 # 116 "d:/tinyos-1.x/tos/interfaces/ADCControl.nc" inline static result_t PhotoTempM$ADCControl$bindPort(uint8_t arg_0xa41fbc0, uint8_t arg_0xa41fd00){ #line 116 unsigned char result; #line 116 #line 116 result = ADCM$ADCControl$bindPort(arg_0xa41fbc0, arg_0xa41fd00); #line 116 #line 116 return result; #line 116 } #line 116 #line 77 inline static result_t PhotoTempM$ADCControl$init(void){ #line 77 unsigned char result; #line 77 #line 77 result = ADCM$ADCControl$init(); #line 77 #line 77 return result; #line 77 } #line 77 static inline # 80 "d:/tinyos-1.x/tos/platform/mica/HPLClock.nc" result_t HPLClock$StdControl$init(void) #line 80 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 81 { HPLClock$mscale = DEFAULT_SCALE; HPLClock$minterval = DEFAULT_INTERVAL; } #line 84 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 52 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t LogicalTimeM$ClockControl$init(void){ #line 52 unsigned char result; #line 52 #line 52 result = HPLClock$StdControl$init(); #line 52 #line 52 return result; #line 52 } #line 52 # 86 "d:/tinyos-1.x/tos/interfaces/Interrupt.nc" inline static result_t HPLUART0M$Interrupt$enable(void){ #line 86 unsigned char result; #line 86 #line 86 result = HPLInterrupt$Interrupt$enable(); #line 86 #line 86 return result; #line 86 } #line 86 # 122 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_CLR_CC_PALE_PIN(void) #line 122 { #line 122 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x12 + 0x20) &= ~(1 << 4); } #line 120 static __inline void TOSH_CLR_CC_PDATA_PIN(void) #line 120 { #line 120 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x12 + 0x20) &= ~(1 << 7); } #line 121 static __inline void TOSH_CLR_CC_PCLK_PIN(void) #line 121 { #line 121 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x12 + 0x20) &= ~(1 << 6); } #line 120 static __inline void TOSH_MAKE_CC_PDATA_INPUT(void) #line 120 { #line 120 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x11 + 0x20) &= ~(1 << 7); } #line 120 static __inline int TOSH_READ_CC_PDATA_PIN(void) #line 120 { #line 120 return (* (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x10 + 0x20) & (1 << 7)) != 0; } static inline # 196 "d:/tinyos-1.x/tos/lib/TinyAlloc.nc" result_t TinyAlloc$StdControl$start(void) #line 196 { return SUCCESS; } # 59 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t RealMain$StdControl$start(void){ #line 59 unsigned char result; #line 59 #line 59 result = TupleRouterM$StdControl$start(); #line 59 result = rcombine(result, TinyAlloc$StdControl$start()); #line 59 #line 59 return result; #line 59 } #line 59 # 55 "d:/tinyos-1.x/tos/interfaces/AbsoluteTimer.nc" inline static result_t ServiceSchedulerM$AbsoluteTimer$set(tos_time_t arg_0xa4fed40){ #line 55 unsigned char result; #line 55 #line 55 result = LogicalTimeM$AbsoluteTimer$set(1, arg_0xa4fed40); #line 55 #line 55 return result; #line 55 } #line 55 static inline # 101 "d:/tinyos-1.x/tos/interfaces/pqueue.h" pq_element pqueue_peek(pqueue_t *pq) #line 101 { if (pq->n_elements == 0) { return -1; } return pq->heap[0]; } static inline # 142 "d:/tinyos-1.x/tos/lib/ServiceSchedulerM.nc" result_t ServiceSchedulerM$SchedulerClt$start(void) #line 142 { int8_t svc_id; #line 144 if ((svc_id = pqueue_peek((pqueue_t *)&ServiceSchedulerM$event_q)) < 0) { return SUCCESS; } #line 146 return ServiceSchedulerM$AbsoluteTimer$set(ServiceSchedulerM$sched_info[svc_id].start_time); } static inline # 334 "d:/tinyos-1.x/tos/lib/TinyDB/DBBufferC.nc" result_t DBBufferC$StdControl$start(void) #line 334 { #line 384 return SUCCESS; } static inline # 66 "d:/tinyos-1.x/tos/lib/Commands/CommandAttrM.nc" result_t CommandAttrM$StdControl$start(void) { return SUCCESS; } static inline # 67 "d:/tinyos-1.x/tos/lib/Commands/CommandPotM.nc" result_t CommandPotM$StdControl$start(void) { return SUCCESS; } static inline # 75 "d:/tinyos-1.x/tos/lib/Commands/CommandLedsM.nc" result_t CommandLedsM$StdControl$start(void) { return SUCCESS; } static inline # 73 "d:/tinyos-1.x/tos/lib/Commands/CommandSounderM.nc" result_t CommandSounderM$StdControl$start(void) { return SUCCESS; } static inline # 67 "d:/tinyos-1.x/tos/lib/Commands/CommandResetM.nc" result_t CommandResetM$StdControl$start(void) { return SUCCESS; } # 146 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_SET_PW3_PIN(void) #line 146 { #line 146 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x15 + 0x20) |= 1 << 3; } # 97 "d:/tinyos-1.x/tos/sensorboards/micasb/sensorboard.h" static __inline void TOSH_SET_MIC_CTL_PIN(void) #line 97 { #line 97 TOSH_SET_PW3_PIN(); } static inline # 104 "d:/tinyos-1.x/tos/sensorboards/micasb/MicM.nc" result_t MicM$StdControl$start(void) #line 104 { TOSH_SET_MIC_CTL_PIN(); return SUCCESS; } # 59 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t AttrMicM$MicControl$start(void){ #line 59 unsigned char result; #line 59 #line 59 result = MicM$StdControl$start(); #line 59 #line 59 return result; #line 59 } #line 59 static inline # 218 "d:/tinyos-1.x/tos/platform/mica/I2CM.nc" result_t I2CM$I2C$sendStart(void) #line 218 { if (I2CM$state != 0) { return FAIL; } #line 221 I2CM$state = I2CM$SEND_START; TOS_post(I2CM$I2C_task); return SUCCESS; } # 72 "d:/tinyos-1.x/tos/interfaces/I2C.nc" inline static result_t I2CPotM$I2C$sendStart(void){ #line 72 unsigned char result; #line 72 #line 72 result = I2CM$I2C$sendStart(); #line 72 #line 72 return result; #line 72 } #line 72 static inline # 124 "d:/tinyos-1.x/tos/sensorboards/micasb/I2CPotM.nc" result_t I2CPotM$I2CPot$writePot(char line_addr, char pot_addr, char in_data) #line 125 { if (I2CPotM$state == I2CPotM$IDLE) { I2CPotM$addr = line_addr; I2CPotM$pot = pot_addr; I2CPotM$data = in_data; I2CPotM$state = I2CPotM$WRITE_POT_START; if (I2CPotM$I2C$sendStart()) { return SUCCESS; } else #line 136 { I2CPotM$state = I2CPotM$IDLE; return FAIL; } } else #line 140 { return FAIL; } } # 63 "d:/tinyos-1.x/tos/interfaces/I2CPot.nc" inline static result_t MicM$I2CPot$writePot(char arg_0xab15418, char arg_0xab15550, char arg_0xab15688){ #line 63 unsigned char result; #line 63 #line 63 result = I2CPotM$I2CPot$writePot(arg_0xab15418, arg_0xab15550, arg_0xab15688); #line 63 #line 63 return result; #line 63 } #line 63 static inline # 138 "d:/tinyos-1.x/tos/sensorboards/micasb/MicM.nc" result_t MicM$Mic$gainAdjust(uint8_t val) #line 138 { return MicM$I2CPot$writePot(TOS_MIC_POT_ADDR, 0, val); } # 91 "d:/tinyos-1.x/tos/interfaces/Mic.nc" inline static result_t AttrMicM$Mic$gainAdjust(uint8_t arg_0xaad99d8){ #line 91 unsigned char result; #line 91 #line 91 result = MicM$Mic$gainAdjust(arg_0xaad99d8); #line 91 #line 91 return result; #line 91 } #line 91 # 149 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_SET_PW6_PIN(void) #line 149 { #line 149 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x15 + 0x20) |= 1 << 6; } # 101 "d:/tinyos-1.x/tos/sensorboards/micasb/sensorboard.h" static __inline void TOSH_SET_MIC_MUX_SEL_PIN(void) #line 101 { #line 101 TOSH_SET_PW6_PIN(); } static inline # 117 "d:/tinyos-1.x/tos/sensorboards/micasb/MicM.nc" result_t MicM$Mic$muxSel(uint8_t sel) #line 117 { if (sel == 0) { TOSH_CLR_MIC_MUX_SEL_PIN(); return SUCCESS; } else { #line 121 if (sel == 1) { TOSH_SET_MIC_MUX_SEL_PIN(); return SUCCESS; } } #line 125 return FAIL; } # 87 "d:/tinyos-1.x/tos/interfaces/Mic.nc" inline static result_t AttrMicM$Mic$muxSel(uint8_t arg_0xaad95e0){ #line 87 unsigned char result; #line 87 #line 87 result = MicM$Mic$muxSel(arg_0xaad95e0); #line 87 #line 87 return result; #line 87 } #line 87 static inline # 101 "d:/tinyos-1.x/tos/lib/Attributes/AttrMicM.nc" result_t AttrMicM$StdControl$start(void) { AttrMicM$Mic$muxSel(1); AttrMicM$Mic$gainAdjust(64); return AttrMicM$MicControl$start(); } static inline # 73 "d:/tinyos-1.x/tos/lib/Attributes/AttrAccelM.nc" result_t AttrAccelM$StdControl$start(void) { return SUCCESS; } # 133 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_MAKE_INT2_OUTPUT(void) #line 133 { #line 133 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x02 + 0x20) |= 1 << 6; } # 95 "d:/tinyos-1.x/tos/sensorboards/micasb/sensorboard.h" static __inline void TOSH_MAKE_TEMP_CTL_OUTPUT(void) #line 95 { #line 95 TOSH_MAKE_INT2_OUTPUT(); } # 133 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_SET_INT2_PIN(void) #line 133 { #line 133 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x03 + 0x20) |= 1 << 6; } # 95 "d:/tinyos-1.x/tos/sensorboards/micasb/sensorboard.h" static __inline void TOSH_SET_TEMP_CTL_PIN(void) #line 95 { #line 95 TOSH_SET_INT2_PIN(); } static inline # 135 "d:/tinyos-1.x/tos/sensorboards/micasb/PhotoTempM.nc" result_t PhotoTempM$TempStdControl$start(void) #line 135 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 136 { TOSH_SET_TEMP_CTL_PIN(); TOSH_MAKE_TEMP_CTL_OUTPUT(); } #line 139 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 59 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t AttrTempM$SubControl$start(void){ #line 59 unsigned char result; #line 59 #line 59 result = PhotoTempM$TempStdControl$start(); #line 59 #line 59 return result; #line 59 } #line 59 static inline # 68 "d:/tinyos-1.x/tos/lib/Attributes/AttrTempM.nc" result_t AttrTempM$StdControl$start(void) { AttrTempM$SubControl$start(); return SUCCESS; } # 132 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_MAKE_INT1_OUTPUT(void) #line 132 { #line 132 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x02 + 0x20) |= 1 << 5; } # 94 "d:/tinyos-1.x/tos/sensorboards/micasb/sensorboard.h" static __inline void TOSH_MAKE_PHOTO_CTL_OUTPUT(void) #line 94 { #line 94 TOSH_MAKE_INT1_OUTPUT(); } # 132 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_SET_INT1_PIN(void) #line 132 { #line 132 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x03 + 0x20) |= 1 << 5; } # 94 "d:/tinyos-1.x/tos/sensorboards/micasb/sensorboard.h" static __inline void TOSH_SET_PHOTO_CTL_PIN(void) #line 94 { #line 94 TOSH_SET_INT1_PIN(); } static inline # 110 "d:/tinyos-1.x/tos/sensorboards/micasb/PhotoTempM.nc" result_t PhotoTempM$PhotoStdControl$start(void) #line 110 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 111 { TOSH_SET_PHOTO_CTL_PIN(); TOSH_MAKE_PHOTO_CTL_OUTPUT(); } #line 114 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 59 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t AttrPhotoM$SubControl$start(void){ #line 59 unsigned char result; #line 59 #line 59 result = PhotoTempM$PhotoStdControl$start(); #line 59 #line 59 return result; #line 59 } #line 59 static inline # 68 "d:/tinyos-1.x/tos/lib/Attributes/AttrPhotoM.nc" result_t AttrPhotoM$StdControl$start(void) { AttrPhotoM$SubControl$start(); return SUCCESS; } static inline # 67 "d:/tinyos-1.x/tos/lib/Attributes/AttrVoltageM.nc" result_t AttrVoltageM$StdControl$start(void) { return SUCCESS; } static inline # 80 "d:/tinyos-1.x/tos/system/VoltageM.nc" result_t VoltageM$StdControl$start(void) #line 80 { return SUCCESS; } static inline # 101 "d:/tinyos-1.x/tos/lib/TinyDB/TinyDBAttrM.nc" result_t TinyDBAttrM$StdControl$start(void) { return SUCCESS; } static inline # 66 "d:/tinyos-1.x/tos/lib/Attributes/AttrTimeM.nc" result_t AttrTimeM$StdControl$start(void) { return SUCCESS; } static inline # 66 "d:/tinyos-1.x/tos/lib/Attributes/AttrPotM.nc" result_t AttrPotM$StdControl$start(void) { return SUCCESS; } static inline # 67 "d:/tinyos-1.x/tos/lib/Attributes/AttrGlobalM.nc" result_t AttrGlobalM$StdControl$start(void) { return SUCCESS; } # 59 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t TupleRouterM$ChildControl$start(void){ #line 59 unsigned char result; #line 59 #line 59 result = AttrGlobalM$StdControl$start(); #line 59 result = rcombine(result, AttrPotM$StdControl$start()); #line 59 result = rcombine(result, AttrTimeM$StdControl$start()); #line 59 result = rcombine(result, TinyDBAttrM$StdControl$start()); #line 59 result = rcombine(result, VoltageM$StdControl$start()); #line 59 result = rcombine(result, AttrVoltageM$StdControl$start()); #line 59 result = rcombine(result, PhotoTempM$PhotoStdControl$start()); #line 59 result = rcombine(result, AttrPhotoM$StdControl$start()); #line 59 result = rcombine(result, PhotoTempM$TempStdControl$start()); #line 59 result = rcombine(result, AttrTempM$StdControl$start()); #line 59 result = rcombine(result, AttrAccelM$StdControl$start()); #line 59 result = rcombine(result, AttrMicM$StdControl$start()); #line 59 result = rcombine(result, CommandResetM$StdControl$start()); #line 59 result = rcombine(result, CommandSounderM$StdControl$start()); #line 59 result = rcombine(result, CommandLedsM$StdControl$start()); #line 59 result = rcombine(result, CommandPotM$StdControl$start()); #line 59 result = rcombine(result, CommandAttrM$StdControl$start()); #line 59 result = rcombine(result, DBBufferC$StdControl$start()); #line 59 result = rcombine(result, ServiceSchedulerM$SchedulerClt$start()); #line 59 #line 59 return result; #line 59 } #line 59 static inline # 226 "d:/tinyos-1.x/tos/platform/mica/I2CM.nc" result_t I2CM$I2C$sendEnd(void) #line 226 { if (I2CM$state != 0) { return FAIL; } #line 229 I2CM$state = I2CM$SEND_END; TOS_post(I2CM$I2C_task); return SUCCESS; } # 79 "d:/tinyos-1.x/tos/interfaces/I2C.nc" inline static result_t I2CPotM$I2C$sendEnd(void){ #line 79 unsigned char result; #line 79 #line 79 result = I2CM$I2C$sendEnd(); #line 79 #line 79 return result; #line 79 } #line 79 static inline # 229 "d:/tinyos-1.x/tos/sensorboards/micasb/I2CPotM.nc" result_t I2CPotM$I2C$readDone(char in_data) #line 229 { if (I2CPotM$state == I2CPotM$IDLE) { I2CPotM$data = 0; return FAIL; } if (I2CPotM$state == I2CPotM$READ_POT_READING_DATA) { I2CPotM$state = I2CPotM$READ_POT_STOP; I2CPotM$data = in_data; I2CPotM$I2C$sendEnd(); return FAIL; } return SUCCESS; } # 114 "d:/tinyos-1.x/tos/interfaces/I2C.nc" inline static result_t I2CM$I2C$readDone(char arg_0xab06370){ #line 114 unsigned char result; #line 114 #line 114 result = I2CPotM$I2C$readDone(arg_0xab06370); #line 114 #line 114 return result; #line 114 } #line 114 static inline # 121 "d:/tinyos-1.x/tos/platform/mica/I2CM.nc" char I2CM$i2c_read(void) #line 121 { uint8_t data = 0; uint8_t i = 0; #line 124 for (i = 0; i < 8; i++) { data = (data << 1) & 0xfe; if (I2CM$read_bit() == 1) { data |= 0x1; } } return data; } # 154 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_MAKE_I2C_BUS1_SDA_INPUT(void) #line 154 { #line 154 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x11 + 0x20) &= ~(1 << 1); } static inline # 99 "d:/tinyos-1.x/tos/platform/mica/I2CM.nc" void I2CM$MAKE_DATA_INPUT(void) #line 99 { #line 99 TOSH_MAKE_I2C_BUS1_SDA_INPUT(); } # 154 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline int TOSH_READ_I2C_BUS1_SDA_PIN(void) #line 154 { #line 154 return (* (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x10 + 0x20) & (1 << 1)) != 0; } static inline # 100 "d:/tinyos-1.x/tos/platform/mica/I2CM.nc" char I2CM$GET_DATA(void) #line 100 { #line 100 return TOSH_READ_I2C_BUS1_SDA_PIN(); } # 153 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_CLR_I2C_BUS1_SCL_PIN(void) #line 153 { #line 153 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x12 + 0x20) &= ~(1 << 0); } static inline # 92 "d:/tinyos-1.x/tos/platform/mica/I2CM.nc" void I2CM$CLEAR_CLOCK(void) #line 92 { #line 92 TOSH_CLR_I2C_BUS1_SCL_PIN(); } static inline #line 86 void I2CM$wait(void) #line 86 { __asm volatile ("nop");} static inline #line 102 void I2CM$pulse_clock(void) #line 102 { I2CM$wait(); I2CM$SET_CLOCK(); I2CM$wait(); I2CM$CLEAR_CLOCK(); } # 154 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_CLR_I2C_BUS1_SDA_PIN(void) #line 154 { #line 154 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x12 + 0x20) &= ~(1 << 1); } static inline # 97 "d:/tinyos-1.x/tos/platform/mica/I2CM.nc" void I2CM$CLEAR_DATA(void) #line 97 { #line 97 TOSH_CLR_I2C_BUS1_SDA_PIN(); } static inline #line 159 void I2CM$i2c_ack(void) #line 159 { I2CM$MAKE_DATA_OUTPUT(); I2CM$CLEAR_DATA(); I2CM$pulse_clock(); } static inline void I2CM$i2c_nack(void) #line 165 { I2CM$MAKE_DATA_OUTPUT(); I2CM$SET_DATA(); I2CM$pulse_clock(); } static inline #line 234 result_t I2CM$I2C$read(bool ack) #line 234 { if (I2CM$state != 0) { return FAIL; } #line 237 I2CM$state = I2CM$READ_DATA; if (ack) { I2CM$state |= 0x10; } #line 240 TOS_post(I2CM$I2C_task); return SUCCESS; } # 86 "d:/tinyos-1.x/tos/interfaces/I2C.nc" inline static result_t I2CPotM$I2C$read(bool arg_0xaacd410){ #line 86 unsigned char result; #line 86 #line 86 result = I2CM$I2C$read(arg_0xaacd410); #line 86 #line 86 return result; #line 86 } #line 86 inline static result_t I2CPotM$I2C$write(char arg_0xaacd878){ #line 93 unsigned char result; #line 93 #line 93 result = I2CM$I2C$write(arg_0xaacd878); #line 93 #line 93 return result; #line 93 } #line 93 static inline # 203 "d:/tinyos-1.x/tos/sensorboards/micasb/I2CPotM.nc" result_t I2CPotM$I2C$writeDone(bool result) #line 203 { if (result == FAIL) { I2CPotM$state = I2CPotM$WRITE_FAIL; I2CPotM$I2C$sendEnd(); return FAIL; } if (I2CPotM$state == I2CPotM$WRITING_TO_POT) { I2CPotM$state = I2CPotM$WRITE_POT_STOP; I2CPotM$I2C$sendEnd(); return 0; } else { #line 214 if (I2CPotM$state == I2CPotM$WRITE_COMMAND) { I2CPotM$state = I2CPotM$WRITE_COMMAND_2; I2CPotM$I2C$write(0 | ((I2CPotM$pot << 7) & 0x80)); } else { #line 217 if (I2CPotM$state == I2CPotM$WRITE_COMMAND_2) { I2CPotM$state = I2CPotM$WRITING_TO_POT; I2CPotM$I2C$write(I2CPotM$data); } else { #line 220 if (I2CPotM$state == I2CPotM$READ_COMMAND) { I2CPotM$state = I2CPotM$READ_POT_READING_DATA; I2CPotM$I2C$read(0 | ((I2CPotM$pot << 7) & 0x80)); } } } } #line 225 return SUCCESS; } # 123 "d:/tinyos-1.x/tos/interfaces/I2C.nc" inline static result_t I2CM$I2C$writeDone(bool arg_0xab067d8){ #line 123 unsigned char result; #line 123 #line 123 result = I2CPotM$I2C$writeDone(arg_0xab067d8); #line 123 #line 123 return result; #line 123 } #line 123 static inline # 133 "d:/tinyos-1.x/tos/platform/mica/I2CM.nc" char I2CM$i2c_write(char c) #line 133 { uint8_t i; #line 135 I2CM$MAKE_DATA_OUTPUT(); for (i = 0; i < 8; i++) { if (c & 0x80) { I2CM$SET_DATA(); } else #line 139 { I2CM$CLEAR_DATA(); } I2CM$pulse_clock(); c = c << 1; } i = I2CM$read_bit(); return i == 0; } static inline void I2CM$i2c_start(void) #line 149 { I2CM$SET_DATA(); I2CM$SET_CLOCK(); I2CM$MAKE_DATA_OUTPUT(); I2CM$wait(); I2CM$CLEAR_DATA(); I2CM$wait(); I2CM$CLEAR_CLOCK(); } static inline # 165 "d:/tinyos-1.x/tos/sensorboards/micasb/I2CPotM.nc" result_t I2CPotM$I2C$sendStartDone(void) #line 165 { char ret; if (I2CPotM$state == I2CPotM$WRITE_POT_START) { I2CPotM$state = I2CPotM$WRITE_COMMAND; ret = I2CPotM$I2C$write(0x58 | ((I2CPotM$addr << 1) & 0x06)); } else { #line 172 if (I2CPotM$state == I2CPotM$READ_POT_START) { I2CPotM$state = I2CPotM$READ_COMMAND; I2CPotM$I2C$write(0x59 | ((I2CPotM$addr << 1) & 0x06)); } } #line 176 return SUCCESS; } # 100 "d:/tinyos-1.x/tos/interfaces/I2C.nc" inline static result_t I2CM$I2C$sendStartDone(void){ #line 100 unsigned char result; #line 100 #line 100 result = I2CPotM$I2C$sendStartDone(); #line 100 #line 100 return result; #line 100 } #line 100 static inline # 171 "d:/tinyos-1.x/tos/platform/mica/I2CM.nc" void I2CM$i2c_end(void) #line 171 { I2CM$MAKE_DATA_OUTPUT(); I2CM$CLEAR_DATA(); I2CM$wait(); I2CM$SET_CLOCK(); I2CM$wait(); I2CM$SET_DATA(); } static inline # 146 "d:/tinyos-1.x/tos/sensorboards/micasb/MicM.nc" result_t MicM$I2CPot$writePotDone(bool result) #line 146 { return SUCCESS; } # 66 "d:/tinyos-1.x/tos/interfaces/I2CPot.nc" inline static result_t I2CPotM$I2CPot$writePotDone(bool arg_0xab0e550){ #line 66 unsigned char result; #line 66 #line 66 result = MicM$I2CPot$writePotDone(arg_0xab0e550); #line 66 #line 66 return result; #line 66 } #line 66 static inline # 142 "d:/tinyos-1.x/tos/sensorboards/micasb/MicM.nc" result_t MicM$I2CPot$readPotDone(char data, bool result) #line 142 { return SUCCESS; } # 65 "d:/tinyos-1.x/tos/interfaces/I2CPot.nc" inline static result_t I2CPotM$I2CPot$readPotDone(char arg_0xab0e010, bool arg_0xab0e150){ #line 65 unsigned char result; #line 65 #line 65 result = MicM$I2CPot$readPotDone(arg_0xab0e010, arg_0xab0e150); #line 65 #line 65 return result; #line 65 } #line 65 static inline # 180 "d:/tinyos-1.x/tos/sensorboards/micasb/I2CPotM.nc" result_t I2CPotM$I2C$sendEndDone(void) #line 180 { if (I2CPotM$state == I2CPotM$WRITE_POT_STOP) { I2CPotM$state = I2CPotM$IDLE; I2CPotM$I2CPot$writePotDone(SUCCESS); } else { #line 186 if (I2CPotM$state == I2CPotM$READ_POT_STOP) { I2CPotM$state = I2CPotM$IDLE; I2CPotM$I2CPot$readPotDone(I2CPotM$data, SUCCESS); } else { #line 190 if (I2CPotM$state == I2CPotM$READ_FAIL) { I2CPotM$state = I2CPotM$IDLE; I2CPotM$I2CPot$readPotDone(I2CPotM$data, FAIL); } else { #line 194 if (I2CPotM$state == I2CPotM$WRITE_FAIL) { I2CPotM$state = I2CPotM$IDLE; I2CPotM$I2CPot$writePotDone(FAIL); } } } } #line 199 return SUCCESS; } # 107 "d:/tinyos-1.x/tos/interfaces/I2C.nc" inline static result_t I2CM$I2C$sendEndDone(void){ #line 107 unsigned char result; #line 107 #line 107 result = I2CPotM$I2C$sendEndDone(); #line 107 #line 107 return result; #line 107 } #line 107 static inline # 87 "d:/tinyos-1.x/tos/interfaces/pqueue.h" pq_element pqueue_dequeue(pqueue_t *pq) #line 87 { return pqueue_dequeue_idx(pq, 0); } static inline # 111 "d:/tinyos-1.x/tos/lib/ServiceSchedulerM.nc" result_t ServiceSchedulerM$Services$default$start(uint8_t id) #line 111 { return SUCCESS; } # 59 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t ServiceSchedulerM$Services$start(uint8_t arg_0xabf1558){ #line 59 unsigned char result; #line 59 #line 59 switch (arg_0xabf1558) { #line 59 case kTINYDB_SERVICE_ID: #line 59 result = TupleRouterM$StdControl$start(); #line 59 break; #line 59 default: #line 59 result = ServiceSchedulerM$Services$default$start(arg_0xabf1558); #line 59 } #line 59 #line 59 return result; #line 59 } #line 59 # 70 "d:/tinyos-1.x/tos/interfaces/TimeUtil.nc" inline static tos_time_t ServiceSchedulerM$TimeUtil$addUint32(tos_time_t arg_0xa4fa690, uint32_t arg_0xa4fa7d8){ #line 70 struct __nesc_unnamed4317 result; #line 70 #line 70 result = TimeUtilC$TimeUtil$addUint32(arg_0xa4fa690, arg_0xa4fa7d8); #line 70 #line 70 return result; #line 70 } #line 70 static inline # 63 "d:/tinyos-1.x/tos/system/TimeUtilC.nc" tos_time_t TimeUtilC$TimeUtil$subtract(tos_time_t a, tos_time_t b) #line 63 { tos_time_t result; result.low32 = a.low32 - b.low32; result.high32 = a.high32 - b.high32; if (b.low32 > a.low32) { result.high32--; } return result; } # 97 "d:/tinyos-1.x/tos/interfaces/TimeUtil.nc" inline static tos_time_t LogicalTimeM$TimeUtil$subtract(tos_time_t arg_0xa4fbf30, tos_time_t arg_0xa5160a0){ #line 97 struct __nesc_unnamed4317 result; #line 97 #line 97 result = TimeUtilC$TimeUtil$subtract(arg_0xa4fbf30, arg_0xa5160a0); #line 97 #line 97 return result; #line 97 } #line 97 # 110 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_CLR_RED_LED_PIN(void) #line 110 { #line 110 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) &= ~(1 << 2); } #line 112 static __inline void TOSH_CLR_YELLOW_LED_PIN(void) #line 112 { #line 112 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) &= ~(1 << 0); } #line 111 static __inline void TOSH_CLR_GREEN_LED_PIN(void) #line 111 { #line 111 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x1B + 0x20) &= ~(1 << 1); } static inline # 187 "d:/tinyos-1.x/tos/system/LedsC.nc" result_t LedsC$Leds$set(uint8_t ledsNum) #line 187 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 188 { LedsC$ledsOn = ledsNum & 0x7; if (LedsC$ledsOn & LedsC$GREEN_BIT) { TOSH_CLR_GREEN_LED_PIN(); } else { #line 193 TOSH_SET_GREEN_LED_PIN(); } #line 194 if (LedsC$ledsOn & LedsC$YELLOW_BIT) { TOSH_CLR_YELLOW_LED_PIN(); } else { #line 197 TOSH_SET_YELLOW_LED_PIN(); } #line 198 if (LedsC$ledsOn & LedsC$RED_BIT) { TOSH_CLR_RED_LED_PIN(); } else { #line 201 TOSH_SET_RED_LED_PIN(); } } #line 203 __nesc_atomic_end(__nesc_atomic); } #line 203 return SUCCESS; } # 176 "d:/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t TupleRouterM$Leds$set(uint8_t arg_0xa352fa8){ #line 176 unsigned char result; #line 176 #line 176 result = LedsC$Leds$set(arg_0xa352fa8); #line 176 #line 176 return result; #line 176 } #line 176 # 61 "d:/tinyos-1.x/tos/interfaces/AbsoluteTimer.nc" inline static result_t ServiceSchedulerM$AbsoluteTimer$cancel(void){ #line 61 unsigned char result; #line 61 #line 61 result = LogicalTimeM$AbsoluteTimer$cancel(1); #line 61 #line 61 return result; #line 61 } #line 61 static inline # 154 "d:/tinyos-1.x/tos/lib/ServiceSchedulerM.nc" result_t ServiceSchedulerM$SchedulerClt$stop(void) #line 154 { int8_t svc_id; #line 156 if ((svc_id = pqueue_peek((pqueue_t *)&ServiceSchedulerM$event_q)) < 0) { return SUCCESS; } #line 158 return ServiceSchedulerM$AbsoluteTimer$cancel(); } static inline # 387 "d:/tinyos-1.x/tos/lib/TinyDB/DBBufferC.nc" result_t DBBufferC$StdControl$stop(void) #line 387 { return SUCCESS; } static inline # 71 "d:/tinyos-1.x/tos/lib/Commands/CommandAttrM.nc" result_t CommandAttrM$StdControl$stop(void) { return SUCCESS; } static inline # 72 "d:/tinyos-1.x/tos/lib/Commands/CommandPotM.nc" result_t CommandPotM$StdControl$stop(void) { return SUCCESS; } static inline # 80 "d:/tinyos-1.x/tos/lib/Commands/CommandLedsM.nc" result_t CommandLedsM$StdControl$stop(void) { return SUCCESS; } static inline # 78 "d:/tinyos-1.x/tos/lib/Commands/CommandSounderM.nc" result_t CommandSounderM$StdControl$stop(void) { return SUCCESS; } static inline # 72 "d:/tinyos-1.x/tos/lib/Commands/CommandResetM.nc" result_t CommandResetM$StdControl$stop(void) { return SUCCESS; } static inline # 110 "d:/tinyos-1.x/tos/sensorboards/micasb/MicM.nc" result_t MicM$StdControl$stop(void) #line 110 { MicM$MicInterrupt$disable(); TOSH_MAKE_MIC_CTL_OUTPUT(); TOSH_CLR_MIC_CTL_PIN(); return SUCCESS; } # 67 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t AttrMicM$MicControl$stop(void){ #line 67 unsigned char result; #line 67 #line 67 result = MicM$StdControl$stop(); #line 67 #line 67 return result; #line 67 } #line 67 # 99 "d:/tinyos-1.x/tos/interfaces/Timer.nc" inline static result_t AttrMicM$ToneDetectTimer$stop(void){ #line 99 unsigned char result; #line 99 #line 99 result = LogicalTimeM$Timer$stop(4); #line 99 #line 99 return result; #line 99 } #line 99 static inline # 171 "d:/tinyos-1.x/tos/lib/Attributes/AttrMicM.nc" void AttrMicM$toneDetectStop(void) { AttrMicM$toneDetectRunning = FALSE; AttrMicM$ToneDetectTimer$stop(); } # 99 "d:/tinyos-1.x/tos/interfaces/Timer.nc" inline static result_t AttrMicM$NoiseSampleTimer$stop(void){ #line 99 unsigned char result; #line 99 #line 99 result = LogicalTimeM$Timer$stop(3); #line 99 #line 99 return result; #line 99 } #line 99 static inline # 123 "d:/tinyos-1.x/tos/lib/Attributes/AttrMicM.nc" void AttrMicM$stopNoiseSample(void) { AttrMicM$noiseSampleRunning = FALSE; AttrMicM$NoiseSampleTimer$stop(); } static inline #line 108 result_t AttrMicM$StdControl$stop(void) { AttrMicM$stopNoiseSample(); AttrMicM$toneDetectStop(); return AttrMicM$MicControl$stop(); } # 147 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_CLR_PW4_PIN(void) #line 147 { #line 147 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x15 + 0x20) &= ~(1 << 4); } # 99 "d:/tinyos-1.x/tos/sensorboards/micasb/sensorboard.h" static __inline void TOSH_CLR_ACCEL_CTL_PIN(void) #line 99 { #line 99 TOSH_CLR_PW4_PIN(); } static inline # 89 "d:/tinyos-1.x/tos/sensorboards/micasb/AccelM.nc" result_t AccelM$StdControl$stop(void) #line 89 { TOSH_CLR_ACCEL_CTL_PIN(); return SUCCESS; } # 67 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t AttrAccelM$AccelControl$stop(void){ #line 67 unsigned char result; #line 67 #line 67 result = AccelM$StdControl$stop(); #line 67 #line 67 return result; #line 67 } #line 67 static inline # 78 "d:/tinyos-1.x/tos/lib/Attributes/AttrAccelM.nc" result_t AttrAccelM$StdControl$stop(void) { return AttrAccelM$AccelControl$stop(); } # 133 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_MAKE_INT2_INPUT(void) #line 133 { #line 133 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x02 + 0x20) &= ~(1 << 6); } # 95 "d:/tinyos-1.x/tos/sensorboards/micasb/sensorboard.h" static __inline void TOSH_MAKE_TEMP_CTL_INPUT(void) #line 95 { #line 95 TOSH_MAKE_INT2_INPUT(); } # 133 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_CLR_INT2_PIN(void) #line 133 { #line 133 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x03 + 0x20) &= ~(1 << 6); } # 95 "d:/tinyos-1.x/tos/sensorboards/micasb/sensorboard.h" static __inline void TOSH_CLR_TEMP_CTL_PIN(void) #line 95 { #line 95 TOSH_CLR_INT2_PIN(); } static inline # 143 "d:/tinyos-1.x/tos/sensorboards/micasb/PhotoTempM.nc" result_t PhotoTempM$TempStdControl$stop(void) #line 143 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 144 { TOSH_CLR_TEMP_CTL_PIN(); TOSH_MAKE_TEMP_CTL_INPUT(); } #line 147 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 67 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t AttrTempM$SubControl$stop(void){ #line 67 unsigned char result; #line 67 #line 67 result = PhotoTempM$TempStdControl$stop(); #line 67 #line 67 return result; #line 67 } #line 67 static inline # 74 "d:/tinyos-1.x/tos/lib/Attributes/AttrTempM.nc" result_t AttrTempM$StdControl$stop(void) { AttrTempM$SubControl$stop(); return SUCCESS; } # 132 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_MAKE_INT1_INPUT(void) #line 132 { #line 132 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x02 + 0x20) &= ~(1 << 5); } # 94 "d:/tinyos-1.x/tos/sensorboards/micasb/sensorboard.h" static __inline void TOSH_MAKE_PHOTO_CTL_INPUT(void) #line 94 { #line 94 TOSH_MAKE_INT1_INPUT(); } # 132 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_CLR_INT1_PIN(void) #line 132 { #line 132 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x03 + 0x20) &= ~(1 << 5); } # 94 "d:/tinyos-1.x/tos/sensorboards/micasb/sensorboard.h" static __inline void TOSH_CLR_PHOTO_CTL_PIN(void) #line 94 { #line 94 TOSH_CLR_INT1_PIN(); } static inline # 118 "d:/tinyos-1.x/tos/sensorboards/micasb/PhotoTempM.nc" result_t PhotoTempM$PhotoStdControl$stop(void) #line 118 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 119 { TOSH_CLR_PHOTO_CTL_PIN(); TOSH_MAKE_PHOTO_CTL_INPUT(); } #line 122 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 67 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t AttrPhotoM$SubControl$stop(void){ #line 67 unsigned char result; #line 67 #line 67 result = PhotoTempM$PhotoStdControl$stop(); #line 67 #line 67 return result; #line 67 } #line 67 static inline # 75 "d:/tinyos-1.x/tos/lib/Attributes/AttrPhotoM.nc" result_t AttrPhotoM$StdControl$stop(void) #line 75 { AttrPhotoM$SubControl$stop(); return SUCCESS; } static inline # 72 "d:/tinyos-1.x/tos/lib/Attributes/AttrVoltageM.nc" result_t AttrVoltageM$StdControl$stop(void) { return SUCCESS; } static inline # 84 "d:/tinyos-1.x/tos/system/VoltageM.nc" result_t VoltageM$StdControl$stop(void) #line 84 { return SUCCESS; } static inline # 106 "d:/tinyos-1.x/tos/lib/TinyDB/TinyDBAttrM.nc" result_t TinyDBAttrM$StdControl$stop(void) { return SUCCESS; } static inline # 71 "d:/tinyos-1.x/tos/lib/Attributes/AttrTimeM.nc" result_t AttrTimeM$StdControl$stop(void) { return SUCCESS; } static inline # 71 "d:/tinyos-1.x/tos/lib/Attributes/AttrPotM.nc" result_t AttrPotM$StdControl$stop(void) { return SUCCESS; } static inline # 72 "d:/tinyos-1.x/tos/lib/Attributes/AttrGlobalM.nc" result_t AttrGlobalM$StdControl$stop(void) { return SUCCESS; } # 67 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t TupleRouterM$ChildControl$stop(void){ #line 67 unsigned char result; #line 67 #line 67 result = AttrGlobalM$StdControl$stop(); #line 67 result = rcombine(result, AttrPotM$StdControl$stop()); #line 67 result = rcombine(result, AttrTimeM$StdControl$stop()); #line 67 result = rcombine(result, TinyDBAttrM$StdControl$stop()); #line 67 result = rcombine(result, VoltageM$StdControl$stop()); #line 67 result = rcombine(result, AttrVoltageM$StdControl$stop()); #line 67 result = rcombine(result, PhotoTempM$PhotoStdControl$stop()); #line 67 result = rcombine(result, AttrPhotoM$StdControl$stop()); #line 67 result = rcombine(result, PhotoTempM$TempStdControl$stop()); #line 67 result = rcombine(result, AttrTempM$StdControl$stop()); #line 67 result = rcombine(result, AttrAccelM$StdControl$stop()); #line 67 result = rcombine(result, AttrMicM$StdControl$stop()); #line 67 result = rcombine(result, CommandResetM$StdControl$stop()); #line 67 result = rcombine(result, CommandSounderM$StdControl$stop()); #line 67 result = rcombine(result, CommandLedsM$StdControl$stop()); #line 67 result = rcombine(result, CommandPotM$StdControl$stop()); #line 67 result = rcombine(result, CommandAttrM$StdControl$stop()); #line 67 result = rcombine(result, DBBufferC$StdControl$stop()); #line 67 result = rcombine(result, ServiceSchedulerM$SchedulerClt$stop()); #line 67 #line 67 return result; #line 67 } #line 67 static inline # 121 "d:/tinyos-1.x/tos/system/tos.h" result_t rcombine3(result_t r1, result_t r2, result_t r3) { return rcombine(r1, rcombine(r2, r3)); } # 29 "d:/tinyos-1.x/tos/interfaces/PowerManagement.nc" inline static uint8_t AMStandard$PowerManagement$adjustPower(void){ #line 29 unsigned char result; #line 29 #line 29 result = HPLPowerManagementM$PowerManagement$adjustPower(); #line 29 #line 29 return result; #line 29 } #line 29 # 99 "d:/tinyos-1.x/tos/interfaces/Timer.nc" inline static result_t AMStandard$ActivityTimer$stop(void){ #line 99 unsigned char result; #line 99 #line 99 result = LogicalTimeM$Timer$stop(0); #line 99 #line 99 return result; #line 99 } #line 99 # 67 "d:/tinyos-1.x/tos/platform/mica2/SpiByteFifo.nc" inline static result_t CC1000RadioIntM$SpiByteFifo$disableIntr(void){ #line 67 unsigned char result; #line 67 #line 67 result = HPLSpiM$SpiByteFifo$disableIntr(); #line 67 #line 67 return result; #line 67 } #line 67 static inline # 243 "d:/tinyos-1.x/tos/platform/mica2/CC1000ControlM.nc" result_t CC1000ControlM$StdControl$stop(void) #line 243 { CC1000ControlM$HPLChipcon$write(0x0B, 0x00); CC1000ControlM$HPLChipcon$write(0x00, ((((( 1 << 5) | (1 << 4)) | ( 1 << 3)) | (1 << 2)) | (1 << 1)) | ( 1 << 0)); return SUCCESS; } # 67 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t CC1000RadioIntM$CC1000StdControl$stop(void){ #line 67 unsigned char result; #line 67 #line 67 result = CC1000ControlM$StdControl$stop(); #line 67 #line 67 return result; #line 67 } #line 67 # 99 "d:/tinyos-1.x/tos/interfaces/Timer.nc" inline static result_t CC1000RadioIntM$WakeupTimer$stop(void){ #line 99 unsigned char result; #line 99 #line 99 result = LogicalTimeM$Timer$stop(1); #line 99 #line 99 return result; #line 99 } #line 99 static inline # 383 "d:/tinyos-1.x/tos/platform/mica2/CC1000RadioIntM.nc" result_t CC1000RadioIntM$StdControl$stop(void) #line 383 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 384 CC1000RadioIntM$RadioState = CC1000RadioIntM$DISABLED_STATE; #line 384 __nesc_atomic_end(__nesc_atomic); } CC1000RadioIntM$WakeupTimer$stop(); CC1000RadioIntM$CC1000StdControl$stop(); CC1000RadioIntM$SpiByteFifo$disableIntr(); return SUCCESS; } # 67 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t AMStandard$RadioControl$stop(void){ #line 67 unsigned char result; #line 67 #line 67 result = CC1000RadioIntM$StdControl$stop(); #line 67 #line 67 return result; #line 67 } #line 67 static inline # 103 "d:/tinyos-1.x/tos/platform/mica2/HPLUART0M.nc" result_t HPLUART0M$UART$stop(void) #line 103 { * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0B + 0x20) = 0x00; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0A + 0x20) = 0x00; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)0x95 = 0x00; return SUCCESS; } # 97 "d:/tinyos-1.x/tos/interfaces/HPLUART.nc" inline static result_t UARTM$HPLUART$stop(void){ #line 97 unsigned char result; #line 97 #line 97 result = HPLUART0M$UART$stop(); #line 97 #line 97 return result; #line 97 } #line 97 static inline # 95 "d:/tinyos-1.x/tos/system/UARTM.nc" result_t UARTM$Control$stop(void) #line 95 { return UARTM$HPLUART$stop(); } # 67 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t NoCRCPacket$ByteControl$stop(void){ #line 67 unsigned char result; #line 67 #line 67 result = UARTM$Control$stop(); #line 67 #line 67 return result; #line 67 } #line 67 static inline # 139 "d:/tinyos-1.x/tos/system/NoCRCPacket.nc" result_t NoCRCPacket$Control$stop(void) #line 139 { return NoCRCPacket$ByteControl$stop(); } # 67 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t AMStandard$UARTControl$stop(void){ #line 67 unsigned char result; #line 67 #line 67 result = NoCRCPacket$Control$stop(); #line 67 #line 67 return result; #line 67 } #line 67 static inline # 143 "d:/tinyos-1.x/tos/system/AMStandard.nc" bool AMStandard$Control$stop(void) #line 143 { result_t ok1 = AMStandard$UARTControl$stop(); result_t ok2 = AMStandard$RadioControl$stop(); result_t ok3 = AMStandard$ActivityTimer$stop(); AMStandard$PowerManagement$adjustPower(); return rcombine3(ok1, ok2, ok3); } # 67 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t NetworkM$SubControl$stop(void){ #line 67 unsigned char result; #line 67 #line 67 result = AMStandard$Control$stop(); #line 67 #line 67 return result; #line 67 } #line 67 static inline # 343 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkM.nc" result_t NetworkM$StdControl$stop(void) #line 343 { return NetworkM$SubControl$stop(); } # 67 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t TupleRouterM$NetControl$stop(void){ #line 67 unsigned char result; #line 67 #line 67 result = NetworkM$StdControl$stop(); #line 67 #line 67 return result; #line 67 } #line 67 static inline # 49 "d:/tinyos-1.x/tos/platform/mica2/HPLPowerManagementM.nc" uint8_t HPLPowerManagementM$getPowerLevel(void) #line 49 { uint8_t diff; #line 51 if (* (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x37 + 0x20) & ~((1 << 1) | (1 << 0))) { return HPLPowerManagementM$IDLE; } else { #line 54 if (* (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0D + 0x20) & (1 << 7)) { return HPLPowerManagementM$IDLE; } else { if (* (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x06 + 0x20) & (1 << 7)) { return HPLPowerManagementM$ADC_NR; } else { #line 60 if (* (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x37 + 0x20) & ((1 << 1) | (1 << 0))) { diff = * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x31 + 0x20) - * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x32 + 0x20); if (diff < 16) { return HPLPowerManagementM$EXT_STANDBY; } #line 64 return HPLPowerManagementM$POWER_SAVE; } else #line 65 { return HPLPowerManagementM$POWER_DOWN; } } } } } static inline #line 70 void HPLPowerManagementM$doAdjustment(void) #line 70 { uint8_t foo; #line 71 uint8_t mcu; #line 72 foo = HPLPowerManagementM$getPowerLevel(); mcu = * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x35 + 0x20); mcu &= 0xe3; if (foo == HPLPowerManagementM$EXT_STANDBY || foo == HPLPowerManagementM$POWER_SAVE) { mcu |= HPLPowerManagementM$IDLE; while ((* (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x30 + 0x20) & 0x7) != 0) { __asm volatile ("nop");} mcu &= 0xe3; } mcu |= foo; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x35 + 0x20) = mcu; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x35 + 0x20) |= 1 << 5; } static inline # 414 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$UNSET_DELIVERING_TUPLES(void) #line 414 { #line 414 TupleRouterM$mPendingMask &= TupleRouterM$DELIVERING_BIT ^ 0xFFFF; } static inline #line 437 bool TupleRouterM$IS_SNOOZING(void) #line 437 { #line 437 return (TupleRouterM$mPendingMask & TupleRouterM$SNOOZING_BIT) != 0; } # 70 "d:/tinyos-1.x/tos/interfaces/TimeUtil.nc" inline static tos_time_t TupleRouterM$TimeUtil$addUint32(tos_time_t arg_0xa4fa690, uint32_t arg_0xa4fa7d8){ #line 70 struct __nesc_unnamed4317 result; #line 70 #line 70 result = TimeUtilC$TimeUtil$addUint32(arg_0xa4fa690, arg_0xa4fa7d8); #line 70 #line 70 return result; #line 70 } #line 70 static inline # 439 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$SET_SNOOZING(void) #line 439 { #line 439 TupleRouterM$mPendingMask |= TupleRouterM$SNOOZING_BIT; } static inline # 115 "d:/tinyos-1.x/tos/lib/ServiceSchedulerM.nc" result_t ServiceSchedulerM$Services$default$stop(uint8_t id) #line 115 { return SUCCESS; } # 67 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t ServiceSchedulerM$Services$stop(uint8_t arg_0xabf1558){ #line 67 unsigned char result; #line 67 #line 67 switch (arg_0xabf1558) { #line 67 case kTINYDB_SERVICE_ID: #line 67 result = TupleRouterM$StdControl$stop(); #line 67 break; #line 67 default: #line 67 result = ServiceSchedulerM$Services$default$stop(arg_0xabf1558); #line 67 } #line 67 #line 67 return result; #line 67 } #line 67 static inline # 161 "d:/tinyos-1.x/tos/lib/ServiceSchedulerM.nc" result_t ServiceSchedulerM$ServiceScheduler$reschedule(uint8_t svc_id, tos_service_schedule sched) { #line 178 pqueue_remove((pqueue_t *)&ServiceSchedulerM$event_q, svc_id); if (ServiceSchedulerM$sched_info[svc_id].flags & STOP) { ServiceSchedulerM$Services$stop(svc_id); } ServiceSchedulerM$sched_info[svc_id] = sched; ServiceSchedulerM$sched_info[svc_id].flags = ENABLED | START; if (pqueue_enqueue((pqueue_t *)&ServiceSchedulerM$event_q, svc_id) == FAIL) { return FAIL; } #line 188 if (pqueue_peek((pqueue_t *)&ServiceSchedulerM$event_q) == svc_id) { ServiceSchedulerM$AbsoluteTimer$cancel(); return ServiceSchedulerM$AbsoluteTimer$set(sched.start_time); } return SUCCESS; } # 39 "d:/tinyos-1.x/tos/interfaces/ServiceScheduler.nc" inline static result_t TupleRouterM$ServiceScheduler$reschedule(uint8_t arg_0xa620f28, tos_service_schedule arg_0xa621098){ #line 39 unsigned char result; #line 39 #line 39 result = ServiceSchedulerM$ServiceScheduler$reschedule(arg_0xa620f28, arg_0xa621098); #line 39 #line 39 return result; #line 39 } #line 39 # 55 "d:/tinyos-1.x/tos/interfaces/AbsoluteTimer.nc" inline static result_t TupleRouterM$AbsoluteTimer$set(tos_time_t arg_0xa4fed40){ #line 55 unsigned char result; #line 55 #line 55 result = LogicalTimeM$AbsoluteTimer$set(0, arg_0xa4fed40); #line 55 #line 55 return result; #line 55 } #line 55 static inline # 2306 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$decrementQueryCounter(void) #line 2306 { TupleRouterM$mClockCount++; } static inline #line 421 bool TupleRouterM$IS_AGGREGATING_RESULT(void) #line 421 { #line 421 return (TupleRouterM$mPendingMask & TupleRouterM$AGGREGATING_BIT) != 0; } static inline #line 413 bool TupleRouterM$IS_DELIVERING_TUPLES(void) #line 413 { #line 413 return (TupleRouterM$mPendingMask & TupleRouterM$DELIVERING_BIT) != 0; } static inline #line 409 bool TupleRouterM$IS_ROUTING_TUPLES(void) #line 409 { #line 409 return (TupleRouterM$mPendingMask & TupleRouterM$ROUTING_BIT) != 0; } static inline #line 406 void TupleRouterM$UNSET_STARTING_ATTRIBUTE(void) #line 406 { #line 406 TupleRouterM$mPendingMask &= TupleRouterM$ATTR_STARTING_BIT ^ 0xFFFF; } static inline #line 405 bool TupleRouterM$IS_STARTING_ATTRIBUTE(void) #line 405 { #line 405 return (TupleRouterM$mPendingMask & TupleRouterM$ATTR_STARTING_BIT) != 0; } static inline #line 402 void TupleRouterM$UNSET_FETCHING_ATTRIBUTE(void) #line 402 { #line 402 TupleRouterM$mPendingMask &= TupleRouterM$FETCHING_BIT ^ 0xFFFF; } static inline #line 401 bool TupleRouterM$IS_FETCHING_ATTRIBUTE(void) #line 401 { #line 401 return (TupleRouterM$mPendingMask & TupleRouterM$FETCHING_BIT) != 0; } static inline #line 418 void TupleRouterM$UNSET_SENDING_MESSAGE(void) #line 418 { #line 418 TupleRouterM$mPendingMask &= TupleRouterM$SENDING_BIT ^ 0xFFFF; } # 67 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkMonitor.nc" inline static void TupleRouterM$NetworkMonitor$updateContention(bool arg_0xa326c90, int arg_0xa326dc8){ #line 67 NetworkM$NetworkMonitor$updateContention(arg_0xa326c90, arg_0xa326dc8); #line 67 } #line 67 static inline # 417 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" bool TupleRouterM$IS_SENDING_MESSAGE(void) #line 417 { #line 417 return (TupleRouterM$mPendingMask & TupleRouterM$SENDING_BIT) != 0; } # 61 "d:/tinyos-1.x/tos/interfaces/AbsoluteTimer.nc" inline static result_t TupleRouterM$AbsoluteTimer$cancel(void){ #line 61 unsigned char result; #line 61 #line 61 result = LogicalTimeM$AbsoluteTimer$cancel(0); #line 61 #line 61 return result; #line 61 } #line 61 static inline # 2005 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$mainTask(void) #line 2005 { { } #line 2006 ; if (TupleRouterM$mStopped) { TupleRouterM$AbsoluteTimer$cancel(); return; } if (TupleRouterM$IS_SENDING_MESSAGE()) { TupleRouterM$NetworkMonitor$updateContention(TRUE, SEND_BUSY_FAILURE); TupleRouterM$mNumBlocked++; if (TupleRouterM$mNumBlocked > 32) { TupleRouterM$mNumBlocked = 0; TupleRouterM$UNSET_SENDING_MESSAGE(); } else #line 2023 { return; } } TupleRouterM$mNumBlocked = 0; if (TupleRouterM$mSendQueryNextClock) { TupleRouterM$mSendQueryNextClock = FALSE; TOS_post(TupleRouterM$sendQuery); } if (TupleRouterM$IS_FETCHING_ATTRIBUTE() || TupleRouterM$IS_STARTING_ATTRIBUTE()) { TupleRouterM$mFetchTries++; if (TupleRouterM$mFetchTries < TupleRouterM$UDF_WAIT_LOOP) { return; } else { if (TupleRouterM$IS_FETCHING_ATTRIBUTE()) { TupleRouterM$UNSET_FETCHING_ATTRIBUTE(); } #line 2050 if (TupleRouterM$IS_STARTING_ATTRIBUTE()) { TupleRouterM$UNSET_STARTING_ATTRIBUTE(); } } } else { #line 2053 if (TupleRouterM$IS_ROUTING_TUPLES()) { return; } else { #line 2056 if (TupleRouterM$IS_DELIVERING_TUPLES()) { return; } else { #line 2059 if (TupleRouterM$IS_AGGREGATING_RESULT()) { return; } } } } TupleRouterM$mFetchTries = 0; TupleRouterM$mCurRouteQuery = (void *)0; TupleRouterM$mCurExpr = -1; { } #line 2072 ; #line 2100 TOS_post(TupleRouterM$deliverTuplesTask); } static inline # 104 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQuery.nc" uint8_t ParsedQuery$ParsedQueryIntf$getFieldId(ParsedQueryPtr q, uint8_t n) #line 104 { return q->queryToSchemaFieldMap[n]; } # 87 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQueryIntf.nc" inline static uint8_t TupleRouterM$ParsedQueryIntf$getFieldId(ParsedQueryPtr arg_0xa5f68c8, uint8_t arg_0xa5f6a08){ #line 87 unsigned char result; #line 87 #line 87 result = ParsedQuery$ParsedQueryIntf$getFieldId(arg_0xa5f68c8, arg_0xa5f6a08); #line 87 #line 87 return result; #line 87 } #line 87 static inline # 87 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQuery.nc" bool ParsedQuery$ParsedQueryIntf$queryFieldIsNull(uint8_t field) #line 87 { return (field & NULL_QUERY_FIELD) > 0; } # 73 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQueryIntf.nc" inline static bool TupleRouterM$ParsedQueryIntf$queryFieldIsNull(uint8_t arg_0xa601520){ #line 73 unsigned char result; #line 73 #line 73 result = ParsedQuery$ParsedQueryIntf$queryFieldIsNull(arg_0xa601520); #line 73 #line 73 return result; #line 73 } #line 73 # 72 "d:/tinyos-1.x/tos/interfaces/AttrUse.nc" inline static AttrDescPtr TupleRouterM$AttrUse$getAttrById(uint8_t arg_0xa5e4d58){ #line 72 struct __nesc_unnamed4260 *result; #line 72 #line 72 result = Attr$AttrUse$getAttrById(arg_0xa5e4d58); #line 72 #line 72 return result; #line 72 } #line 72 # 133 "d:/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t TupleRouterM$Leds$greenToggle(void){ #line 133 unsigned char result; #line 133 #line 133 result = LedsC$Leds$greenToggle(); #line 133 #line 133 return result; #line 133 } #line 133 # 142 "d:/tinyos-1.x/tos/lib/TinyDB/Network.nc" inline static TinyDBError TupleRouterM$Network$sendQueryMessage(TOS_MsgPtr arg_0xa3207b8){ #line 142 enum __nesc_unnamed4265 result; #line 142 #line 142 result = NetworkM$Network$sendQueryMessage(arg_0xa3207b8); #line 142 #line 142 return result; #line 142 } #line 142 static inline # 2778 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" ParsedQueryPtr TupleRouterM$QueryProcessor$getQueryCmd(uint8_t qid) #line 2778 { ParsedQueryPtr pq; #line 2780 if (TupleRouterM$getQuery(qid, &pq)) { return pq; } else { #line 2783 return (void *)0; } } static inline # 347 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkM.nc" QueryResultPtr NetworkM$Network$getDataPayLoad(TOS_MsgPtr msg) { return (QueryResultPtr )&((NetworkMessage *)msg->data)->data[0]; } # 86 "d:/tinyos-1.x/tos/lib/TinyDB/Network.nc" inline static QueryResultPtr TupleRouterM$Network$getDataPayLoad(TOS_MsgPtr arg_0xa317de8){ #line 86 struct QueryResult *result; #line 86 #line 86 result = NetworkM$Network$getDataPayLoad(arg_0xa317de8); #line 86 #line 86 return result; #line 86 } #line 86 static inline # 243 "d:/tinyos-1.x/tos/lib/TinyDB/QueryResult.nc" short QueryResult$QueryResultIntf$queryIdFromMsg(QueryResultPtr qr) #line 243 { return qr->qid; } # 149 "d:/tinyos-1.x/tos/lib/TinyDB/QueryResultIntf.nc" inline static short TupleRouterM$QueryResultIntf$queryIdFromMsg(QueryResultPtr arg_0xa6289b8){ #line 149 short result; #line 149 #line 149 result = QueryResult$QueryResultIntf$queryIdFromMsg(arg_0xa6289b8); #line 149 #line 149 return result; #line 149 } #line 149 static inline # 2815 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" short TupleRouterM$QueryProcessor$msgToQueryRoot(TOS_MsgPtr msg) #line 2815 { uint8_t msgType = msg->type; uint8_t qid; short root; ParsedQueryPtr pq; if (msgType != kDATA_MESSAGE_ID && msgType != kQUERY_MESSAGE_ID && msgType != kQUERY_REQUEST_MESSAGE_ID) { return -1; } qid = TupleRouterM$QueryResultIntf$queryIdFromMsg(TupleRouterM$Network$getDataPayLoad(msg)); pq = TupleRouterM$QueryProcessor$getQueryCmd(qid); if (pq == (void *)0) { root = -1; } else { root = pq->queryRoot; } return root; } # 94 "d:/tinyos-1.x/tos/lib/TinyDB/QueryProcessor.nc" inline static short NetworkM$QueryProcessor$msgToQueryRoot(TOS_Msg *arg_0xa30fd10){ #line 94 short result; #line 94 #line 94 result = TupleRouterM$QueryProcessor$msgToQueryRoot(arg_0xa30fd10); #line 94 #line 94 return result; #line 94 } #line 94 static inline # 300 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkM.nc" uint8_t NetworkM$getRootId(short rootNode) #line 300 { int i; int firstUnknown = -1; for (i = 0; i < NetworkM$NUM_ROOTS; i++) { if (NetworkM$mRoots[i] != NetworkM$UNKNOWN_ROOT) { if (NetworkM$mRoots[i] == rootNode) { return i; } } else { #line 309 if (firstUnknown == -1) { firstUnknown = i; } } } #line 313 if (firstUnknown != -1) { NetworkM$mRoots[firstUnknown] = rootNode; return firstUnknown; } return -1; } static inline #line 286 void NetworkM$setRoot(uint8_t rootId) #line 286 { } # 90 "d:/tinyos-1.x/tos/interfaces/Timer.nc" inline static result_t CC1000RadioIntM$WakeupTimer$start(char arg_0xa3f1240, uint32_t arg_0xa3f1390){ #line 90 unsigned char result; #line 90 #line 90 result = LogicalTimeM$Timer$start(1, arg_0xa3f1240, arg_0xa3f1390); #line 90 #line 90 return result; #line 90 } #line 90 # 29 "d:/tinyos-1.x/tos/interfaces/PowerManagement.nc" inline static uint8_t HPLSpiM$PowerManagement$adjustPower(void){ #line 29 unsigned char result; #line 29 #line 29 result = HPLPowerManagementM$PowerManagement$adjustPower(); #line 29 #line 29 return result; #line 29 } #line 29 static inline # 98 "d:/tinyos-1.x/tos/platform/mica2/HPLSpiM.nc" result_t HPLSpiM$SpiByteFifo$enableIntr(void) #line 98 { * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0D + 0x20) = 0xC0; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x17 + 0x20) &= ~(1 << 0); HPLSpiM$PowerManagement$adjustPower(); return SUCCESS; } # 66 "d:/tinyos-1.x/tos/platform/mica2/SpiByteFifo.nc" inline static result_t CC1000RadioIntM$SpiByteFifo$enableIntr(void){ #line 66 unsigned char result; #line 66 #line 66 result = HPLSpiM$SpiByteFifo$enableIntr(); #line 66 #line 66 return result; #line 66 } #line 66 static inline # 133 "d:/tinyos-1.x/tos/platform/mica2/HPLSpiM.nc" result_t HPLSpiM$SpiByteFifo$rxMode(void) #line 133 { TOSH_MAKE_MISO_INPUT(); TOSH_MAKE_MOSI_INPUT(); return SUCCESS; } # 70 "d:/tinyos-1.x/tos/platform/mica2/SpiByteFifo.nc" inline static result_t CC1000RadioIntM$SpiByteFifo$rxMode(void){ #line 70 unsigned char result; #line 70 #line 70 result = HPLSpiM$SpiByteFifo$rxMode(); #line 70 #line 70 return result; #line 70 } #line 70 # 101 "d:/tinyos-1.x/tos/platform/mica2/CC1000Control.nc" inline static result_t CC1000RadioIntM$CC1000Control$RxMode(void){ #line 101 unsigned char result; #line 101 #line 101 result = CC1000ControlM$CC1000Control$RxMode(); #line 101 #line 101 return result; #line 101 } #line 101 static inline # 231 "d:/tinyos-1.x/tos/platform/mica2/CC1000ControlM.nc" result_t CC1000ControlM$CC1000Control$BIASOn(void) #line 231 { CC1000ControlM$HPLChipcon$write(0x00, ((( 1 << 5) | (1 << 4)) | ( 1 << 3)) | ( 1 << 0)); TOSH_uwait(200); return SUCCESS; } # 122 "d:/tinyos-1.x/tos/platform/mica2/CC1000Control.nc" inline static result_t CC1000RadioIntM$CC1000Control$BIASOn(void){ #line 122 unsigned char result; #line 122 #line 122 result = CC1000ControlM$CC1000Control$BIASOn(); #line 122 #line 122 return result; #line 122 } #line 122 static inline # 254 "d:/tinyos-1.x/tos/platform/mica2/CC1000ControlM.nc" result_t CC1000ControlM$StdControl$start(void) #line 254 { CC1000ControlM$HPLChipcon$write(0x00, (((( 1 << 5) | (1 << 4)) | ( 1 << 3)) | (1 << 1)) | ( 1 << 0)); TOSH_uwait(2000); return SUCCESS; } # 59 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t CC1000RadioIntM$CC1000StdControl$start(void){ #line 59 unsigned char result; #line 59 #line 59 result = CC1000ControlM$StdControl$start(); #line 59 #line 59 return result; #line 59 } #line 59 # 86 "d:/tinyos-1.x/tos/interfaces/Random.nc" inline static uint16_t CC1000RadioIntM$Random$rand(void){ #line 86 unsigned int result; #line 86 #line 86 result = RandomLFSR$Random$rand(); #line 86 #line 86 return result; #line 86 } #line 86 static inline # 422 "d:/tinyos-1.x/tos/platform/mica2/CC1000RadioIntM.nc" result_t CC1000RadioIntM$Send$send(TOS_MsgPtr pMsg) #line 422 { result_t Result = SUCCESS; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 425 { if (CC1000RadioIntM$bTxBusy) { Result = FAIL; } else { CC1000RadioIntM$bTxBusy = TRUE; CC1000RadioIntM$txbufptr = pMsg; CC1000RadioIntM$txlength = pMsg->length + (MSG_DATA_SIZE - DATA_LENGTH - 2); CC1000RadioIntM$sMacDelay = MSG_DATA_SIZE + (CC1000RadioIntM$Random$rand() & 0x7F); CC1000RadioIntM$bTxPending = TRUE; } } #line 437 __nesc_atomic_end(__nesc_atomic); } if (Result) { if (CC1000RadioIntM$RadioState == CC1000RadioIntM$POWER_DOWN_STATE) { CC1000RadioIntM$WakeupTimer$stop(); CC1000RadioIntM$CC1000StdControl$start(); CC1000RadioIntM$CC1000Control$BIASOn(); CC1000RadioIntM$CC1000Control$RxMode(); CC1000RadioIntM$SpiByteFifo$rxMode(); CC1000RadioIntM$SpiByteFifo$enableIntr(); CC1000RadioIntM$WakeupTimer$start(TIMER_ONE_SHOT, 16 * 2); CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE; } } return Result; } # 85 "d:/tinyos-1.x/tos/interfaces/BareSendMsg.nc" inline static result_t AMStandard$RadioSend$send(TOS_MsgPtr arg_0xa3e0d40){ #line 85 unsigned char result; #line 85 #line 85 result = CC1000RadioIntM$Send$send(arg_0xa3e0d40); #line 85 #line 85 return result; #line 85 } #line 85 # 82 "d:/tinyos-1.x/tos/interfaces/ByteComm.nc" inline static result_t NoCRCPacket$ByteComm$txByte(uint8_t arg_0xa58dab0){ #line 82 unsigned char result; #line 82 #line 82 result = UARTM$ByteComm$txByte(arg_0xa58dab0); #line 82 #line 82 return result; #line 82 } #line 82 static inline # 144 "d:/tinyos-1.x/tos/system/NoCRCPacket.nc" result_t NoCRCPacket$txBytes(uint8_t *bytes, uint8_t numBytes) #line 144 { uint8_t byteToSend = 0; bool send = FALSE; #line 147 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 147 { if (NoCRCPacket$txCount == 0) { NoCRCPacket$txCount = 1; NoCRCPacket$txLength = numBytes; NoCRCPacket$sendPtr = bytes; byteToSend = NoCRCPacket$sendPtr[0]; send = TRUE; } } #line 156 __nesc_atomic_end(__nesc_atomic); } if (send) { if (NoCRCPacket$ByteComm$txByte(byteToSend)) { return SUCCESS; } else #line 161 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 162 { NoCRCPacket$txCount = 0; } #line 164 __nesc_atomic_end(__nesc_atomic); } } } return FAIL; } static inline # 160 "d:/tinyos-1.x/tos/system/AM.h" uint8_t TOS_MsgLength(uint8_t type) { return (size_t )& ((TOS_Msg *)0)->strength; } static inline # 171 "d:/tinyos-1.x/tos/system/NoCRCPacket.nc" result_t NoCRCPacket$Send$send(TOS_MsgPtr msg) #line 171 { uint8_t oldState; uint8_t *packet; uint8_t sendNum; result_t rval = FAIL; #line 176 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 176 { oldState = NoCRCPacket$state; if (NoCRCPacket$state == NoCRCPacket$IDLE) { NoCRCPacket$state = NoCRCPacket$PACKET; } packet = (uint8_t *)msg; sendNum = TOS_MsgLength(msg->type); } #line 183 __nesc_atomic_end(__nesc_atomic); } if (oldState == NoCRCPacket$IDLE) { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 185 { msg->crc = 1; rval = NoCRCPacket$txBytes(packet, sendNum); } #line 188 __nesc_atomic_end(__nesc_atomic); } } return rval; } # 85 "d:/tinyos-1.x/tos/interfaces/BareSendMsg.nc" inline static result_t AMStandard$UARTSend$send(TOS_MsgPtr arg_0xa3e0d40){ #line 85 unsigned char result; #line 85 #line 85 result = NoCRCPacket$Send$send(arg_0xa3e0d40); #line 85 #line 85 return result; #line 85 } #line 85 static inline # 193 "d:/tinyos-1.x/tos/system/AMStandard.nc" void AMStandard$sendTask(void) #line 193 { result_t ok; TOS_MsgPtr buf; #line 196 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 196 { buf = AMStandard$buffer; } #line 198 __nesc_atomic_end(__nesc_atomic); } if (buf->addr == TOS_UART_ADDR) { ok = AMStandard$UARTSend$send(buf); } else { #line 202 ok = AMStandard$RadioSend$send(buf); } if (ok == FAIL) { AMStandard$reportSendDone(AMStandard$buffer, FAIL); } } static inline # 122 "d:/tinyos-1.x/tos/platform/mica2/HPLUART0M.nc" result_t HPLUART0M$UART$put(uint8_t data) #line 122 { * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0C + 0x20) = data; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0B + 0x20) |= 1 << 6; return SUCCESS; } # 107 "d:/tinyos-1.x/tos/interfaces/HPLUART.nc" inline static result_t UARTM$HPLUART$put(uint8_t arg_0xa5afea8){ #line 107 unsigned char result; #line 107 #line 107 result = HPLUART0M$UART$put(arg_0xa5afea8); #line 107 #line 107 return result; #line 107 } #line 107 static inline # 569 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkM.nc" result_t NetworkM$SendStatusMessage$sendDone(TOS_MsgPtr msg, result_t success) #line 569 { return NetworkM$sendDone(msg, success); } static inline result_t NetworkM$SchemaMsg$sendDone(TOS_MsgPtr msg, result_t success) #line 579 { return NetworkM$sendDone(msg, success); } static inline #line 574 result_t NetworkM$DebugMsg$sendDone(TOS_MsgPtr msg, result_t success) #line 574 { return NetworkM$sendDone(msg, success); } static inline #line 564 result_t NetworkM$SendQueryRequest$sendDone(TOS_MsgPtr msg, result_t success) #line 564 { return NetworkM$sendDone(msg, success); } # 72 "d:/tinyos-1.x/tos/interfaces/SendMsg.nc" inline static result_t NetworkM$SendQueryMsg$send(uint16_t arg_0xa32f9f0, uint8_t arg_0xa32fb30, TOS_MsgPtr arg_0xa32fc78){ #line 72 unsigned char result; #line 72 #line 72 result = AMStandard$SendMsg$send(kQUERY_MESSAGE_ID, arg_0xa32f9f0, arg_0xa32fb30, arg_0xa32fc78); #line 72 #line 72 return result; #line 72 } #line 72 static inline # 526 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkM.nc" result_t NetworkM$SendQueryMsg$sendDone(TOS_MsgPtr msg, result_t success) #line 526 { if ((!success || ! msg->ack) && NetworkM$mRetryCnt-- > 0) { if (NetworkM$SendQueryMsg$send(TOS_BCAST_ADDR, kMSG_LEN, msg) != SUCCESS) { NetworkM$mRetryCnt = 0; return NetworkM$sendDone(msg, FAIL); } } else #line 532 { NetworkM$mRetryCnt = 0; return NetworkM$sendDone(msg, success && msg->ack); } return SUCCESS; } # 72 "d:/tinyos-1.x/tos/interfaces/SendMsg.nc" inline static result_t NetworkM$SendDataMsg$send(uint16_t arg_0xa32f9f0, uint8_t arg_0xa32fb30, TOS_MsgPtr arg_0xa32fc78){ #line 72 unsigned char result; #line 72 #line 72 result = AMStandard$SendMsg$send(kDATA_MESSAGE_ID, arg_0xa32f9f0, arg_0xa32fb30, arg_0xa32fc78); #line 72 #line 72 return result; #line 72 } #line 72 static inline # 539 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkM.nc" result_t NetworkM$SendDataMsg$sendDone(TOS_MsgPtr msg, result_t success) #line 539 { uint8_t rootId = 0; bool amRoot = NetworkM$checkRoot(msg, &rootId); if (!amRoot) { if (! msg->ack) { #line 549 NetworkM$NetworkMonitor$updateContention(TRUE, ACK_FAILURE); } else { #line 550 NetworkM$NetworkMonitor$updateContention(FALSE, 0); } } #line 552 if ((!success || ! msg->ack) && NetworkM$mRetryCnt-- > 0) { if (NetworkM$SendDataMsg$send(TOS_BCAST_ADDR, kMSG_LEN, msg) != SUCCESS) { NetworkM$mRetryCnt = 0; return NetworkM$sendDone(msg, FAIL); } } else #line 557 { NetworkM$mRetryCnt = 0; return NetworkM$sendDone(msg, success && msg->ack); } return SUCCESS; } static inline # 185 "d:/tinyos-1.x/tos/system/AMStandard.nc" result_t AMStandard$SendMsg$default$sendDone(uint8_t id, TOS_MsgPtr msg, result_t success) #line 185 { return SUCCESS; } # 73 "d:/tinyos-1.x/tos/interfaces/SendMsg.nc" inline static result_t AMStandard$SendMsg$sendDone(uint8_t arg_0xa3e4d48, TOS_MsgPtr arg_0xa3320a0, result_t arg_0xa3321e8){ #line 73 unsigned char result; #line 73 #line 73 switch (arg_0xa3e4d48) { #line 73 case 1: #line 73 result = NetworkM$DebugMsg$sendDone(arg_0xa3320a0, arg_0xa3321e8); #line 73 break; #line 73 case kQUERY_MESSAGE_ID: #line 73 result = NetworkM$SendQueryMsg$sendDone(arg_0xa3320a0, arg_0xa3321e8); #line 73 break; #line 73 case kCOMMAND_MESSAGE_ID: #line 73 result = NetworkM$SchemaMsg$sendDone(arg_0xa3320a0, arg_0xa3321e8); #line 73 break; #line 73 case kQUERY_REQUEST_MESSAGE_ID: #line 73 result = NetworkM$SendQueryRequest$sendDone(arg_0xa3320a0, arg_0xa3321e8); #line 73 break; #line 73 case kSTATUS_MESSAGE_ID: #line 73 result = NetworkM$SendStatusMessage$sendDone(arg_0xa3320a0, arg_0xa3321e8); #line 73 break; #line 73 case kDATA_MESSAGE_ID: #line 73 result = NetworkM$SendDataMsg$sendDone(arg_0xa3320a0, arg_0xa3321e8); #line 73 break; #line 73 default: #line 73 result = AMStandard$SendMsg$default$sendDone(arg_0xa3e4d48, arg_0xa3320a0, arg_0xa3321e8); #line 73 } #line 73 #line 73 return result; #line 73 } #line 73 static inline # 2314 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" result_t TupleRouterM$Network$sendDataDone(TOS_MsgPtr msg, result_t success) { return TupleRouterM$outputDone(msg); } # 99 "d:/tinyos-1.x/tos/lib/TinyDB/Network.nc" inline static result_t NetworkM$Network$sendDataDone(TOS_MsgPtr arg_0xa31a970, result_t arg_0xa31aab8){ #line 99 unsigned char result; #line 99 #line 99 result = TupleRouterM$Network$sendDataDone(arg_0xa31a970, arg_0xa31aab8); #line 99 #line 99 return result; #line 99 } #line 99 static inline # 415 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$SET_DELIVERING_TUPLES(void) #line 415 { #line 415 TupleRouterM$mPendingMask |= TupleRouterM$DELIVERING_BIT; } static inline # 100 "d:/tinyos-1.x/tos/lib/TinyDB/QueryResult.nc" TinyDBError QueryResult$QueryResultIntf$initQueryResult(QueryResultPtr qr) #line 100 { qr->qrType = kUNDEFINED; qr->result_idx = 0; return err_NoError; } # 105 "d:/tinyos-1.x/tos/lib/TinyDB/QueryResultIntf.nc" inline static TinyDBError TupleRouterM$QueryResultIntf$initQueryResult(QueryResultPtr arg_0xa617878){ #line 105 enum __nesc_unnamed4265 result; #line 105 #line 105 result = QueryResult$QueryResultIntf$initQueryResult(arg_0xa617878); #line 105 #line 105 return result; #line 105 } #line 105 static inline # 338 "d:/tinyos-1.x/tos/lib/TinyDB/QueryResult.nc" TinyDBError QueryResult$QueryResultIntf$addAggResult(QueryResultPtr qr, int16_t groupNo, char *bytes, int16_t size, ParsedQueryPtr q, short exprIdx) #line 343 { if (size > QueryResult$BUF_SIZE) { #line 345 return err_OutOfMemory; } #line 346 if (qr->qrType == kNOT_AGG) { #line 346 return err_AlreadyTupleResult; } if (qr->qrType == kIS_AGG && qr->qid != q->qid) { return err_InvalidQueryId; } else #line 350 { qr->qid = q->qid; qr->qrType = kIS_AGG; } qr->d.buf[(short )qr->result_idx].data = bytes; qr->d.buf[(short )qr->result_idx].group = groupNo; qr->result_idx++; return err_NoError; } # 177 "d:/tinyos-1.x/tos/lib/TinyDB/QueryResultIntf.nc" inline static TinyDBError AggOperator$QueryResultIntf$addAggResult(QueryResultPtr arg_0xa629ae0, int16_t arg_0xa629c20, char *arg_0xa629d70, int16_t arg_0xa629eb0, ParsedQueryPtr arg_0xa60a010, short arg_0xa60a148){ #line 177 enum __nesc_unnamed4265 result; #line 177 #line 177 result = QueryResult$QueryResultIntf$addAggResult(arg_0xa629ae0, arg_0xa629c20, arg_0xa629d70, arg_0xa629eb0, arg_0xa60a010, arg_0xa60a148); #line 177 #line 177 return result; #line 177 } #line 177 static inline # 141 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/Aggregates.h" uint8_t getEpochsPerWindow(ParamVals *v) #line 141 { return * (uint8_t *)v->paramDataPtr[kEPOCHS_PER_WINDOW]; } static inline # 115 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinAvgM.nc" bool WinAvgM$Aggregate$hasData(char *data, ParamList *params, ParamVals *paramValues) #line 115 { WinAvgM$TemporalAverageData *mydata = (WinAvgM$TemporalAverageData *)data; if (getEpochsPerWindow(paramValues) > 0 && mydata->epochsLeft > 0) { mydata->epochsLeft--; } #line 120 if (mydata->epochsLeft == 0) { #line 120 return TRUE; } else { #line 121 return FALSE; } } static inline # 93 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinSumM.nc" bool WinSumM$Aggregate$hasData(char *data, ParamList *params, ParamVals *paramValues) #line 93 { TemporalAlgebraicData *mydata = (TemporalAlgebraicData *)data; if (getEpochsPerWindow(paramValues) > 0 && mydata->epochsLeft > 0) { mydata->epochsLeft--; } #line 98 if (mydata->epochsLeft == 0) { #line 98 return TRUE; } else { #line 99 return FALSE; } } static inline # 93 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinCountM.nc" bool WinCountM$Aggregate$hasData(char *data, ParamList *params, ParamVals *paramValues) #line 93 { TemporalAlgebraicData *mydata = (TemporalAlgebraicData *)data; if (getEpochsPerWindow(paramValues) > 0 && mydata->epochsLeft > 0) { mydata->epochsLeft--; } #line 98 if (mydata->epochsLeft == 0) { #line 98 return TRUE; } else { #line 99 return FALSE; } } static inline # 103 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinMaxM.nc" bool WinMaxM$Aggregate$hasData(char *data, ParamList *params, ParamVals *paramValues) #line 103 { TemporalAlgebraicData *mydata = (TemporalAlgebraicData *)data; if (getEpochsPerWindow(paramValues) > 0 && mydata->epochsLeft > 0) { mydata->epochsLeft--; } #line 108 if (mydata->epochsLeft == 0) { #line 108 return TRUE; } else { #line 109 return FALSE; } } static inline # 102 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinMinM.nc" bool WinMinM$Aggregate$hasData(char *data, ParamList *params, ParamVals *paramValues) #line 102 { TemporalAlgebraicData *mydata = (TemporalAlgebraicData *)data; bool result = FALSE; #line 105 if (getEpochsPerWindow(paramValues) > 0 && mydata->epochsLeft > 0) { mydata->epochsLeft--; } #line 107 if (mydata->epochsLeft == 0) { #line 107 result = TRUE; } return result; } static inline # 57 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/ExpAvgM.nc" bool ExpAvgM$Aggregate$hasData(char *data, ParamList *params, ParamVals *paramValues) #line 57 { return TRUE; } static inline # 49 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AvgM.nc" bool AvgM$Aggregate$hasData(char *data, ParamList *params, ParamVals *paramValues) #line 49 { return TRUE; } static inline # 48 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/SumM.nc" bool SumM$Aggregate$hasData(char *data, ParamList *params, ParamVals *paramValues) #line 48 { return TRUE; } static inline # 48 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/CountM.nc" bool CountM$Aggregate$hasData(char *data, ParamList *params, ParamVals *paramValues) #line 48 { return TRUE; } static inline # 56 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/MinM.nc" bool MinM$Aggregate$hasData(char *data, ParamList *params, ParamVals *paramValues) #line 56 { return TRUE; } static inline # 56 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/MaxM.nc" bool MaxM$Aggregate$hasData(char *data, ParamList *params, ParamVals *paramValues) #line 56 { return TRUE; } static inline # 74 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AggregateUseM.nc" bool AggregateUseM$Agg$default$hasData(uint8_t id, char *data, ParamList *params, ParamVals *paramValues) #line 75 { return FALSE; } # 102 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/Aggregate.nc" inline static bool AggregateUseM$Agg$hasData(uint8_t arg_0xa9500a0, char *arg_0xa9835f0, ParamList *arg_0xa983750, ParamVals *arg_0xa9838b8){ #line 102 unsigned char result; #line 102 #line 102 switch (arg_0xa9500a0) { #line 102 case kSUM: #line 102 result = SumM$Aggregate$hasData(arg_0xa9835f0, arg_0xa983750, arg_0xa9838b8); #line 102 break; #line 102 case kMIN: #line 102 result = MinM$Aggregate$hasData(arg_0xa9835f0, arg_0xa983750, arg_0xa9838b8); #line 102 break; #line 102 case kMAX: #line 102 result = MaxM$Aggregate$hasData(arg_0xa9835f0, arg_0xa983750, arg_0xa9838b8); #line 102 break; #line 102 case kCOUNT: #line 102 result = CountM$Aggregate$hasData(arg_0xa9835f0, arg_0xa983750, arg_0xa9838b8); #line 102 break; #line 102 case kAVG: #line 102 result = AvgM$Aggregate$hasData(arg_0xa9835f0, arg_0xa983750, arg_0xa9838b8); #line 102 break; #line 102 case kEXP_AVG: #line 102 result = ExpAvgM$Aggregate$hasData(arg_0xa9835f0, arg_0xa983750, arg_0xa9838b8); #line 102 break; #line 102 case kWIN_AVG: #line 102 result = WinAvgM$Aggregate$hasData(arg_0xa9835f0, arg_0xa983750, arg_0xa9838b8); #line 102 break; #line 102 case kWIN_SUM: #line 102 result = WinSumM$Aggregate$hasData(arg_0xa9835f0, arg_0xa983750, arg_0xa9838b8); #line 102 break; #line 102 case kWIN_MIN: #line 102 result = WinMinM$Aggregate$hasData(arg_0xa9835f0, arg_0xa983750, arg_0xa9838b8); #line 102 break; #line 102 case kWIN_MAX: #line 102 result = WinMaxM$Aggregate$hasData(arg_0xa9835f0, arg_0xa983750, arg_0xa9838b8); #line 102 break; #line 102 case kWIN_COUNT: #line 102 result = WinCountM$Aggregate$hasData(arg_0xa9835f0, arg_0xa983750, arg_0xa9838b8); #line 102 break; #line 102 default: #line 102 result = AggregateUseM$Agg$default$hasData(arg_0xa9500a0, arg_0xa9835f0, arg_0xa983750, arg_0xa9838b8); #line 102 } #line 102 #line 102 return result; #line 102 } #line 102 static inline # 39 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AggregateUseM.nc" bool AggregateUseM$AggregateUse$hasData(uint8_t id, char *data, ParamList *params, ParamVals *paramValues) #line 39 { return AggregateUseM$Agg$hasData(id, data, params, paramValues); } # 91 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AggregateUse.nc" inline static bool AggOperator$AggregateUse$hasData(uint8_t arg_0xa929e50, char *arg_0xa926010, ParamList *arg_0xa926170, ParamVals *arg_0xa9262d8){ #line 91 unsigned char result; #line 91 #line 91 result = AggregateUseM$AggregateUse$hasData(arg_0xa929e50, arg_0xa926010, arg_0xa926170, arg_0xa9262d8); #line 91 #line 91 return result; #line 91 } #line 91 static inline # 664 "d:/tinyos-1.x/tos/lib/TinyDB/AggOperator.nc" bool AggOperator$aggHasData(AggOperator$GroupRecord *gr, Expr *e) #line 664 { ParamVals paramVals; #line 666 setParamValues(¶mVals, e); return AggOperator$AggregateUse$hasData(e->ex.agg.op, gr->aggdata, (void *)0, ¶mVals); } static inline #line 149 AggOperator$GroupRecord *AggOperator$GET_GROUP_DATA(AggOperator$GroupDataHandle dHan, uint8_t n) #line 149 { return (AggOperator$GroupRecord *)&(*dHan)->groupData[n * (*dHan)->groupSize]; } static inline #line 265 TinyDBError AggOperator$addResults(QueryResult *qr, ParsedQuery *pq, ExprPtr e) #line 265 { int i = 0; AggOperator$GroupRecord *gr; AggOperator$GroupDataHandle gdh = (AggOperator$GroupDataHandle )e->opState; TinyDBError err; if (gdh == (void *)0) { #line 271 return err_NoError; } for (i = 0; i < (*gdh)->numGroups; i++) { gr = AggOperator$GET_GROUP_DATA(gdh, i); if (! gr->u.empty && AggOperator$aggHasData(gr, e)) { if (e->ex.agg.op == kADP_DELTA) { qr->epoch = ((TemporalAdpDeltaData *)gr->aggdata)->lastResult.epoch; } err = AggOperator$QueryResultIntf$addAggResult(qr, gr->groupNo, (char *)gr, (*gdh)->groupSize, pq, e->idx); if (err != err_NoError) { return err; } gr->u.exprIdx = e->idx; } } return err_NoError; } # 198 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" inline static TinyDBError TupleRouterM$addResults(QueryResult *arg_0xa6366b0, ParsedQuery *arg_0xa636810, Expr *arg_0xa636968){ #line 198 enum __nesc_unnamed4265 result; #line 198 #line 198 result = AggOperator$addResults(arg_0xa6366b0, arg_0xa636810, arg_0xa636968); #line 198 #line 198 return result; #line 198 } #line 198 # 153 "d:/tinyos-1.x/tos/lib/TinyDB/QueryResultIntf.nc" inline static short TupleRouterM$QueryResultIntf$numRecords(QueryResultPtr arg_0xa628df8, ParsedQueryPtr arg_0xa628f40){ #line 153 short result; #line 153 #line 153 result = QueryResult$QueryResultIntf$numRecords(arg_0xa628df8, arg_0xa628f40); #line 153 #line 153 return result; #line 153 } #line 153 inline static short DBBufferC$QueryResultIntf$numRecords(QueryResultPtr arg_0xa628df8, ParsedQueryPtr arg_0xa628f40){ #line 153 short result; #line 153 #line 153 result = QueryResult$QueryResultIntf$numRecords(arg_0xa628df8, arg_0xa628f40); #line 153 #line 153 return result; #line 153 } #line 153 inline static ResultTuple DBBufferC$QueryResultIntf$getResultTuple(QueryResultPtr arg_0xa629378, short arg_0xa6294b0, ParsedQueryPtr arg_0xa6295f8){ #line 159 struct __nesc_unnamed4292 result; #line 159 #line 159 result = QueryResult$QueryResultIntf$getResultTuple(arg_0xa629378, arg_0xa6294b0, arg_0xa6295f8); #line 159 #line 159 return result; #line 159 } #line 159 #line 146 inline static TinyDBError DBBufferC$QueryResultIntf$fromResultTuple(ResultTuple arg_0xa6282f8, QueryResultPtr arg_0xa628440, ParsedQueryPtr arg_0xa628588){ #line 146 enum __nesc_unnamed4265 result; #line 146 #line 146 result = QueryResult$QueryResultIntf$fromResultTuple(arg_0xa6282f8, arg_0xa628440, arg_0xa628588); #line 146 #line 146 return result; #line 146 } #line 146 static inline # 1219 "d:/tinyos-1.x/tos/lib/TinyDB/DBBufferC.nc" uint8_t DBBufferC$CatalogTable$catalogFieldSize(uint8_t bufIdx, uint8_t fieldNo) #line 1219 { uint8_t bufferId; uint8_t numFields; uint8_t *sizes = (void *)0; if (DBBufferC$getSpecialBufferId(bufIdx, &bufferId) != err_NoError) { return 0; } #line 1226 switch (bufferId) { case DBBufferC$kATTR_BUF: numFields = DBBufferC$NUM_ATTR_FIELDS; #line 1228 sizes = (char *)DBBufferC$ATTR_SIZES; break; case DBBufferC$kCOMMAND_BUF: break; case DBBufferC$kEVENT_BUF: break; case DBBufferC$kQUERY_BUF: break; default: return 0; } if (fieldNo < DBBufferC$NUM_ATTR_FIELDS && sizes != (void *)0) { return sizes[fieldNo]; } else { #line 1248 return 0; } } # 71 "d:/tinyos-1.x/tos/lib/TinyDB/CatalogTable.nc" inline static uint8_t Tuple$CatalogTable$catalogFieldSize(uint8_t arg_0xa7f7b98, uint8_t arg_0xa7f7cd8){ #line 71 unsigned char result; #line 71 #line 71 result = DBBufferC$CatalogTable$catalogFieldSize(arg_0xa7f7b98, arg_0xa7f7cd8); #line 71 #line 71 return result; #line 71 } #line 71 # 181 "d:/tinyos-1.x/tos/lib/TinyDB/DBBuffer.nc" inline static TinyDBError Tuple$DBBuffer$getBufferId(uint8_t arg_0xa641038, bool arg_0xa641180, uint8_t *arg_0xa6412e0){ #line 181 enum __nesc_unnamed4265 result; #line 181 #line 181 result = DBBufferC$DBBuffer$getBufferId(arg_0xa641038, arg_0xa641180, arg_0xa6412e0); #line 181 #line 181 return result; #line 181 } #line 181 #line 165 inline static ParsedQuery **Tuple$DBBuffer$getSchema(uint8_t arg_0xa640718){ #line 165 struct __nesc_unnamed4276 **result; #line 165 #line 165 result = DBBufferC$DBBuffer$getSchema(arg_0xa640718); #line 165 #line 165 return result; #line 165 } #line 165 # 73 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQueryIntf.nc" inline static bool Tuple$ParsedQueryIntf$queryFieldIsNull(uint8_t arg_0xa601520){ #line 73 unsigned char result; #line 73 #line 73 result = ParsedQuery$ParsedQueryIntf$queryFieldIsNull(arg_0xa601520); #line 73 #line 73 return result; #line 73 } #line 73 static inline # 286 "d:/tinyos-1.x/tos/lib/TinyDB/Tuple.nc" uint16_t Tuple$typeToSize(TOSType type) #line 286 { return sizeOf(type); } static inline # 92 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQuery.nc" bool ParsedQuery$ParsedQueryIntf$queryFieldIsTyped(uint8_t field) #line 92 { return (field & TYPED_FIELD) == TYPED_FIELD; } # 78 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQueryIntf.nc" inline static bool Tuple$ParsedQueryIntf$queryFieldIsTyped(uint8_t arg_0xa601948){ #line 78 unsigned char result; #line 78 #line 78 result = ParsedQuery$ParsedQueryIntf$queryFieldIsTyped(arg_0xa601948); #line 78 #line 78 return result; #line 78 } #line 78 static inline # 80 "d:/tinyos-1.x/tos/lib/TinyDB/TableM.nc" char *TableM$getAliases(ParsedQuery *pq) #line 80 { return (char *)* pq->tableInfo + pq->numFields; } static inline #line 130 result_t TableM$Table$getFieldName(ParsedQuery *pq, uint8_t idx, char **name) #line 130 { char *names; #line 132 if (pq->tableInfo != (void *)0 && pq->numFields > idx) { names = TableM$getAliases(pq); *name = &names[TableM$nameOffset(names, idx)]; return SUCCESS; } return FAIL; } # 74 "d:/tinyos-1.x/tos/lib/TinyDB/Table.nc" inline static result_t Tuple$Table$getFieldName(ParsedQuery *arg_0xa63af10, uint8_t arg_0xa63b050, char **arg_0xa63b1b8){ #line 74 unsigned char result; #line 74 #line 74 result = TableM$Table$getFieldName(arg_0xa63af10, arg_0xa63b050, arg_0xa63b1b8); #line 74 #line 74 return result; #line 74 } #line 74 # 66 "d:/tinyos-1.x/tos/interfaces/AttrUse.nc" inline static AttrDescPtr Tuple$AttrUse$getAttr(char *arg_0xa5e4850){ #line 66 struct __nesc_unnamed4260 *result; #line 66 #line 66 result = Attr$AttrUse$getAttr(arg_0xa5e4850); #line 66 #line 66 return result; #line 66 } #line 66 # 72 "d:/tinyos-1.x/tos/lib/TinyDB/Table.nc" inline static result_t Tuple$Table$getType(ParsedQuery *arg_0xa63a178, uint8_t arg_0xa63a2c0, uint8_t *arg_0xa63a418){ #line 72 unsigned char result; #line 72 #line 72 result = TableM$Table$getType(arg_0xa63a178, arg_0xa63a2c0, arg_0xa63a418); #line 72 #line 72 return result; #line 72 } #line 72 static inline # 74 "d:/tinyos-1.x/tos/lib/TinyDB/TableM.nc" uint8_t *TableM$getTypes(ParsedQuery *pq) #line 74 { return (uint8_t *)* pq->tableInfo; } # 92 "d:/tinyos-1.x/tos/lib/TinyDB/Network.nc" inline static TinyDBError TupleRouterM$Network$sendDataMessage(TOS_MsgPtr arg_0xa31a4f0){ #line 92 enum __nesc_unnamed4265 result; #line 92 #line 92 result = NetworkM$Network$sendDataMessage(arg_0xa31a4f0); #line 92 #line 92 return result; #line 92 } #line 92 static inline # 419 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$SET_SENDING_MESSAGE(void) #line 419 { #line 419 TupleRouterM$mPendingMask |= TupleRouterM$SENDING_BIT; } static inline #line 3227 TinyDBError TupleRouterM$RadioQueue$enqueue(const QueryResultPtr qrMsg, bool *pending) #line 3227 { if (!TupleRouterM$IS_SENDING_MESSAGE()) { QueryResultPtr newQrMsg; #line 3231 TupleRouterM$SET_SENDING_MESSAGE(); newQrMsg = TupleRouterM$Network$getDataPayLoad(&TupleRouterM$mMsg); *newQrMsg = *qrMsg; *pending = TRUE; TupleRouterM$mSendingResult = TRUE; if (TupleRouterM$Network$sendDataMessage(&TupleRouterM$mMsg) != err_NoError) { TupleRouterM$mSendFailed++; if (TupleRouterM$mSendFailed > 10) { __asm volatile ("in __tmp_reg__,__SREG__""\n\t""cli""\n\t""wdr""\n\t""out %0,%1""\n\t""out __SREG__,__tmp_reg__""\n\t""out %0,%2" : : "I"((unsigned int )& * (volatile unsigned char *)(0x21 + 0x20) - 0x20), "r"(0x18), "r"((unsigned char )(15 | (1 << 3))) : "r0"); } *pending = FALSE; TupleRouterM$outputDone(&TupleRouterM$mMsg); } else { #line 3248 TupleRouterM$mSendFailed = 0; } } else { *pending = TRUE; } return err_NoError; } # 76 "d:/tinyos-1.x/tos/lib/TinyDB/RadioQueue.nc" inline static TinyDBError DBBufferC$RadioQueue$enqueue(const QueryResultPtr arg_0xa63cfd0, bool *arg_0xa63d128){ #line 76 enum __nesc_unnamed4265 result; #line 76 #line 76 result = TupleRouterM$RadioQueue$enqueue(arg_0xa63cfd0, arg_0xa63d128); #line 76 #line 76 return result; #line 76 } #line 76 static inline # 97 "d:/tinyos-1.x/tos/lib/Command.nc" CommandDescPtr Command$CommandUse$getCommandById(uint8_t id) { short numCmds = Command$commandDescs.numCmds; #line 100 if (id >= numCmds) { return (void *)0; } #line 102 return &Command$commandDescs.commandDesc[(int )id]; } # 70 "d:/tinyos-1.x/tos/interfaces/CommandUse.nc" inline static CommandDescPtr DBBufferC$CommandUse$getCommandById(uint8_t arg_0xa3400a0){ #line 70 struct __nesc_unnamed4310 *result; #line 70 #line 70 result = Command$CommandUse$getCommandById(arg_0xa3400a0); #line 70 #line 70 return result; #line 70 } #line 70 #line 86 inline static result_t DBBufferC$CommandUse$invoke(char *arg_0xa340b70, char *arg_0xa340cc8, SchemaErrorNo *arg_0xa340e28, ParamVals *arg_0xa340f88){ #line 86 unsigned char result; #line 86 #line 86 result = Command$CommandUse$invoke(arg_0xa340b70, arg_0xa340cc8, arg_0xa340e28, arg_0xa340f88); #line 86 #line 86 return result; #line 86 } #line 86 static inline # 45 "d:/tinyos-1.x/tos/lib/Reset.h" void resetMote(void) { __asm volatile ("cli"); __asm volatile ("in __tmp_reg__,__SREG__""\n\t""cli""\n\t""wdr""\n\t""out %0,%1""\n\t""out __SREG__,__tmp_reg__""\n\t""out %0,%2" : : "I"((unsigned int )& * (volatile unsigned char *)(0x21 + 0x20) - 0x20), "r"(0x18), "r"((unsigned char )(0 | (1 << 3))) : "r0"); while (1) { __asm volatile ("nop""\n\t");} } static inline # 52 "d:/tinyos-1.x/tos/lib/ResetC.nc" void ResetC$Reset$reset(void) { resetMote(); } # 46 "d:/tinyos-1.x/tos/interfaces/Reset.nc" inline static void CommandResetM$Reset$reset(void){ #line 46 ResetC$Reset$reset(); #line 46 } #line 46 static inline # 150 "d:/tinyos-1.x/tos/system/LedsC.nc" result_t LedsC$Leds$yellowOn(void) #line 150 { { } #line 151 ; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 152 { TOSH_CLR_YELLOW_LED_PIN(); LedsC$ledsOn |= LedsC$YELLOW_BIT; } #line 155 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 141 "d:/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t CommandResetM$Leds$yellowOn(void){ #line 141 unsigned char result; #line 141 #line 141 result = LedsC$Leds$yellowOn(); #line 141 #line 141 return result; #line 141 } #line 141 static inline # 121 "d:/tinyos-1.x/tos/system/LedsC.nc" result_t LedsC$Leds$greenOn(void) #line 121 { { } #line 122 ; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 123 { TOSH_CLR_GREEN_LED_PIN(); LedsC$ledsOn |= LedsC$GREEN_BIT; } #line 126 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 116 "d:/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t CommandResetM$Leds$greenOn(void){ #line 116 unsigned char result; #line 116 #line 116 result = LedsC$Leds$greenOn(); #line 116 #line 116 return result; #line 116 } #line 116 static inline # 92 "d:/tinyos-1.x/tos/system/LedsC.nc" result_t LedsC$Leds$redOn(void) #line 92 { { } #line 93 ; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 94 { TOSH_CLR_RED_LED_PIN(); LedsC$ledsOn |= LedsC$RED_BIT; } #line 97 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 91 "d:/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t CommandResetM$Leds$redOn(void){ #line 91 unsigned char result; #line 91 #line 91 result = LedsC$Leds$redOn(); #line 91 #line 91 return result; #line 91 } #line 91 static inline # 77 "d:/tinyos-1.x/tos/lib/Commands/CommandResetM.nc" result_t CommandResetM$ResetCmd$commandFunc(char *commandName, char *resultBuf, SchemaErrorNo *errorNo, ParamVals *params) { *errorNo = SCHEMA_RESULT_READY; CommandResetM$Leds$redOn(); CommandResetM$Leds$greenOn(); CommandResetM$Leds$yellowOn(); CommandResetM$Reset$reset(); return SUCCESS; } # 145 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_SET_PW2_PIN(void) #line 145 { #line 145 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x15 + 0x20) |= 1 << 2; } # 98 "d:/tinyos-1.x/tos/sensorboards/micasb/sensorboard.h" static __inline void TOSH_SET_SOUNDER_CTL_PIN(void) #line 98 { #line 98 TOSH_SET_PW2_PIN(); } static inline # 80 "d:/tinyos-1.x/tos/sensorboards/micasb/SounderM.nc" result_t SounderM$StdControl$start(void) #line 80 { TOSH_SET_SOUNDER_CTL_PIN(); { } #line 82 ; return SUCCESS; } # 59 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t CommandSounderM$SounderControl$start(void){ #line 59 unsigned char result; #line 59 #line 59 result = SounderM$StdControl$start(); #line 59 #line 59 return result; #line 59 } #line 59 # 90 "d:/tinyos-1.x/tos/interfaces/Timer.nc" inline static result_t CommandSounderM$Clock1$start(char arg_0xa3f1240, uint32_t arg_0xa3f1390){ #line 90 unsigned char result; #line 90 #line 90 result = LogicalTimeM$Timer$start(2, arg_0xa3f1240, arg_0xa3f1390); #line 90 #line 90 return result; #line 90 } #line 90 static inline # 83 "d:/tinyos-1.x/tos/lib/Commands/CommandSounderM.nc" result_t CommandSounderM$SetSound$commandFunc(char *commandName, char *resultBuf, SchemaErrorNo *errorNo, ParamVals *params) { int16_t arg = * (uint16_t *)params->paramDataPtr[0]; #line 86 *errorNo = SCHEMA_RESULT_READY; if (CommandSounderM$commandPending) { return FAIL; } #line 89 CommandSounderM$commandPending = TRUE; CommandSounderM$Clock1$start(TIMER_ONE_SHOT, arg); return CommandSounderM$SounderControl$start(); } static inline # 134 "d:/tinyos-1.x/tos/system/PotM.nc" result_t PotM$Pot$set(uint8_t setting) #line 134 { PotM$setPot(setting); return SUCCESS; } # 114 "d:/tinyos-1.x/tos/interfaces/Pot.nc" inline static result_t CommandPotM$Pot$set(uint8_t arg_0xa2a5618){ #line 114 unsigned char result; #line 114 #line 114 result = PotM$Pot$set(arg_0xa2a5618); #line 114 #line 114 return result; #line 114 } #line 114 # 108 "d:/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t CommandPotM$Leds$redToggle(void){ #line 108 unsigned char result; #line 108 #line 108 result = LedsC$Leds$redToggle(); #line 108 #line 108 return result; #line 108 } #line 108 static inline # 77 "d:/tinyos-1.x/tos/lib/Commands/CommandPotM.nc" result_t CommandPotM$SetPot$commandFunc(char *commandName, char *resultBuf, SchemaErrorNo *errorNo, ParamVals *params) { uint8_t arg; #line 80 *errorNo = SCHEMA_RESULT_READY; CommandPotM$Leds$redToggle(); arg = * (uint8_t *)params->paramDataPtr[0]; return CommandPotM$Pot$set(arg); } # 158 "d:/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t CommandLedsM$Leds$yellowToggle(void){ #line 158 unsigned char result; #line 158 #line 158 result = LedsC$Leds$yellowToggle(); #line 158 #line 158 return result; #line 158 } #line 158 #line 141 inline static result_t CommandLedsM$Leds$yellowOn(void){ #line 141 unsigned char result; #line 141 #line 141 result = LedsC$Leds$yellowOn(); #line 141 #line 141 return result; #line 141 } #line 141 static inline # 159 "d:/tinyos-1.x/tos/system/LedsC.nc" result_t LedsC$Leds$yellowOff(void) #line 159 { { } #line 160 ; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 161 { TOSH_SET_YELLOW_LED_PIN(); LedsC$ledsOn &= ~LedsC$YELLOW_BIT; } #line 164 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 149 "d:/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t CommandLedsM$Leds$yellowOff(void){ #line 149 unsigned char result; #line 149 #line 149 result = LedsC$Leds$yellowOff(); #line 149 #line 149 return result; #line 149 } #line 149 static inline # 131 "d:/tinyos-1.x/tos/lib/Commands/CommandLedsM.nc" result_t CommandLedsM$YellowLedCmd$commandFunc(char *commandName, char *resultBuf, SchemaErrorNo *errorNo, ParamVals *params) { uint8_t arg = * (uint8_t *)params->paramDataPtr[0]; *errorNo = SCHEMA_RESULT_READY; if (arg == 0) { if (CommandLedsM$Leds$yellowOff() != SUCCESS) { return FAIL; } } else { #line 141 if (arg == 1) { if (CommandLedsM$Leds$yellowOn() != SUCCESS) { return FAIL; } } else { if (CommandLedsM$Leds$yellowToggle() != SUCCESS) { return FAIL; } } } #line 151 return SUCCESS; } # 133 "d:/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t CommandLedsM$Leds$greenToggle(void){ #line 133 unsigned char result; #line 133 #line 133 result = LedsC$Leds$greenToggle(); #line 133 #line 133 return result; #line 133 } #line 133 #line 116 inline static result_t CommandLedsM$Leds$greenOn(void){ #line 116 unsigned char result; #line 116 #line 116 result = LedsC$Leds$greenOn(); #line 116 #line 116 return result; #line 116 } #line 116 static inline # 130 "d:/tinyos-1.x/tos/system/LedsC.nc" result_t LedsC$Leds$greenOff(void) #line 130 { { } #line 131 ; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 132 { TOSH_SET_GREEN_LED_PIN(); LedsC$ledsOn &= ~LedsC$GREEN_BIT; } #line 135 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 124 "d:/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t CommandLedsM$Leds$greenOff(void){ #line 124 unsigned char result; #line 124 #line 124 result = LedsC$Leds$greenOff(); #line 124 #line 124 return result; #line 124 } #line 124 static inline # 108 "d:/tinyos-1.x/tos/lib/Commands/CommandLedsM.nc" result_t CommandLedsM$GreenLedCmd$commandFunc(char *commandName, char *resultBuf, SchemaErrorNo *errorNo, ParamVals *params) { uint8_t arg = * (uint8_t *)params->paramDataPtr[0]; *errorNo = SCHEMA_RESULT_READY; if (arg == 0) { if (CommandLedsM$Leds$greenOff() != SUCCESS) { return FAIL; } } else { #line 118 if (arg == 1) { if (CommandLedsM$Leds$greenOn() != SUCCESS) { return FAIL; } } else { if (CommandLedsM$Leds$greenToggle() != SUCCESS) { return FAIL; } } } #line 128 return SUCCESS; } # 108 "d:/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t CommandLedsM$Leds$redToggle(void){ #line 108 unsigned char result; #line 108 #line 108 result = LedsC$Leds$redToggle(); #line 108 #line 108 return result; #line 108 } #line 108 #line 91 inline static result_t CommandLedsM$Leds$redOn(void){ #line 91 unsigned char result; #line 91 #line 91 result = LedsC$Leds$redOn(); #line 91 #line 91 return result; #line 91 } #line 91 static inline # 101 "d:/tinyos-1.x/tos/system/LedsC.nc" result_t LedsC$Leds$redOff(void) #line 101 { { } #line 102 ; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 103 { TOSH_SET_RED_LED_PIN(); LedsC$ledsOn &= ~LedsC$RED_BIT; } #line 106 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 99 "d:/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t CommandLedsM$Leds$redOff(void){ #line 99 unsigned char result; #line 99 #line 99 result = LedsC$Leds$redOff(); #line 99 #line 99 return result; #line 99 } #line 99 static inline # 85 "d:/tinyos-1.x/tos/lib/Commands/CommandLedsM.nc" result_t CommandLedsM$RedLedCmd$commandFunc(char *commandName, char *resultBuf, SchemaErrorNo *errorNo, ParamVals *params) { uint8_t arg = * (uint8_t *)params->paramDataPtr[0]; *errorNo = SCHEMA_RESULT_READY; if (arg == 0) { if (CommandLedsM$Leds$redOff() != SUCCESS) { return FAIL; } } else { #line 95 if (arg == 1) { if (CommandLedsM$Leds$redOn() != SUCCESS) { return FAIL; } } else { if (CommandLedsM$Leds$redToggle() != SUCCESS) { return FAIL; } } } #line 105 return SUCCESS; } static inline # 211 "d:/tinyos-1.x/tos/lib/Attr.nc" result_t Attr$ConstAttr$registerAttr(char *name, TOSType attrType, char *attrVal) { short attrIdx; short len; AttrDescPtr attrDesc; bool attrExists = FALSE; if ((( #line 217 Attr$addAttrPending || strlen(name) > MAX_ATTR_NAME_LEN) || lengthOf(attrType, attrVal) > MAX_CONST_LEN) || Attr$nConstAttrs >= MAX_CONST_ATTRS) { return FAIL; } else { #line 222 Attr$addAttrPending = TRUE; } for (attrIdx = 0; attrIdx < Attr$attrDescs.numAttrs; attrIdx++) if (strcasecmp(Attr$attrDescs.attrDesc[(int )attrIdx].name, name) == 0) { attrExists = TRUE; break; } if (!attrExists) { if (Attr$attrDescs.numAttrs < MAX_ATTRS) { Attr$attrDescs.numAttrs++; } else { Attr$addAttrPending = FALSE; return FAIL; } } attrDesc = &Attr$attrDescs.attrDesc[(int )attrIdx]; attrDesc->type = attrType; attrDesc->idx = attrIdx; len = sizeOf(attrType); if (len < 0) { attrDesc->nbytes = lengthOf(attrType, attrVal); } else { #line 249 attrDesc->nbytes = len; } #line 250 attrDesc->id = 0; if (!attrExists || attrDesc->constIdx < 0) { attrDesc->constIdx = Attr$nConstAttrs++; } #line 253 nmemcpy((char *)&Attr$constAttrs[(short )attrDesc->constIdx], attrVal, attrDesc->nbytes); strcpy(attrDesc->name, name); Attr$addAttrPending = FALSE; return SUCCESS; } # 51 "d:/tinyos-1.x/tos/interfaces/AttrRegisterConst.nc" inline static result_t CommandAttrM$AttrRegisterConst$registerAttr(char *arg_0xa7c5ee0, TOSType arg_0xa7ec060, char *arg_0xa7ec1b0){ #line 51 unsigned char result; #line 51 #line 51 result = Attr$ConstAttr$registerAttr(arg_0xa7c5ee0, arg_0xa7ec060, arg_0xa7ec1b0); #line 51 #line 51 return result; #line 51 } #line 51 static inline # 76 "d:/tinyos-1.x/tos/lib/Commands/CommandAttrM.nc" result_t CommandAttrM$CommandRegister$commandFunc(char *commandName, char *resultBuf, SchemaErrorNo *errorNo, ParamVals *params) { *errorNo = SCHEMA_RESULT_READY; return CommandAttrM$AttrRegisterConst$registerAttr(params->paramDataPtr[0], (TOSType )* (uint8_t *)params->paramDataPtr[1], params->paramDataPtr[2]); } static inline # 255 "d:/tinyos-1.x/tos/lib/Command.nc" result_t Command$Cmd$default$commandFunc(uint8_t id, char *commandName, char *resultBuf, SchemaErrorNo *errorNo, ParamVals *params) { return SUCCESS; } # 75 "d:/tinyos-1.x/tos/interfaces/CommandRegister.nc" inline static result_t Command$Cmd$commandFunc(uint8_t arg_0xa77e7b0, char *arg_0xa778010, char *arg_0xa778168, SchemaErrorNo *arg_0xa7782c8, ParamVals *arg_0xa778428){ #line 75 unsigned char result; #line 75 #line 75 switch (arg_0xa77e7b0) { #line 75 case 0: #line 75 result = CommandResetM$ResetCmd$commandFunc(arg_0xa778010, arg_0xa778168, arg_0xa7782c8, arg_0xa778428); #line 75 break; #line 75 case 1: #line 75 result = CommandSounderM$SetSound$commandFunc(arg_0xa778010, arg_0xa778168, arg_0xa7782c8, arg_0xa778428); #line 75 break; #line 75 case 2: #line 75 result = CommandPotM$SetPot$commandFunc(arg_0xa778010, arg_0xa778168, arg_0xa7782c8, arg_0xa778428); #line 75 break; #line 75 case 3: #line 75 result = CommandLedsM$RedLedCmd$commandFunc(arg_0xa778010, arg_0xa778168, arg_0xa7782c8, arg_0xa778428); #line 75 break; #line 75 case 4: #line 75 result = CommandLedsM$GreenLedCmd$commandFunc(arg_0xa778010, arg_0xa778168, arg_0xa7782c8, arg_0xa778428); #line 75 break; #line 75 case 5: #line 75 result = CommandLedsM$YellowLedCmd$commandFunc(arg_0xa778010, arg_0xa778168, arg_0xa7782c8, arg_0xa778428); #line 75 break; #line 75 case 6: #line 75 result = CommandAttrM$CommandRegister$commandFunc(arg_0xa778010, arg_0xa778168, arg_0xa7782c8, arg_0xa778428); #line 75 break; #line 75 default: #line 75 result = Command$Cmd$default$commandFunc(arg_0xa77e7b0, arg_0xa778010, arg_0xa778168, arg_0xa7782c8, arg_0xa778428); #line 75 } #line 75 #line 75 return result; #line 75 } #line 75 # 85 "d:/tinyos-1.x/tos/interfaces/MemAlloc.nc" inline static result_t DBBufferC$MemAlloc$allocate(HandlePtr arg_0xa60bd50, int16_t arg_0xa60be90){ #line 85 unsigned char result; #line 85 #line 85 result = TinyAlloc$MemAlloc$allocate(arg_0xa60bd50, arg_0xa60be90); #line 85 #line 85 return result; #line 85 } #line 85 static inline # 445 "d:/tinyos-1.x/tos/lib/TinyDB/AggOperator.nc" bool AggOperator$removeEmptyGroup(AggOperator$GroupDataHandle dh) #line 445 { short i; #line 446 short lastEmpty; bool found = FALSE; AggOperator$GroupRecord *gr; for (lastEmpty = (*dh)->numGroups - 1; lastEmpty >= 0; lastEmpty--) { gr = AggOperator$GET_GROUP_DATA(dh, lastEmpty); if (gr->u.empty) { found = TRUE; break; } } if (!found) { #line 459 return FALSE; } #line 460 { } #line 460 ; for (i = lastEmpty + 1; i < (*dh)->numGroups; i++) { gr = AggOperator$GET_GROUP_DATA(dh, i); AggOperator$SET_GROUP_DATA(dh, i - 1, (char *)&gr); } (*dh)->numGroups--; return TRUE; } #line 88 inline static void AggOperator$signalError(TinyDBError arg_0xa927b40, int arg_0xa927c78){ #line 88 TupleRouterM$signalError(arg_0xa927b40, arg_0xa927c78); #line 88 } #line 88 static inline # 3323 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$statusMessage(CharPtr m) #line 3323 { if (TOS_LOCAL_ADDRESS != 0) { nmemcpy(TupleRouterM$mDbgMsg, m, strlen(m)); TupleRouterM$mStatus = TRUE; } } static inline # 145 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/Aggregates.h" uint8_t getSlidingDist(ParamVals *v) #line 145 { return * (uint8_t *)v->paramDataPtr[kSLIDING_DIST]; } static inline # 71 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinAvgM.nc" result_t WinAvgM$Aggregate$init(char *data, ParamList *params, ParamVals *paramValues, bool isFirstTime) #line 71 { WinAvgM$TemporalAverageData *mydata = (WinAvgM$TemporalAverageData *)data; uint8_t epochsPerWindow = getEpochsPerWindow(paramValues); uint8_t slidingDist = getSlidingDist(paramValues); if (mydata->epochsLeft == 0 || isFirstTime) { mydata->lastResult.sum = 0; mydata->lastResult.count = 0; mydata->epochsLeft = slidingDist; if (isFirstTime && epochsPerWindow > slidingDist) { mydata->head = mydata->tail = 0; mydata->size = epochsPerWindow - slidingDist; mydata->nvals = 0; } if (epochsPerWindow > slidingDist) { uint16_t i; #line 91 uint16_t n; #line 92 for (i = mydata->head, n = 0; n < mydata->nvals; i = (i + 1) % mydata->size, n++) { mydata->lastResult.sum += mydata->value[i].sum; mydata->lastResult.count += mydata->value[i].count; } } } return SUCCESS; } static inline # 51 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinSumM.nc" result_t WinSumM$Aggregate$init(char *data, ParamList *params, ParamVals *paramValues, bool isFirstTime) #line 51 { TemporalAlgebraicData *mydata = (TemporalAlgebraicData *)data; uint8_t epochsPerWindow = getEpochsPerWindow(paramValues); uint8_t slidingDist = getSlidingDist(paramValues); if (mydata->epochsLeft == 0 || isFirstTime) { mydata->lastResult.value = 0; mydata->epochsLeft = slidingDist; if (isFirstTime && epochsPerWindow > slidingDist) { mydata->head = mydata->tail = 0; mydata->size = epochsPerWindow - slidingDist; mydata->nvals = 0; } if (epochsPerWindow > slidingDist) { uint16_t i; #line 70 uint16_t n; #line 71 for (i = mydata->head, n = 0; n < mydata->nvals; i = (i + 1) % mydata->size, n++) { mydata->lastResult.value += mydata->value[i]; } } } return SUCCESS; } static inline # 51 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinCountM.nc" result_t WinCountM$Aggregate$init(char *data, ParamList *params, ParamVals *paramValues, bool isFirstTime) #line 51 { TemporalAlgebraicData *mydata = (TemporalAlgebraicData *)data; uint8_t epochsPerWindow = getEpochsPerWindow(paramValues); uint8_t slidingDist = getSlidingDist(paramValues); if (mydata->epochsLeft == 0 || isFirstTime) { mydata->epochsLeft = slidingDist; mydata->lastResult.value = 0; if (isFirstTime && epochsPerWindow > slidingDist) { mydata->head = mydata->tail = 0; mydata->size = epochsPerWindow - slidingDist; mydata->nvals = 0; } if (epochsPerWindow > slidingDist) { uint16_t i; #line 70 uint16_t n; #line 71 for (i = mydata->head, n = 0; n < mydata->nvals; i = (i + 1) % mydata->size, n++) { mydata->lastResult.value += mydata->value[i]; } } } return SUCCESS; } static inline # 60 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinMaxM.nc" result_t WinMaxM$Aggregate$init(char *data, ParamList *params, ParamVals *paramValues, bool isFirstTime) #line 60 { TemporalAlgebraicData *mydata = (TemporalAlgebraicData *)data; uint8_t epochsPerWindow = getEpochsPerWindow(paramValues); uint8_t slidingDist = getSlidingDist(paramValues); if (mydata->epochsLeft == 0 || isFirstTime) { mydata->epochsLeft = slidingDist; mydata->lastResult.value = kMIN_SHORT; #line 68 ; if (isFirstTime && epochsPerWindow > slidingDist) { mydata->head = mydata->tail = 0; mydata->size = epochsPerWindow - slidingDist; mydata->nvals = 0; } if (epochsPerWindow > slidingDist) { uint16_t i; #line 79 uint16_t n; #line 80 for (i = mydata->head, n = 0; n < mydata->nvals; i = (i + 1) % mydata->size, n++) { if (mydata->lastResult.value < mydata->value[i]) { mydata->lastResult.value = mydata->value[i]; } } } } return SUCCESS; } static inline # 59 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinMinM.nc" result_t WinMinM$Aggregate$init(char *data, ParamList *params, ParamVals *paramValues, bool isFirstTime) #line 59 { TemporalAlgebraicData *mydata = (TemporalAlgebraicData *)data; uint8_t epochsPerWindow = getEpochsPerWindow(paramValues); uint8_t slidingDist = getSlidingDist(paramValues); if (mydata->epochsLeft == 0 || isFirstTime) { mydata->epochsLeft = slidingDist; mydata->lastResult.value = kMAX_SHORT; if (isFirstTime && epochsPerWindow > slidingDist) { mydata->head = mydata->tail = 0; mydata->size = epochsPerWindow - slidingDist; mydata->nvals = 0; } if (epochsPerWindow > slidingDist) { uint16_t i; #line 78 uint16_t n; #line 79 for (i = mydata->head, n = 0; n < mydata->nvals; i = (i + 1) % mydata->size, n++) { if (mydata->lastResult.value > mydata->value[i]) { mydata->lastResult.value = mydata->value[i]; } } } } return SUCCESS; } static inline # 43 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/ExpAvgM.nc" result_t ExpAvgM$Aggregate$init(char *data, ParamList *params, ParamVals *paramValues, bool isFirstTime) #line 43 { ExpAvgM$ExpAvgData *mydata = (ExpAvgM$ExpAvgData *)data; if (isFirstTime) { mydata->value = 0; mydata->epochsLeft = 0; } return SUCCESS; } static inline # 36 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AvgM.nc" result_t AvgM$Aggregate$init(char *data, ParamList *params, ParamVals *paramValues, bool isFirstTime) #line 36 { AverageData *mydata = (AverageData *)data; mydata->sum = 0; mydata->count = 0; return SUCCESS; } static inline # 36 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/SumM.nc" result_t SumM$Aggregate$init(char *data, ParamList *params, ParamVals *paramValues, bool isFirstTime) #line 36 { AlgebraicData *mydata = (AlgebraicData *)data; mydata->value = 0; return SUCCESS; } static inline # 36 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/CountM.nc" result_t CountM$Aggregate$init(char *data, ParamList *params, ParamVals *paramValues, bool isFirstTime) #line 36 { AlgebraicData *mydata = (AlgebraicData *)data; mydata->value = 0; return SUCCESS; } static inline # 43 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/MinM.nc" result_t MinM$Aggregate$init(char *data, ParamList *params, ParamVals *paramValues, bool isFirstTime) #line 43 { AlgebraicData *mydata = (AlgebraicData *)data; mydata->value = kMAX_SHORT; mydata->id = TOS_LOCAL_ADDRESS; return SUCCESS; } static inline # 43 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/MaxM.nc" result_t MaxM$Aggregate$init(char *data, ParamList *params, ParamVals *paramValues, bool isFirstTime) #line 43 { AlgebraicData *mydata = (AlgebraicData *)data; mydata->value = kMIN_SHORT; mydata->id = TOS_LOCAL_ADDRESS; return SUCCESS; } static inline # 64 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AggregateUseM.nc" result_t AggregateUseM$Agg$default$init(uint8_t id, char *data, ParamList *params, ParamVals *paramValues, bool isFirstTime) #line 65 { return SUCCESS; } # 87 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/Aggregate.nc" inline static result_t AggregateUseM$Agg$init(uint8_t arg_0xa9500a0, char *arg_0xa951f28, ParamList *arg_0xa982098, ParamVals *arg_0xa982200, bool arg_0xa982348){ #line 87 unsigned char result; #line 87 #line 87 switch (arg_0xa9500a0) { #line 87 case kSUM: #line 87 result = SumM$Aggregate$init(arg_0xa951f28, arg_0xa982098, arg_0xa982200, arg_0xa982348); #line 87 break; #line 87 case kMIN: #line 87 result = MinM$Aggregate$init(arg_0xa951f28, arg_0xa982098, arg_0xa982200, arg_0xa982348); #line 87 break; #line 87 case kMAX: #line 87 result = MaxM$Aggregate$init(arg_0xa951f28, arg_0xa982098, arg_0xa982200, arg_0xa982348); #line 87 break; #line 87 case kCOUNT: #line 87 result = CountM$Aggregate$init(arg_0xa951f28, arg_0xa982098, arg_0xa982200, arg_0xa982348); #line 87 break; #line 87 case kAVG: #line 87 result = AvgM$Aggregate$init(arg_0xa951f28, arg_0xa982098, arg_0xa982200, arg_0xa982348); #line 87 break; #line 87 case kEXP_AVG: #line 87 result = ExpAvgM$Aggregate$init(arg_0xa951f28, arg_0xa982098, arg_0xa982200, arg_0xa982348); #line 87 break; #line 87 case kWIN_AVG: #line 87 result = WinAvgM$Aggregate$init(arg_0xa951f28, arg_0xa982098, arg_0xa982200, arg_0xa982348); #line 87 break; #line 87 case kWIN_SUM: #line 87 result = WinSumM$Aggregate$init(arg_0xa951f28, arg_0xa982098, arg_0xa982200, arg_0xa982348); #line 87 break; #line 87 case kWIN_MIN: #line 87 result = WinMinM$Aggregate$init(arg_0xa951f28, arg_0xa982098, arg_0xa982200, arg_0xa982348); #line 87 break; #line 87 case kWIN_MAX: #line 87 result = WinMaxM$Aggregate$init(arg_0xa951f28, arg_0xa982098, arg_0xa982200, arg_0xa982348); #line 87 break; #line 87 case kWIN_COUNT: #line 87 result = WinCountM$Aggregate$init(arg_0xa951f28, arg_0xa982098, arg_0xa982200, arg_0xa982348); #line 87 break; #line 87 default: #line 87 result = AggregateUseM$Agg$default$init(arg_0xa9500a0, arg_0xa951f28, arg_0xa982098, arg_0xa982200, arg_0xa982348); #line 87 } #line 87 #line 87 return result; #line 87 } #line 87 static inline # 31 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AggregateUseM.nc" result_t AggregateUseM$AggregateUse$init(uint8_t id, char *data, ParamList *params, ParamVals *paramValues, bool isFirstTime) #line 31 { return AggregateUseM$Agg$init(id, data, params, paramValues, isFirstTime); } # 87 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AggregateUse.nc" inline static result_t AggOperator$AggregateUse$init(uint8_t arg_0xa928da0, char *arg_0xa928ef0, ParamList *arg_0xa929050, ParamVals *arg_0xa9291b8, bool arg_0xa929300){ #line 87 unsigned char result; #line 87 #line 87 result = AggregateUseM$AggregateUse$init(arg_0xa928da0, arg_0xa928ef0, arg_0xa929050, arg_0xa9291b8, arg_0xa929300); #line 87 #line 87 return result; #line 87 } #line 87 # 101 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQueryIntf.nc" inline static short DBBufferC$ParsedQueryIntf$pqSize(ParsedQueryPtr arg_0xa5f7da8){ #line 101 short result; #line 101 #line 101 result = ParsedQuery$ParsedQueryIntf$pqSize(arg_0xa5f7da8); #line 101 #line 101 return result; #line 101 } #line 101 # 128 "d:/tinyos-1.x/tos/interfaces/MemAlloc.nc" inline static int16_t DBBufferC$MemAlloc$free(Handle arg_0xa6093b0){ #line 128 int result; #line 128 #line 128 result = TinyAlloc$MemAlloc$free(arg_0xa6093b0); #line 128 #line 128 return result; #line 128 } #line 128 static inline # 617 "d:/tinyos-1.x/tos/lib/TinyAlloc.nc" int8_t TinyAlloc$isValid(Handle h) #line 617 { if (sizeof(int8_t *) == sizeof(int32_t )) { return *h >= (int8_t *)(&TinyAlloc$mFrame)[0] && *h < (int8_t *)&TinyAlloc$mFrame[TinyAlloc$FRAME_SIZE]; } else { #line 622 if (sizeof(int8_t *) == sizeof(int16_t )) { return *h >= (int8_t *)(&TinyAlloc$mFrame)[0] && *h < (int8_t *)&TinyAlloc$mFrame[TinyAlloc$FRAME_SIZE]; } else { return 0; } } } static inline # 314 "d:/tinyos-1.x/tos/lib/TinyDB/Tuple.nc" result_t Tuple$DBBuffer$allocComplete(uint8_t bufferId, TinyDBError result) #line 314 { return SUCCESS; } static inline # 407 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQuery.nc" result_t ParsedQuery$DBBuffer$allocComplete(uint8_t bufferId, TinyDBError result) #line 407 { return SUCCESS; } static inline # 394 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$UNSET_PARSING_QUERY(void) #line 394 { #line 394 TupleRouterM$mPendingMask &= TupleRouterM$PARSING_BIT ^ 0xFFFF; } static inline #line 390 void TupleRouterM$UNSET_READING_QUERY(void) #line 390 { #line 390 TupleRouterM$mPendingMask &= TupleRouterM$READING_BIT ^ 0xFFFF; } static inline #line 1172 void TupleRouterM$failedOpeningWriteBuffer(ParsedQuery *pq) #line 1172 { TupleRouterM$mQidToRemove = pq->qid; TupleRouterM$mForceRemove = TRUE; TOS_post(TupleRouterM$removeQueryTask); TupleRouterM$UNSET_READING_QUERY(); TupleRouterM$UNSET_PARSING_QUERY(); } static inline #line 3422 result_t TupleRouterM$DBBuffer$allocComplete(uint8_t bufferId, TinyDBError result) #line 3422 { if (result != err_NoError) { TupleRouterM$failedOpeningWriteBuffer(TupleRouterM$mTempPQ); } else { TupleRouterM$finishedOpeningWriteBuffer(TupleRouterM$mTempPQ); } return SUCCESS; } # 217 "d:/tinyos-1.x/tos/lib/TinyDB/DBBuffer.nc" inline static result_t DBBufferC$DBBuffer$allocComplete(uint8_t arg_0xa63f468, TinyDBError arg_0xa63f5b0){ #line 217 unsigned char result; #line 217 #line 217 result = TupleRouterM$DBBuffer$allocComplete(arg_0xa63f468, arg_0xa63f5b0); #line 217 result = ParsedQuery$DBBuffer$allocComplete(arg_0xa63f468, arg_0xa63f5b0); #line 217 result = Tuple$DBBuffer$allocComplete(arg_0xa63f468, arg_0xa63f5b0); #line 217 #line 217 return result; #line 217 } #line 217 static inline # 438 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$UNSET_SNOOZING(void) #line 438 { #line 438 TupleRouterM$mPendingMask &= TupleRouterM$SNOOZING_BIT ^ 0xFFFF; } static inline # 216 "d:/tinyos-1.x/tos/lib/ServiceSchedulerM.nc" result_t ServiceSchedulerM$ServiceScheduler$remove(uint8_t svc_id) #line 216 { result_t res = pqueue_remove((pqueue_t *)&ServiceSchedulerM$event_q, svc_id); #line 218 ServiceSchedulerM$Services$stop(svc_id); ServiceSchedulerM$sched_info[svc_id].flags = DISABLED; return res; } # 61 "d:/tinyos-1.x/tos/interfaces/ServiceScheduler.nc" inline static result_t TupleRouterM$ServiceScheduler$remove(uint8_t arg_0xa621e00){ #line 61 unsigned char result; #line 61 #line 61 result = ServiceSchedulerM$ServiceScheduler$remove(arg_0xa621e00); #line 61 #line 61 return result; #line 61 } #line 61 # 99 "d:/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t TupleRouterM$Leds$redOff(void){ #line 99 unsigned char result; #line 99 #line 99 result = LedsC$Leds$redOff(); #line 99 #line 99 return result; #line 99 } #line 99 #line 149 inline static result_t TupleRouterM$Leds$yellowOff(void){ #line 149 unsigned char result; #line 149 #line 149 result = LedsC$Leds$yellowOff(); #line 149 #line 149 return result; #line 149 } #line 149 #line 124 inline static result_t TupleRouterM$Leds$greenOff(void){ #line 124 unsigned char result; #line 124 #line 124 result = LedsC$Leds$greenOff(); #line 124 #line 124 return result; #line 124 } #line 124 static inline # 298 "d:/tinyos-1.x/tos/lib/TinyDB/Tuple.nc" result_t Tuple$QueryProcessor$queryComplete(ParsedQueryPtr q) #line 298 { return SUCCESS; } static inline # 2338 "d:/tinyos-1.x/tos/lib/TinyDB/DBBufferC.nc" result_t DBBufferC$QueryProcessor$queryComplete(ParsedQueryPtr q) #line 2338 { uint8_t bufid; if (DBBufferC$DBBuffer$getBufferId(q->qid, FALSE, &bufid) == err_NoError) { DBBufferC$cleanupBuffer(bufid, 2342); } else #line 2343 { } #line 2378 return SUCCESS; } static inline # 1245 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkM.nc" result_t NetworkM$QueryProcessor$queryComplete(ParsedQueryPtr q) #line 1245 { return SUCCESS; } # 128 "d:/tinyos-1.x/tos/interfaces/MemAlloc.nc" inline static int16_t AggOperator$MemAlloc$free(Handle arg_0xa6093b0){ #line 128 int result; #line 128 #line 128 result = TinyAlloc$MemAlloc$free(arg_0xa6093b0); #line 128 #line 128 return result; #line 128 } #line 128 # 81 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQueryIntf.nc" inline static Expr AggOperator$ParsedQueryIntf$getExpr(ParsedQueryPtr arg_0xa601da8, uint8_t arg_0xa601ee8){ #line 81 struct __nesc_unnamed4288 result; #line 81 #line 81 result = ParsedQuery$ParsedQueryIntf$getExpr(arg_0xa601da8, arg_0xa601ee8); #line 81 #line 81 return result; #line 81 } #line 81 static inline # 331 "d:/tinyos-1.x/tos/lib/TinyDB/AggOperator.nc" result_t AggOperator$QueryProcessor$queryComplete(ParsedQuery *q) #line 331 { short i; for (i = 0; i < q->numExprs; i++) { Expr e = AggOperator$ParsedQueryIntf$getExpr(q, i); #line 336 if (e.opType != kSEL && e.opState != (void *)0) { AggOperator$MemAlloc$free((Handle )e.opState); { } #line 338 ; e.opState = (OperatorStateHandle )AggOperator$QUERY_DONE_STATE; } } return SUCCESS; } static inline # 302 "d:/tinyos-1.x/tos/lib/TinyDB/TinyDBAttrM.nc" result_t TinyDBAttrM$QueryProcessor$queryComplete(ParsedQueryPtr q) { return SUCCESS; } # 81 "d:/tinyos-1.x/tos/lib/TinyDB/QueryProcessor.nc" inline static result_t TupleRouterM$QueryProcessor$queryComplete(ParsedQueryPtr arg_0xa30f3e0){ #line 81 unsigned char result; #line 81 #line 81 result = TinyDBAttrM$QueryProcessor$queryComplete(arg_0xa30f3e0); #line 81 result = rcombine(result, AggOperator$QueryProcessor$queryComplete(arg_0xa30f3e0)); #line 81 result = rcombine(result, NetworkM$QueryProcessor$queryComplete(arg_0xa30f3e0)); #line 81 result = rcombine(result, DBBufferC$QueryProcessor$queryComplete(arg_0xa30f3e0)); #line 81 result = rcombine(result, Tuple$QueryProcessor$queryComplete(arg_0xa30f3e0)); #line 81 #line 81 return result; #line 81 } #line 81 static inline # 342 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQuery.nc" bool ParsedQuery$ParsedQueryIntf$typeCheck(ParsedQuery *dest, ParsedQuery *select) #line 342 { int i; uint8_t selType; #line 344 uint8_t destType; if ((dest->bufferType != kRAM && dest->bufferType != kEEPROM) || dest->buf.ram.create != 1) { return FALSE; } if (dest->numFields != select->numFields) { return FALSE; } for (i = 0; i < dest->numFields; i++) { if (ParsedQuery$ParsedQueryIntf$getFieldType(select, i, &selType) == FAIL) { return FALSE; } if (ParsedQuery$ParsedQueryIntf$getFieldType(dest, i, &destType) == FAIL) { return FALSE; } if (selType != destType) { return FALSE; } } return TRUE; } # 140 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQueryIntf.nc" inline static bool TupleRouterM$ParsedQueryIntf$typeCheck(ParsedQuery *arg_0xa613b80, ParsedQuery *arg_0xa613ce0){ #line 140 unsigned char result; #line 140 #line 140 result = ParsedQuery$ParsedQueryIntf$typeCheck(arg_0xa613b80, arg_0xa613ce0); #line 140 #line 140 return result; #line 140 } #line 140 # 72 "d:/tinyos-1.x/tos/lib/TinyDB/Table.nc" inline static result_t ParsedQuery$Table$getType(ParsedQuery *arg_0xa63a178, uint8_t arg_0xa63a2c0, uint8_t *arg_0xa63a418){ #line 72 unsigned char result; #line 72 #line 72 result = TableM$Table$getType(arg_0xa63a178, arg_0xa63a2c0, arg_0xa63a418); #line 72 #line 72 return result; #line 72 } #line 72 # 181 "d:/tinyos-1.x/tos/lib/TinyDB/DBBuffer.nc" inline static TinyDBError ParsedQuery$DBBuffer$getBufferId(uint8_t arg_0xa641038, bool arg_0xa641180, uint8_t *arg_0xa6412e0){ #line 181 enum __nesc_unnamed4265 result; #line 181 #line 181 result = DBBufferC$DBBuffer$getBufferId(arg_0xa641038, arg_0xa641180, arg_0xa6412e0); #line 181 #line 181 return result; #line 181 } #line 181 #line 165 inline static ParsedQuery **ParsedQuery$DBBuffer$getSchema(uint8_t arg_0xa640718){ #line 165 struct __nesc_unnamed4276 **result; #line 165 #line 165 result = DBBufferC$DBBuffer$getSchema(arg_0xa640718); #line 165 #line 165 return result; #line 165 } #line 165 # 72 "d:/tinyos-1.x/tos/interfaces/AttrUse.nc" inline static AttrDescPtr ParsedQuery$AttrUse$getAttrById(uint8_t arg_0xa5e4d58){ #line 72 struct __nesc_unnamed4260 *result; #line 72 #line 72 result = Attr$AttrUse$getAttrById(arg_0xa5e4d58); #line 72 #line 72 return result; #line 72 } #line 72 # 165 "d:/tinyos-1.x/tos/lib/TinyDB/DBBuffer.nc" inline static ParsedQuery **TupleRouterM$DBBuffer$getSchema(uint8_t arg_0xa640718){ #line 165 struct __nesc_unnamed4276 **result; #line 165 #line 165 result = DBBufferC$DBBuffer$getSchema(arg_0xa640718); #line 165 #line 165 return result; #line 165 } #line 165 static inline # 294 "d:/tinyos-1.x/tos/lib/TinyDB/Tuple.nc" result_t Tuple$AttrUse$startAttrDone(uint8_t id) #line 294 { return SUCCESS; } static inline # 2389 "d:/tinyos-1.x/tos/lib/TinyDB/DBBufferC.nc" result_t DBBufferC$AttrUse$startAttrDone(uint8_t id) #line 2389 { return SUCCESS; } static inline # 383 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQuery.nc" result_t ParsedQuery$AttrUse$startAttrDone(uint8_t id) #line 383 { return SUCCESS; } static inline # 3520 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" result_t TupleRouterM$AttrUse$startAttrDone(uint8_t id) { TupleRouterM$mNumAttrs--; if (TupleRouterM$mNumAttrs == 0) { TupleRouterM$UNSET_STARTING_ATTRIBUTE(); } #line 3525 return SUCCESS; } # 113 "d:/tinyos-1.x/tos/interfaces/AttrUse.nc" inline static result_t Attr$AttrUse$startAttrDone(uint8_t arg_0xa5e3448){ #line 113 unsigned char result; #line 113 #line 113 result = TupleRouterM$AttrUse$startAttrDone(arg_0xa5e3448); #line 113 result = rcombine(result, ParsedQuery$AttrUse$startAttrDone(arg_0xa5e3448)); #line 113 result = rcombine(result, DBBufferC$AttrUse$startAttrDone(arg_0xa5e3448)); #line 113 result = rcombine(result, Tuple$AttrUse$startAttrDone(arg_0xa5e3448)); #line 113 #line 113 return result; #line 113 } #line 113 static inline # 265 "d:/tinyos-1.x/tos/lib/Attr.nc" result_t Attr$Attr$startAttrDone(uint8_t id) { Attr$AttrUse$startAttrDone(id); return SUCCESS; } # 100 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t TinyDBAttrM$QualityAttr$startAttrDone(void){ #line 100 unsigned char result; #line 100 #line 100 result = Attr$Attr$startAttrDone(6); #line 100 #line 100 return result; #line 100 } #line 100 static inline # 215 "d:/tinyos-1.x/tos/lib/TinyDB/TinyDBAttrM.nc" result_t TinyDBAttrM$QualityAttr$startAttr(void) { return TinyDBAttrM$QualityAttr$startAttrDone(); } # 100 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t TinyDBAttrM$QidAttr$startAttrDone(void){ #line 100 unsigned char result; #line 100 #line 100 result = Attr$Attr$startAttrDone(5); #line 100 #line 100 return result; #line 100 } #line 100 static inline # 275 "d:/tinyos-1.x/tos/lib/TinyDB/TinyDBAttrM.nc" result_t TinyDBAttrM$QidAttr$startAttr(void) { return TinyDBAttrM$QidAttr$startAttrDone(); } # 100 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t TinyDBAttrM$DepthAttr$startAttrDone(void){ #line 100 unsigned char result; #line 100 #line 100 result = Attr$Attr$startAttrDone(4); #line 100 #line 100 return result; #line 100 } #line 100 static inline # 255 "d:/tinyos-1.x/tos/lib/TinyDB/TinyDBAttrM.nc" result_t TinyDBAttrM$DepthAttr$startAttr(void) { return TinyDBAttrM$DepthAttr$startAttrDone(); } # 100 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t TinyDBAttrM$MHQueueLenAttr$startAttrDone(void){ #line 100 unsigned char result; #line 100 #line 100 result = Attr$Attr$startAttrDone(3); #line 100 #line 100 return result; #line 100 } #line 100 static inline # 235 "d:/tinyos-1.x/tos/lib/TinyDB/TinyDBAttrM.nc" result_t TinyDBAttrM$MHQueueLenAttr$startAttr(void) { return TinyDBAttrM$MHQueueLenAttr$startAttrDone(); } # 100 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t TinyDBAttrM$QueueLenAttr$startAttrDone(void){ #line 100 unsigned char result; #line 100 #line 100 result = Attr$Attr$startAttrDone(2); #line 100 #line 100 return result; #line 100 } #line 100 static inline # 179 "d:/tinyos-1.x/tos/lib/TinyDB/TinyDBAttrM.nc" result_t TinyDBAttrM$QueueLenAttr$startAttr(void) { return TinyDBAttrM$QueueLenAttr$startAttrDone(); } # 100 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t TinyDBAttrM$FreeSpaceAttr$startAttrDone(void){ #line 100 unsigned char result; #line 100 #line 100 result = Attr$Attr$startAttrDone(1); #line 100 #line 100 return result; #line 100 } #line 100 static inline # 147 "d:/tinyos-1.x/tos/lib/TinyDB/TinyDBAttrM.nc" result_t TinyDBAttrM$FreeSpaceAttr$startAttr(void) { return TinyDBAttrM$FreeSpaceAttr$startAttrDone(); } # 100 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t TinyDBAttrM$ParentAttr$startAttrDone(void){ #line 100 unsigned char result; #line 100 #line 100 result = Attr$Attr$startAttrDone(0); #line 100 #line 100 return result; #line 100 } #line 100 static inline # 111 "d:/tinyos-1.x/tos/lib/TinyDB/TinyDBAttrM.nc" result_t TinyDBAttrM$ParentAttr$startAttr(void) { return TinyDBAttrM$ParentAttr$startAttrDone(); } # 100 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t AttrPotM$AttrRegister$startAttrDone(void){ #line 100 unsigned char result; #line 100 #line 100 result = Attr$Attr$startAttrDone(7); #line 100 #line 100 return result; #line 100 } #line 100 static inline # 76 "d:/tinyos-1.x/tos/lib/Attributes/AttrPotM.nc" result_t AttrPotM$AttrRegister$startAttr(void) { return AttrPotM$AttrRegister$startAttrDone(); } # 100 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t AttrGlobalM$GroupAttr$startAttrDone(void){ #line 100 unsigned char result; #line 100 #line 100 result = Attr$Attr$startAttrDone(9); #line 100 #line 100 return result; #line 100 } #line 100 static inline # 95 "d:/tinyos-1.x/tos/lib/Attributes/AttrGlobalM.nc" result_t AttrGlobalM$GroupAttr$startAttr(void) { return AttrGlobalM$GroupAttr$startAttrDone(); } # 100 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t AttrGlobalM$NodeIdAttr$startAttrDone(void){ #line 100 unsigned char result; #line 100 #line 100 result = Attr$Attr$startAttrDone(8); #line 100 #line 100 return result; #line 100 } #line 100 static inline # 77 "d:/tinyos-1.x/tos/lib/Attributes/AttrGlobalM.nc" result_t AttrGlobalM$NodeIdAttr$startAttr(void) { return AttrGlobalM$NodeIdAttr$startAttrDone(); } # 100 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t AttrTimeM$TimeHighAttr$startAttrDone(void){ #line 100 unsigned char result; #line 100 #line 100 result = Attr$Attr$startAttrDone(11); #line 100 #line 100 return result; #line 100 } #line 100 static inline # 93 "d:/tinyos-1.x/tos/lib/Attributes/AttrTimeM.nc" result_t AttrTimeM$TimeHighAttr$startAttr(void) { return AttrTimeM$TimeHighAttr$startAttrDone(); } # 100 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t AttrTimeM$TimeLowAttr$startAttrDone(void){ #line 100 unsigned char result; #line 100 #line 100 result = Attr$Attr$startAttrDone(10); #line 100 #line 100 return result; #line 100 } #line 100 static inline # 76 "d:/tinyos-1.x/tos/lib/Attributes/AttrTimeM.nc" result_t AttrTimeM$TimeLowAttr$startAttr(void) { return AttrTimeM$TimeLowAttr$startAttrDone(); } # 100 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t AttrVoltageM$AttrRegister$startAttrDone(void){ #line 100 unsigned char result; #line 100 #line 100 result = Attr$Attr$startAttrDone(12); #line 100 #line 100 return result; #line 100 } #line 100 static inline # 77 "d:/tinyos-1.x/tos/lib/Attributes/AttrVoltageM.nc" result_t AttrVoltageM$AttrRegister$startAttr(void) { return AttrVoltageM$AttrRegister$startAttrDone(); } # 100 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t AttrTempM$AttrRegister$startAttrDone(void){ #line 100 unsigned char result; #line 100 #line 100 result = Attr$Attr$startAttrDone(13); #line 100 #line 100 return result; #line 100 } #line 100 static inline # 80 "d:/tinyos-1.x/tos/lib/Attributes/AttrTempM.nc" result_t AttrTempM$AttrRegister$startAttr(void) { return AttrTempM$AttrRegister$startAttrDone(); } # 100 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t AttrPhotoM$AttrRegister$startAttrDone(void){ #line 100 unsigned char result; #line 100 #line 100 result = Attr$Attr$startAttrDone(14); #line 100 #line 100 return result; #line 100 } #line 100 static inline # 80 "d:/tinyos-1.x/tos/lib/Attributes/AttrPhotoM.nc" result_t AttrPhotoM$AttrRegister$startAttr(void) { return AttrPhotoM$AttrRegister$startAttrDone(); } # 100 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t AttrAccelM$AttrAccelY$startAttrDone(void){ #line 100 unsigned char result; #line 100 #line 100 result = Attr$Attr$startAttrDone(16); #line 100 #line 100 return result; #line 100 } #line 100 static inline # 84 "d:/tinyos-1.x/tos/sensorboards/micasb/AccelM.nc" result_t AccelM$StdControl$start(void) #line 84 { TOSH_SET_ACCEL_CTL_PIN(); return SUCCESS; } # 59 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t AttrAccelM$AccelControl$start(void){ #line 59 unsigned char result; #line 59 #line 59 result = AccelM$StdControl$start(); #line 59 #line 59 return result; #line 59 } #line 59 static inline # 112 "d:/tinyos-1.x/tos/lib/Attributes/AttrAccelM.nc" result_t AttrAccelM$AttrAccelY$startAttr(void) { result_t res = AttrAccelM$AccelControl$start(); #line 115 AttrAccelM$AttrAccelY$startAttrDone(); return res; } # 100 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t AttrAccelM$AttrAccelX$startAttrDone(void){ #line 100 unsigned char result; #line 100 #line 100 result = Attr$Attr$startAttrDone(15); #line 100 #line 100 return result; #line 100 } #line 100 static inline # 83 "d:/tinyos-1.x/tos/lib/Attributes/AttrAccelM.nc" result_t AttrAccelM$AttrAccelX$startAttr(void) { result_t res = AttrAccelM$AccelControl$start(); #line 86 AttrAccelM$AttrAccelX$startAttrDone(); return res; } # 100 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t AttrMicM$AttrTones$startAttrDone(void){ #line 100 unsigned char result; #line 100 #line 100 result = Attr$Attr$startAttrDone(18); #line 100 #line 100 return result; #line 100 } #line 100 # 90 "d:/tinyos-1.x/tos/interfaces/Timer.nc" inline static result_t AttrMicM$ToneDetectTimer$start(char arg_0xa3f1240, uint32_t arg_0xa3f1390){ #line 90 unsigned char result; #line 90 #line 90 result = LogicalTimeM$Timer$start(4, arg_0xa3f1240, arg_0xa3f1390); #line 90 #line 90 return result; #line 90 } #line 90 static inline # 164 "d:/tinyos-1.x/tos/lib/Attributes/AttrMicM.nc" void AttrMicM$toneDetectStart(void) { AttrMicM$tones = 0; AttrMicM$toneDetectRunning = TRUE; AttrMicM$ToneDetectTimer$start(TIMER_REPEAT, 32); } static inline result_t AttrMicM$AttrTones$startAttr(void) { if (!AttrMicM$toneDetectRunning) { AttrMicM$toneDetectStart(); } #line 181 return AttrMicM$AttrTones$startAttrDone(); } # 100 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t AttrMicM$AttrNoise$startAttrDone(void){ #line 100 unsigned char result; #line 100 #line 100 result = Attr$Attr$startAttrDone(17); #line 100 #line 100 return result; #line 100 } #line 100 # 90 "d:/tinyos-1.x/tos/interfaces/Timer.nc" inline static result_t AttrMicM$NoiseSampleTimer$start(char arg_0xa3f1240, uint32_t arg_0xa3f1390){ #line 90 unsigned char result; #line 90 #line 90 result = LogicalTimeM$Timer$start(3, arg_0xa3f1240, arg_0xa3f1390); #line 90 #line 90 return result; #line 90 } #line 90 static inline # 116 "d:/tinyos-1.x/tos/lib/Attributes/AttrMicM.nc" void AttrMicM$startNoiseSample(void) { AttrMicM$noiseSampleRunning = TRUE; AttrMicM$NoiseSampleTimer$start(TIMER_REPEAT, 32); } static inline result_t AttrMicM$AttrNoise$startAttr(void) { if (!AttrMicM$noiseSampleRunning) { AttrMicM$startNoiseSample(); } #line 134 return AttrMicM$AttrNoise$startAttrDone(); } static inline # 279 "d:/tinyos-1.x/tos/lib/Attr.nc" result_t Attr$Attr$default$startAttr(uint8_t id) #line 279 { return SUCCESS; } # 96 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t Attr$Attr$startAttr(uint8_t arg_0xa7eac68){ #line 96 unsigned char result; #line 96 #line 96 switch (arg_0xa7eac68) { #line 96 case 0: #line 96 result = TinyDBAttrM$ParentAttr$startAttr(); #line 96 break; #line 96 case 1: #line 96 result = TinyDBAttrM$FreeSpaceAttr$startAttr(); #line 96 break; #line 96 case 2: #line 96 result = TinyDBAttrM$QueueLenAttr$startAttr(); #line 96 break; #line 96 case 3: #line 96 result = TinyDBAttrM$MHQueueLenAttr$startAttr(); #line 96 break; #line 96 case 4: #line 96 result = TinyDBAttrM$DepthAttr$startAttr(); #line 96 break; #line 96 case 5: #line 96 result = TinyDBAttrM$QidAttr$startAttr(); #line 96 break; #line 96 case 6: #line 96 result = TinyDBAttrM$QualityAttr$startAttr(); #line 96 break; #line 96 case 7: #line 96 result = AttrPotM$AttrRegister$startAttr(); #line 96 break; #line 96 case 8: #line 96 result = AttrGlobalM$NodeIdAttr$startAttr(); #line 96 break; #line 96 case 9: #line 96 result = AttrGlobalM$GroupAttr$startAttr(); #line 96 break; #line 96 case 10: #line 96 result = AttrTimeM$TimeLowAttr$startAttr(); #line 96 break; #line 96 case 11: #line 96 result = AttrTimeM$TimeHighAttr$startAttr(); #line 96 break; #line 96 case 12: #line 96 result = AttrVoltageM$AttrRegister$startAttr(); #line 96 break; #line 96 case 13: #line 96 result = AttrTempM$AttrRegister$startAttr(); #line 96 break; #line 96 case 14: #line 96 result = AttrPhotoM$AttrRegister$startAttr(); #line 96 break; #line 96 case 15: #line 96 result = AttrAccelM$AttrAccelX$startAttr(); #line 96 break; #line 96 case 16: #line 96 result = AttrAccelM$AttrAccelY$startAttr(); #line 96 break; #line 96 case 17: #line 96 result = AttrMicM$AttrNoise$startAttr(); #line 96 break; #line 96 case 18: #line 96 result = AttrMicM$AttrTones$startAttr(); #line 96 break; #line 96 default: #line 96 result = Attr$Attr$default$startAttr(arg_0xa7eac68); #line 96 } #line 96 #line 96 return result; #line 96 } #line 96 static inline # 185 "d:/tinyos-1.x/tos/lib/Attr.nc" result_t Attr$AttrUse$startAttr(uint8_t id) { if (id >= Attr$attrDescs.numAttrs) { return FAIL; } #line 189 if (Attr$Attr$startAttr(id) != SUCCESS) { return FAIL; } #line 191 return SUCCESS; } # 108 "d:/tinyos-1.x/tos/interfaces/AttrUse.nc" inline static result_t TupleRouterM$AttrUse$startAttr(uint8_t arg_0xa5e2ff0){ #line 108 unsigned char result; #line 108 #line 108 result = Attr$AttrUse$startAttr(arg_0xa5e2ff0); #line 108 #line 108 return result; #line 108 } #line 108 static inline # 157 "d:/tinyos-1.x/tos/platform/mica/HPLClock.nc" uint8_t HPLClock$Clock$readCounter(void) #line 157 { return * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x32 + 0x20); } # 179 "d:/tinyos-1.x/tos/interfaces/Clock.nc" inline static uint8_t LogicalTimeM$Clock$readCounter(void){ #line 179 unsigned char result; #line 179 #line 179 result = HPLClock$Clock$readCounter(); #line 179 #line 179 return result; #line 179 } #line 179 # 70 "d:/tinyos-1.x/tos/interfaces/TimeUtil.nc" inline static tos_time_t LogicalTimeM$TimeUtil$addUint32(tos_time_t arg_0xa4fa690, uint32_t arg_0xa4fa7d8){ #line 70 struct __nesc_unnamed4317 result; #line 70 #line 70 result = TimeUtilC$TimeUtil$addUint32(arg_0xa4fa690, arg_0xa4fa7d8); #line 70 #line 70 return result; #line 70 } #line 70 static inline # 131 "d:/tinyos-1.x/tos/system/LogicalTimeM.nc" tos_time_t LogicalTimeM$Time$get(void) #line 131 { tos_time_t rval; #line 133 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 133 { rval = LogicalTimeM$TimeUtil$addUint32(LogicalTimeM$time, LogicalTimeM$Clock$readCounter()); } #line 135 __nesc_atomic_end(__nesc_atomic); } return rval; } # 51 "d:/tinyos-1.x/tos/interfaces/Time.nc" inline static tos_time_t TupleRouterM$Time$get(void){ #line 51 struct __nesc_unnamed4317 result; #line 51 #line 51 result = LogicalTimeM$Time$get(); #line 51 #line 51 return result; #line 51 } #line 51 # 86 "d:/tinyos-1.x/tos/interfaces/Interrupt.nc" inline static result_t TupleRouterM$Interrupt$enable(void){ #line 86 unsigned char result; #line 86 #line 86 result = HPLInterrupt$Interrupt$enable(); #line 86 #line 86 return result; #line 86 } #line 86 #line 78 inline static bool TupleRouterM$Interrupt$disable(void){ #line 78 unsigned char result; #line 78 #line 78 result = HPLInterrupt$Interrupt$disable(); #line 78 #line 78 return result; #line 78 } #line 78 static inline # 1657 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$setSampleRate(void) #line 1657 { TupleRouterM$QueryListHandle qlh; short rate = -1; bool prevInt; #line 1684 rate = TupleRouterM$kMS_PER_CLOCK_EVENT; qlh = TupleRouterM$mQs; if ((qlh != (void *)0 && (*qlh)->next == (void *)0) || ( qlh != (void *)0 && TupleRouterM$mAllQueriesSameRate && (* (TupleRouterM$QueryListHandle )(*qlh)->next)->q.epochDuration == (*qlh)->q.epochDuration)) { TupleRouterM$mAllQueriesSameRate = TRUE; } else { #line 1696 TupleRouterM$mAllQueriesSameRate = FALSE; } while (qlh != (void *)0) { if ((*qlh)->q.epochDuration == kONE_SHOT) { (*qlh)->q.clocksPerSample = 16; (*qlh)->q.curResult = 0; } else { ( #line 1704 *qlh)->q.clocksPerSample = (*qlh)->q.epochDuration / rate; } prevInt = TupleRouterM$Interrupt$disable(); if (TupleRouterM$mQueryClockCount != 0) { (*qlh)->q.clockCount = TupleRouterM$mQueryClockCount; TupleRouterM$mQueryClockCount = 0; } else #line 1711 { (*qlh)->q.clockCount = (*qlh)->q.clocksPerSample; } if (prevInt) { #line 1714 TupleRouterM$Interrupt$enable(); } qlh = (TupleRouterM$QueryListHandle )(*qlh)->next; } if (rate != TupleRouterM$mOldRate) { tos_time_t cur_time = TupleRouterM$Time$get(); uint32_t distFromPrev; TupleRouterM$mOldRate = rate; TupleRouterM$mIsRunning = TRUE; TupleRouterM$AbsoluteTimer$fired(); } } # 169 "d:/tinyos-1.x/tos/lib/TinyAlloc.nc" static __inline int8_t *TinyAlloc$deref(Handle h) #line 169 { #line 169 return (int8_t *)*h; } static inline #line 573 result_t TinyAlloc$MemAlloc$lock(Handle handle) #line 573 { int8_t *ptr = TinyAlloc$deref(handle); ( #line 576 (int16_t *)(ptr - TinyAlloc$HEADER_SIZE))[0] |= 0x8000; return SUCCESS; } # 108 "d:/tinyos-1.x/tos/interfaces/MemAlloc.nc" inline static result_t DBBufferC$MemAlloc$lock(Handle arg_0xa608a00){ #line 108 unsigned char result; #line 108 #line 108 result = TinyAlloc$MemAlloc$lock(arg_0xa608a00); #line 108 #line 108 return result; #line 108 } #line 108 # 135 "d:/tinyos-1.x/tos/lib/TinyDB/QueryResultIntf.nc" inline static TinyDBError DBBufferC$QueryResultIntf$toBytes(QueryResultPtr arg_0xa62b368, ParsedQueryPtr arg_0xa62b4b0, CharPtr arg_0xa62b5f0){ #line 135 enum __nesc_unnamed4265 result; #line 135 #line 135 result = QueryResult$QueryResultIntf$toBytes(arg_0xa62b368, arg_0xa62b4b0, arg_0xa62b5f0); #line 135 #line 135 return result; #line 135 } #line 135 # 146 "d:/tinyos-1.x/tos/interfaces/MemAlloc.nc" inline static int16_t DBBufferC$MemAlloc$size(Handle arg_0xa609bd0){ #line 146 int result; #line 146 #line 146 result = TinyAlloc$MemAlloc$size(arg_0xa609bd0); #line 146 #line 146 return result; #line 146 } #line 146 static inline # 581 "d:/tinyos-1.x/tos/lib/TinyAlloc.nc" result_t TinyAlloc$MemAlloc$unlock(Handle handle) #line 581 { int8_t *ptr = TinyAlloc$deref(handle); ( #line 584 (int16_t *)(ptr - TinyAlloc$HEADER_SIZE))[0] &= 0x7FFF; return SUCCESS; } # 118 "d:/tinyos-1.x/tos/interfaces/MemAlloc.nc" inline static result_t DBBufferC$MemAlloc$unlock(Handle arg_0xa608ef0){ #line 118 unsigned char result; #line 118 #line 118 result = TinyAlloc$MemAlloc$unlock(arg_0xa608ef0); #line 118 #line 118 return result; #line 118 } #line 118 static inline # 324 "d:/tinyos-1.x/tos/lib/TinyDB/Tuple.nc" result_t Tuple$DBBuffer$putComplete(uint8_t bufferId, QueryResult *buf, TinyDBError err) #line 324 { return SUCCESS; } static inline # 417 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQuery.nc" result_t ParsedQuery$DBBuffer$putComplete(uint8_t bufferId, QueryResult *buf, TinyDBError err) #line 417 { return SUCCESS; } static inline # 3453 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" result_t TupleRouterM$DBBuffer$putComplete(uint8_t bufferId, QueryResult *buf, TinyDBError err) #line 3453 { TOS_post(TupleRouterM$deliverTuplesTask); return SUCCESS; } # 223 "d:/tinyos-1.x/tos/lib/TinyDB/DBBuffer.nc" inline static result_t DBBufferC$DBBuffer$putComplete(uint8_t arg_0xa61c0f0, QueryResult *arg_0xa61c250, TinyDBError arg_0xa61c398){ #line 223 unsigned char result; #line 223 #line 223 result = TupleRouterM$DBBuffer$putComplete(arg_0xa61c0f0, arg_0xa61c250, arg_0xa61c398); #line 223 result = ParsedQuery$DBBuffer$putComplete(arg_0xa61c0f0, arg_0xa61c250, arg_0xa61c398); #line 223 result = Tuple$DBBuffer$putComplete(arg_0xa61c0f0, arg_0xa61c250, arg_0xa61c398); #line 223 #line 223 return result; #line 223 } #line 223 static inline # 152 "d:/tinyos-1.x/tos/system/tos.h" void *nmemset(void *to, int val, size_t n) { char *cto = to; while (n--) * cto++ = val; return to; } static inline # 319 "d:/tinyos-1.x/tos/lib/TinyDB/Tuple.nc" result_t Tuple$DBBuffer$getComplete(uint8_t bufferId, QueryResult *buf, TinyDBError result) #line 319 { return SUCCESS; } static inline # 412 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQuery.nc" result_t ParsedQuery$DBBuffer$getComplete(uint8_t bufferId, QueryResult *buf, TinyDBError result) #line 412 { return SUCCESS; } static inline # 3439 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" result_t TupleRouterM$DBBuffer$getComplete(uint8_t bufferId, QueryResult *buf, TinyDBError err) #line 3439 { if (err != err_NoError) { TupleRouterM$signalError(err, 3442); } else #line 3443 { } TupleRouterM$fillInAttrVal(SCHEMA_RESULT_READY); return SUCCESS; } # 220 "d:/tinyos-1.x/tos/lib/TinyDB/DBBuffer.nc" inline static result_t DBBufferC$DBBuffer$getComplete(uint8_t arg_0xa63f9f8, QueryResult *arg_0xa63fb58, TinyDBError arg_0xa63fca0){ #line 220 unsigned char result; #line 220 #line 220 result = TupleRouterM$DBBuffer$getComplete(arg_0xa63f9f8, arg_0xa63fb58, arg_0xa63fca0); #line 220 result = rcombine(result, ParsedQuery$DBBuffer$getComplete(arg_0xa63f9f8, arg_0xa63fb58, arg_0xa63fca0)); #line 220 result = rcombine(result, Tuple$DBBuffer$getComplete(arg_0xa63f9f8, arg_0xa63fb58, arg_0xa63fca0)); #line 220 #line 220 return result; #line 220 } #line 220 # 90 "d:/tinyos-1.x/tos/lib/TinyDB/TupleIntf.nc" inline static result_t TupleRouterM$TupleIntf$setField(ParsedQueryPtr arg_0xa605740, TuplePtr arg_0xa605888, uint8_t arg_0xa6059d0, CharPtr arg_0xa605b10){ #line 90 unsigned char result; #line 90 #line 90 result = Tuple$TupleIntf$setField(arg_0xa605740, arg_0xa605888, arg_0xa6059d0, arg_0xa605b10); #line 90 #line 90 return result; #line 90 } #line 90 #line 116 inline static CharPtr TupleRouterM$TupleIntf$getFieldPtr(ParsedQueryPtr arg_0xa5fef10, TuplePtr arg_0xa5ff058, uint8_t arg_0xa5ff1a0){ #line 116 char *result; #line 116 #line 116 result = Tuple$TupleIntf$getFieldPtr(arg_0xa5fef10, arg_0xa5ff058, arg_0xa5ff1a0); #line 116 #line 116 return result; #line 116 } #line 116 static inline # 124 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinAvgM.nc" TinyDBError WinAvgM$Aggregate$finalize(char *data, char *result_buf, ParamList *params, ParamVals *paramValues) #line 124 { WinAvgM$TemporalAverageData *mydata = (WinAvgM$TemporalAverageData *)data; #line 126 * (uint16_t *)result_buf = mydata->lastResult.count == 0 ? 0 : mydata->lastResult.sum / mydata->lastResult.count; return err_NoError; } static inline # 102 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinSumM.nc" TinyDBError WinSumM$Aggregate$finalize(char *data, char *result_buf, ParamList *params, ParamVals *paramValues) #line 102 { TemporalAlgebraicData *mydata = (TemporalAlgebraicData *)data; #line 104 * (int16_t *)result_buf = mydata->lastResult.value; return err_NoError; } static inline # 102 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinCountM.nc" TinyDBError WinCountM$Aggregate$finalize(char *data, char *result_buf, ParamList *params, ParamVals *paramValues) #line 102 { TemporalAlgebraicData *mydata = (TemporalAlgebraicData *)data; #line 104 * (int16_t *)result_buf = mydata->lastResult.value; return err_NoError; } static inline # 112 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinMaxM.nc" TinyDBError WinMaxM$Aggregate$finalize(char *data, char *result_buf, ParamList *params, ParamVals *paramValues) #line 112 { TemporalAlgebraicData *mydata = (TemporalAlgebraicData *)data; #line 114 * (int16_t *)result_buf = mydata->lastResult.value; return err_NoError; } static inline # 112 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinMinM.nc" TinyDBError WinMinM$Aggregate$finalize(char *data, char *result_buf, ParamList *params, ParamVals *paramValues) #line 112 { TemporalAlgebraicData *mydata = (TemporalAlgebraicData *)data; #line 114 * (int16_t *)result_buf = mydata->lastResult.value; return err_NoError; } static inline # 61 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/ExpAvgM.nc" TinyDBError ExpAvgM$Aggregate$finalize(char *data, char *result_buf, ParamList *params, ParamVals *paramValues) #line 61 { ExpAvgM$ExpAvgData *mydata = (ExpAvgM$ExpAvgData *)data; #line 63 * (int16_t *)result_buf = mydata->value; return err_NoError; } static inline # 53 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AvgM.nc" TinyDBError AvgM$Aggregate$finalize(char *data, char *result_buf, ParamList *params, ParamVals *paramValues) #line 53 { AverageData *mydata = (AverageData *)data; * (int16_t *)result_buf = mydata->count == 0 ? 0 : mydata->sum / mydata->count; return err_NoError; } static inline # 52 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/SumM.nc" TinyDBError SumM$Aggregate$finalize(char *data, char *result_buf, ParamList *params, ParamVals *paramValues) #line 52 { AlgebraicData *mydata = (AlgebraicData *)data; #line 54 * (int16_t *)result_buf = mydata->value; return err_NoError; } static inline # 52 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/CountM.nc" TinyDBError CountM$Aggregate$finalize(char *data, char *result_buf, ParamList *params, ParamVals *paramValues) #line 52 { AlgebraicData *mydata = (AlgebraicData *)data; #line 54 * (int16_t *)result_buf = mydata->value; return err_NoError; } static inline # 60 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/MinM.nc" TinyDBError MinM$Aggregate$finalize(char *data, char *result_buf, ParamList *params, ParamVals *paramValues) #line 60 { AlgebraicData *mydata = (AlgebraicData *)data; #line 62 * (int16_t *)result_buf = mydata->value; return err_NoError; } static inline # 60 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/MaxM.nc" TinyDBError MaxM$Aggregate$finalize(char *data, char *result_buf, ParamList *params, ParamVals *paramValues) #line 60 { AlgebraicData *mydata = (AlgebraicData *)data; #line 62 * (int16_t *)result_buf = mydata->value; return err_NoError; } static inline # 79 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AggregateUseM.nc" TinyDBError AggregateUseM$Agg$default$finalize(uint8_t id, char *data, char *result_buf, ParamList *params, ParamVals *paramValues) #line 80 { return err_NoError; } # 92 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/Aggregate.nc" inline static TinyDBError AggregateUseM$Agg$finalize(uint8_t arg_0xa9500a0, char *arg_0xa9827f0, char *arg_0xa982948, ParamList *arg_0xa982aa8, ParamVals *arg_0xa982c10){ #line 92 enum __nesc_unnamed4265 result; #line 92 #line 92 switch (arg_0xa9500a0) { #line 92 case kSUM: #line 92 result = SumM$Aggregate$finalize(arg_0xa9827f0, arg_0xa982948, arg_0xa982aa8, arg_0xa982c10); #line 92 break; #line 92 case kMIN: #line 92 result = MinM$Aggregate$finalize(arg_0xa9827f0, arg_0xa982948, arg_0xa982aa8, arg_0xa982c10); #line 92 break; #line 92 case kMAX: #line 92 result = MaxM$Aggregate$finalize(arg_0xa9827f0, arg_0xa982948, arg_0xa982aa8, arg_0xa982c10); #line 92 break; #line 92 case kCOUNT: #line 92 result = CountM$Aggregate$finalize(arg_0xa9827f0, arg_0xa982948, arg_0xa982aa8, arg_0xa982c10); #line 92 break; #line 92 case kAVG: #line 92 result = AvgM$Aggregate$finalize(arg_0xa9827f0, arg_0xa982948, arg_0xa982aa8, arg_0xa982c10); #line 92 break; #line 92 case kEXP_AVG: #line 92 result = ExpAvgM$Aggregate$finalize(arg_0xa9827f0, arg_0xa982948, arg_0xa982aa8, arg_0xa982c10); #line 92 break; #line 92 case kWIN_AVG: #line 92 result = WinAvgM$Aggregate$finalize(arg_0xa9827f0, arg_0xa982948, arg_0xa982aa8, arg_0xa982c10); #line 92 break; #line 92 case kWIN_SUM: #line 92 result = WinSumM$Aggregate$finalize(arg_0xa9827f0, arg_0xa982948, arg_0xa982aa8, arg_0xa982c10); #line 92 break; #line 92 case kWIN_MIN: #line 92 result = WinMinM$Aggregate$finalize(arg_0xa9827f0, arg_0xa982948, arg_0xa982aa8, arg_0xa982c10); #line 92 break; #line 92 case kWIN_MAX: #line 92 result = WinMaxM$Aggregate$finalize(arg_0xa9827f0, arg_0xa982948, arg_0xa982aa8, arg_0xa982c10); #line 92 break; #line 92 case kWIN_COUNT: #line 92 result = WinCountM$Aggregate$finalize(arg_0xa9827f0, arg_0xa982948, arg_0xa982aa8, arg_0xa982c10); #line 92 break; #line 92 default: #line 92 result = AggregateUseM$Agg$default$finalize(arg_0xa9500a0, arg_0xa9827f0, arg_0xa982948, arg_0xa982aa8, arg_0xa982c10); #line 92 } #line 92 #line 92 return result; #line 92 } #line 92 static inline # 43 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AggregateUseM.nc" TinyDBError AggregateUseM$AggregateUse$finalize(uint8_t id, char *data, char *result_buf, ParamList *params, ParamVals *paramValues) #line 43 { return AggregateUseM$Agg$finalize(id, data, result_buf, params, paramValues); } # 93 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AggregateUse.nc" inline static TinyDBError AggOperator$AggregateUse$finalize(uint8_t arg_0xa9266e8, char *arg_0xa926838, char *arg_0xa926990, ParamList *arg_0xa926af0, ParamVals *arg_0xa926c58){ #line 93 enum __nesc_unnamed4265 result; #line 93 #line 93 result = AggregateUseM$AggregateUse$finalize(arg_0xa9266e8, arg_0xa926838, arg_0xa926990, arg_0xa926af0, arg_0xa926c58); #line 93 #line 93 return result; #line 93 } #line 93 static inline # 671 "d:/tinyos-1.x/tos/lib/TinyDB/AggOperator.nc" TinyDBError AggOperator$finalizeAggExpr(QueryResult *qr, ParsedQueryPtr q, Expr *e, char *result_buf) #line 671 { AggOperator$GroupRecord *gr = (AggOperator$GroupRecord *)qr->d.data; ParamVals paramVals; #line 675 setParamValues(¶mVals, e); return AggOperator$AggregateUse$finalize(e->ex.agg.op, gr->aggdata, result_buf, (void *)0, ¶mVals); } # 79 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQuery.nc" inline static TinyDBError ParsedQuery$finalizeAggExpr(QueryResult *arg_0xa8295d0, ParsedQueryPtr arg_0xa829718, Expr *arg_0xa829870, char *arg_0xa8299c8){ #line 79 enum __nesc_unnamed4265 result; #line 79 #line 79 result = AggOperator$finalizeAggExpr(arg_0xa8295d0, arg_0xa829718, arg_0xa829870, arg_0xa8299c8); #line 79 #line 79 return result; #line 79 } #line 79 static inline # 197 "d:/tinyos-1.x/tos/lib/TinyDB/AggOperator.nc" bool AggOperator$Operator$resultIsForExpr(QueryResultPtr qr, ExprPtr e) #line 197 { AggOperator$GroupRecord *gr = (AggOperator$GroupRecord *)qr->d.data; bool result = TRUE; #line 200 if (qr->qrType != kAGG_SINGLE_FIELD) { #line 200 result = FALSE; } #line 201 if (gr->u.exprIdx != e->idx) { #line 201 result = FALSE; } return result; } # 94 "d:/tinyos-1.x/tos/lib/TinyDB/Operator.nc" inline static bool ParsedQuery$AggOperator$resultIsForExpr(QueryResultPtr arg_0xa60ebb8, ExprPtr arg_0xa60ecf8){ #line 94 unsigned char result; #line 94 #line 94 result = AggOperator$Operator$resultIsForExpr(arg_0xa60ebb8, arg_0xa60ecf8); #line 94 #line 94 return result; #line 94 } #line 94 static inline # 578 "d:/tinyos-1.x/tos/lib/TinyDB/AggOperator.nc" short AggOperator$getGroupNoFromQr(QueryResult *qr) #line 578 { AggOperator$GroupRecord *gr = (AggOperator$GroupRecord *)qr->d.data; return gr->groupNo; } # 80 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQuery.nc" inline static short ParsedQuery$getGroupNoFromQr(QueryResult *arg_0xa829df0){ #line 80 short result; #line 80 #line 80 result = AggOperator$getGroupNoFromQr(arg_0xa829df0); #line 80 #line 80 return result; #line 80 } #line 80 # 146 "d:/tinyos-1.x/tos/lib/TinyDB/QueryResultIntf.nc" inline static TinyDBError ParsedQuery$QueryResultIntf$fromResultTuple(ResultTuple arg_0xa6282f8, QueryResultPtr arg_0xa628440, ParsedQueryPtr arg_0xa628588){ #line 146 enum __nesc_unnamed4265 result; #line 146 #line 146 result = QueryResult$QueryResultIntf$fromResultTuple(arg_0xa6282f8, arg_0xa628440, arg_0xa628588); #line 146 #line 146 return result; #line 146 } #line 146 #line 159 inline static ResultTuple ParsedQuery$QueryResultIntf$getResultTuple(QueryResultPtr arg_0xa629378, short arg_0xa6294b0, ParsedQueryPtr arg_0xa6295f8){ #line 159 struct __nesc_unnamed4292 result; #line 159 #line 159 result = QueryResult$QueryResultIntf$getResultTuple(arg_0xa629378, arg_0xa6294b0, arg_0xa6295f8); #line 159 #line 159 return result; #line 159 } #line 159 # 80 "d:/tinyos-1.x/tos/lib/TinyDB/TupleIntf.nc" inline static uint16_t ParsedQuery$TupleIntf$fieldSize(ParsedQueryPtr arg_0xa605180, uint8_t arg_0xa6052c0){ #line 80 unsigned int result; #line 80 #line 80 result = Tuple$TupleIntf$fieldSize(arg_0xa605180, arg_0xa6052c0); #line 80 #line 80 return result; #line 80 } #line 80 #line 116 inline static CharPtr ParsedQuery$TupleIntf$getFieldPtr(ParsedQueryPtr arg_0xa5fef10, TuplePtr arg_0xa5ff058, uint8_t arg_0xa5ff1a0){ #line 116 char *result; #line 116 #line 116 result = Tuple$TupleIntf$getFieldPtr(arg_0xa5fef10, arg_0xa5ff058, arg_0xa5ff1a0); #line 116 #line 116 return result; #line 116 } #line 116 static inline # 131 "d:/tinyos-1.x/tos/lib/TinyDB/QueryResult.nc" TinyDBError QueryResult$QueryResultIntf$toTuplePtr(QueryResultPtr qr, ParsedQueryPtr q, TupleHandle t) #line 131 { *t = & qr->d.t; return err_NoError; } # 122 "d:/tinyos-1.x/tos/lib/TinyDB/QueryResultIntf.nc" inline static TinyDBError ParsedQuery$QueryResultIntf$toTuplePtr(QueryResultPtr arg_0xa62a598, ParsedQueryPtr arg_0xa62a6e0, TupleHandle arg_0xa62a828){ #line 122 enum __nesc_unnamed4265 result; #line 122 #line 122 result = QueryResult$QueryResultIntf$toTuplePtr(arg_0xa62a598, arg_0xa62a6e0, arg_0xa62a828); #line 122 #line 122 return result; #line 122 } #line 122 #line 153 inline static short ParsedQuery$QueryResultIntf$numRecords(QueryResultPtr arg_0xa628df8, ParsedQueryPtr arg_0xa628f40){ #line 153 short result; #line 153 #line 153 result = QueryResult$QueryResultIntf$numRecords(arg_0xa628df8, arg_0xa628f40); #line 153 #line 153 return result; #line 153 } #line 153 static inline # 150 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQuery.nc" TinyDBError ParsedQuery$ParsedQueryIntf$getResultField(ParsedQueryPtr q, QueryResultPtr qr, uint8_t resultid, char *result_buf) #line 150 { QueryResult localqr; ResultTuple rt; short numRecords = ParsedQuery$QueryResultIntf$numRecords(qr, q); bool isAgg = qr->qrType != kNOT_AGG; uint8_t fieldId = resultid & 0x7F; bool isGroupNo = resultid == GROUP_FIELD; TinyDBError err; if (resultid == NULL_QUERY_FIELD || resultid == TYPED_FIELD) { return err_InvalidIndex; } if (!isAgg) { Tuple *t; char *data; err = ParsedQuery$QueryResultIntf$toTuplePtr(qr, q, &t); if (err != err_NoError) { #line 169 return err; } data = ParsedQuery$TupleIntf$getFieldPtr(q, t, fieldId); if (data == (void *)0) { #line 172 return err_InvalidIndex; } nmemcpy(result_buf, data, ParsedQuery$TupleIntf$fieldSize(q, fieldId)); return err_NoError; } else #line 177 { Expr *e = isGroupNo ? (void *)0 : ParsedQuery$ParsedQueryIntf$getExprPtr(q, fieldId); short i; for (i = 0; i < numRecords; i++) { rt = ParsedQuery$QueryResultIntf$getResultTuple(qr, i, q); err = ParsedQuery$QueryResultIntf$fromResultTuple(rt, &localqr, q); if (err != err_NoError) { return err; } if (isGroupNo) { * (short *)result_buf = ParsedQuery$getGroupNoFromQr(&localqr); return err_NoError; } else #line 191 { if (ParsedQuery$AggOperator$resultIsForExpr(&localqr, e)) { err = ParsedQuery$finalizeAggExpr(&localqr, q, e, result_buf); if (err != err_NoError) { return err; } else { #line 197 return err_NoError; } } } } } return err_InvalidIndex; } # 122 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQueryIntf.nc" inline static TinyDBError DBBufferC$ParsedQueryIntf$getResultField(ParsedQueryPtr arg_0xa612860, QueryResultPtr arg_0xa6129a8, uint8_t arg_0xa612af0, char *arg_0xa612c48){ #line 122 enum __nesc_unnamed4265 result; #line 122 #line 122 result = ParsedQuery$ParsedQueryIntf$getResultField(arg_0xa612860, arg_0xa6129a8, arg_0xa612af0, arg_0xa612c48); #line 122 #line 122 return result; #line 122 } #line 122 # 128 "d:/tinyos-1.x/tos/lib/TinyDB/TupleIntf.nc" inline static CharPtr DBBufferC$TupleIntf$getFieldPtrNoQuery(TuplePtr arg_0xa5ff718, uint8_t arg_0xa5ff870, uint8_t arg_0xa5ff9c8, uint8_t arg_0xa5ffb38[], uint8_t arg_0xa5ffca8[]){ #line 128 char *result; #line 128 #line 128 result = Tuple$TupleIntf$getFieldPtrNoQuery(arg_0xa5ff718, arg_0xa5ff870, arg_0xa5ff9c8, arg_0xa5ffb38, arg_0xa5ffca8); #line 128 #line 128 return result; #line 128 } #line 128 static inline # 1110 "d:/tinyos-1.x/tos/lib/TinyDB/DBBufferC.nc" TinyDBError DBBufferC$DBBuffer$getField(uint8_t bufferId, QueryResult *qr, uint8_t idx, char *resultBuf) #line 1110 { ParsedQuery **fromPq; Tuple *t; char *field; TinyDBError err = err_NoError; #line 1115 switch (bufferId) { case DBBufferC$kATTR_BUF: if (idx >= DBBufferC$NUM_ATTR_FIELDS) { #line 1117 return err_InvalidIndex; } #line 1118 t = & qr->d.t; field = DBBufferC$TupleIntf$getFieldPtrNoQuery(t, idx, DBBufferC$NUM_ATTR_FIELDS, DBBufferC$ATTR_SIZES, DBBufferC$ATTR_TYPES); if (field != (void *)0) { nmemcpy(resultBuf, field, DBBufferC$ATTR_SIZES[idx]); } else { #line 1123 err = err_InvalidIndex; } #line 1124 break; default: fromPq = DBBufferC$DBBuffer$getSchema(bufferId); if (fromPq == (void *)0) { #line 1127 return err_UnsupportedBuffer; } #line 1128 err = DBBufferC$ParsedQueryIntf$getResultField(*fromPq, qr, idx, resultBuf); } return err; } # 140 "d:/tinyos-1.x/tos/lib/TinyDB/DBBuffer.nc" inline static TinyDBError TupleRouterM$DBBuffer$getField(uint8_t arg_0xa6421c8, QueryResult *arg_0xa642328, uint8_t arg_0xa642468, char *arg_0xa6425c0){ #line 140 enum __nesc_unnamed4265 result; #line 140 #line 140 result = DBBufferC$DBBuffer$getField(arg_0xa6421c8, arg_0xa642328, arg_0xa642468, arg_0xa6425c0); #line 140 #line 140 return result; #line 140 } #line 140 static inline # 411 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$SET_ROUTING_TUPLES(void) #line 411 { #line 411 TupleRouterM$mPendingMask |= TupleRouterM$ROUTING_BIT; } static inline #line 2553 void TupleRouterM$keepRouting(void) #line 2553 { if (!TupleRouterM$fetchNextAttr()) { TupleRouterM$UNSET_FETCHING_ATTRIBUTE(); TupleRouterM$SET_ROUTING_TUPLES(); TupleRouterM$mCurRouteQuery = TupleRouterM$nextQueryToRoute((void *)0); TupleRouterM$mCurExpr = -1; TOS_post(TupleRouterM$routeTask); } } # 151 "d:/tinyos-1.x/tos/lib/TinyDB/TupleIntf.nc" inline static TinyDBError TupleRouterM$TupleIntf$getNextEmptyFieldIdx(ParsedQueryPtr arg_0xa5fd7a0, TuplePtr arg_0xa5fd8e8, uint8_t *arg_0xa5fda48){ #line 151 enum __nesc_unnamed4265 result; #line 151 #line 151 result = Tuple$TupleIntf$getNextEmptyFieldIdx(arg_0xa5fd7a0, arg_0xa5fd8e8, arg_0xa5fda48); #line 151 #line 151 return result; #line 151 } #line 151 # 72 "d:/tinyos-1.x/tos/interfaces/AttrUse.nc" inline static AttrDescPtr Tuple$AttrUse$getAttrById(uint8_t arg_0xa5e4d58){ #line 72 struct __nesc_unnamed4260 *result; #line 72 #line 72 result = Attr$AttrUse$getAttrById(arg_0xa5e4d58); #line 72 #line 72 return result; #line 72 } #line 72 static inline # 258 "d:/tinyos-1.x/tos/lib/TinyDB/Tuple.nc" AttrDescPtr Tuple$TupleIntf$getNextQueryField(ParsedQueryPtr q, TuplePtr t) #line 258 { uint8_t i; TinyDBError err; err = Tuple$TupleIntf$getNextEmptyFieldIdx(q, t, &i); if (err == err_NoError) { return Tuple$AttrUse$getAttrById(q->queryToSchemaFieldMap[i]); } else { #line 266 return (void *)0; } } # 144 "d:/tinyos-1.x/tos/lib/TinyDB/TupleIntf.nc" inline static AttrDescPtr TupleRouterM$TupleIntf$getNextQueryField(ParsedQueryPtr arg_0xa5fd1c8, TuplePtr arg_0xa5fd310){ #line 144 struct __nesc_unnamed4260 *result; #line 144 #line 144 result = Tuple$TupleIntf$getNextQueryField(arg_0xa5fd1c8, arg_0xa5fd310); #line 144 #line 144 return result; #line 144 } #line 144 # 93 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQueryIntf.nc" inline static TuplePtr TupleRouterM$ParsedQueryIntf$getTuplePtr(ParsedQueryPtr arg_0xa5f74f8){ #line 93 struct __nesc_unnamed4266 *result; #line 93 #line 93 result = ParsedQuery$ParsedQueryIntf$getTuplePtr(arg_0xa5f74f8); #line 93 #line 93 return result; #line 93 } #line 93 static inline # 2505 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" TupleRouterM$TupleFieldDesc TupleRouterM$getNextQueryField(ParsedQuery **pq) #line 2505 { TupleRouterM$QueryListHandle qlh = TupleRouterM$mQs; AttrDescPtr attr = (void *)0; TupleRouterM$TupleFieldDesc d; TinyDBError err; uint8_t idx; d.isNull = TRUE; while (qlh != (void *)0) { if ((*qlh)->q.clocksPerSample > 0 && (*qlh)->q.clockCount <= 0) { Tuple *t = TupleRouterM$ParsedQueryIntf$getTuplePtr(& (*qlh)->q); ParsedQuery *q = & (*qlh)->q; #line 2518 { } #line 2518 ; { } #line 2519 ; if (q->fromBuffer == kNO_QUERY) { attr = TupleRouterM$TupleIntf$getNextQueryField(q, t); if (attr != (void *)0) { d.isAttr = TRUE; d.u.attr = attr; d.isNull = FALSE; break; } } else #line 2529 { err = TupleRouterM$TupleIntf$getNextEmptyFieldIdx(q, t, &idx); if (err == err_NoError) { d.isAttr = FALSE; d.u.tupleIdx = idx; d.isNull = FALSE; break; } } } qlh = (TupleRouterM$QueryListHandle )(*qlh)->next; } if (qlh == (void *)0) { *pq = (void *)0; } else { #line 2545 *pq = & (*qlh)->q; } return d; } # 142 "d:/tinyos-1.x/tos/lib/TinyDB/QueryResultIntf.nc" inline static TinyDBError DBBufferC$QueryResultIntf$fromBytes(QueryResultPtr arg_0xa62bb48, QueryResultPtr arg_0xa62bc90, ParsedQueryPtr arg_0xa62bdd8){ #line 142 enum __nesc_unnamed4265 result; #line 142 #line 142 result = QueryResult$QueryResultIntf$fromBytes(arg_0xa62bb48, arg_0xa62bc90, arg_0xa62bdd8); #line 142 #line 142 return result; #line 142 } #line 142 static inline # 183 "d:/tinyos-1.x/tos/lib/TinyDB/Tuple.nc" result_t Tuple$TupleIntf$setFieldNoQuery(TuplePtr t, uint8_t fieldIdx, uint8_t numFields, uint8_t sizes[], uint8_t types[], CharPtr data) #line 188 { char *dest = Tuple$TupleIntf$getFieldPtrNoQuery(t, fieldIdx, numFields, sizes, types); #line 190 if (dest != data) { nmemcpy(dest, data, sizes[fieldIdx]); } t->notNull |= 1 << fieldIdx; return SUCCESS; } # 102 "d:/tinyos-1.x/tos/lib/TinyDB/TupleIntf.nc" inline static result_t DBBufferC$TupleIntf$setFieldNoQuery(TuplePtr arg_0xa5fe160, uint8_t arg_0xa5fe2b8, uint8_t arg_0xa5fe410, uint8_t arg_0xa5fe580[], uint8_t arg_0xa5fe6f0[], CharPtr arg_0xa5fe840){ #line 102 unsigned char result; #line 102 #line 102 result = Tuple$TupleIntf$setFieldNoQuery(arg_0xa5fe160, arg_0xa5fe2b8, arg_0xa5fe410, arg_0xa5fe580, arg_0xa5fe6f0, arg_0xa5fe840); #line 102 #line 102 return result; #line 102 } #line 102 # 72 "d:/tinyos-1.x/tos/interfaces/AttrUse.nc" inline static AttrDescPtr DBBufferC$AttrUse$getAttrById(uint8_t arg_0xa5e4d58){ #line 72 struct __nesc_unnamed4260 *result; #line 72 #line 72 result = Attr$AttrUse$getAttrById(arg_0xa5e4d58); #line 72 #line 72 return result; #line 72 } #line 72 static inline # 162 "d:/tinyos-1.x/tos/lib/Attr.nc" uint8_t Attr$AttrUse$numAttrs(void) { return Attr$attrDescs.numAttrs; } # 77 "d:/tinyos-1.x/tos/interfaces/AttrUse.nc" inline static uint8_t DBBufferC$AttrUse$numAttrs(void){ #line 77 unsigned char result; #line 77 #line 77 result = Attr$AttrUse$numAttrs(); #line 77 #line 77 return result; #line 77 } #line 77 static inline # 855 "d:/tinyos-1.x/tos/lib/TinyDB/DBBufferC.nc" TinyDBError DBBufferC$DBBuffer$getResult(uint8_t bufferId, uint16_t idx, QueryResult *qr, bool *pending) #line 855 { TinyDBError err = err_NoError; if (DBBufferC$mState != DBBufferC$kIDLE) { return err_ResultBufferBusy; } DBBufferC$mState = DBBufferC$kREAD_ROW; switch (bufferId) { case DBBufferC$kATTR_BUF: { TuplePtr t; char *field; if (idx >= DBBufferC$AttrUse$numAttrs()) { err = err_NoMoreResults; goto done; } t = & qr->d.t; t->notNull = 0; t->numFields = DBBufferC$NUM_ATTR_FIELDS; field = DBBufferC$TupleIntf$getFieldPtrNoQuery(t, 0, DBBufferC$NUM_ATTR_FIELDS, DBBufferC$ATTR_SIZES, DBBufferC$ATTR_TYPES); if (field != (void *)0) { AttrDescPtr adp = DBBufferC$AttrUse$getAttrById(idx); #line 886 DBBufferC$TupleIntf$setFieldNoQuery(t, 0, DBBufferC$NUM_ATTR_FIELDS, DBBufferC$ATTR_SIZES, DBBufferC$ATTR_TYPES, adp->name); } break; } default: { DBBufferC$Buffer *buf; uint16_t size; uint16_t row; Handle *bufList; err = DBBufferC$getBuf(bufferId, &buf); *pending = FALSE; if (err != err_NoError) { #line 900 goto done; } if (buf->nextFull == buf->nextFree && buf->numRows != 1) { err = err_NoMoreResults; goto done; } DBBufferC$DBBuffer$size(bufferId, &size); if (idx >= size) { err = err_NoMoreResults; goto done; } if (buf->nextFull > buf->nextFree) { if (idx >= buf->numRows - buf->nextFull) { row = idx - (buf->numRows - buf->nextFull); } else { #line 917 row = buf->nextFull + idx; } } else #line 918 { row = buf->nextFull + idx; } switch (buf->type) { case kRAM: bufList = (Handle *)* buf->u.bufdata; DBBufferC$QueryResultIntf$fromBytes((QueryResultPtr )*bufList[row], qr, * buf->qh); break; default: err = err_UnknownError; } } } done: DBBufferC$mState = DBBufferC$kIDLE; return err; } # 122 "d:/tinyos-1.x/tos/lib/TinyDB/DBBuffer.nc" inline static TinyDBError TupleRouterM$DBBuffer$getResult(uint8_t arg_0xa61f138, uint16_t arg_0xa61f280, QueryResult *arg_0xa61f3e0, bool *arg_0xa61f538){ #line 122 enum __nesc_unnamed4265 result; #line 122 #line 122 result = DBBufferC$DBBuffer$getResult(arg_0xa61f138, arg_0xa61f280, arg_0xa61f3e0, arg_0xa61f538); #line 122 #line 122 return result; #line 122 } #line 122 static inline # 672 "d:/tinyos-1.x/tos/lib/TinyDB/DBBufferC.nc" TinyDBError DBBufferC$DBBuffer$peek(uint8_t bufferId, QueryResult *qr, bool *pending) #line 672 { DBBufferC$Buffer *buf; TinyDBError err; uint16_t row; Handle *bufList; if (((( #line 678 bufferId == kRADIO || bufferId == DBBufferC$kATTR_BUF) || bufferId == DBBufferC$kCOMMAND_BUF) || bufferId == DBBufferC$kEVENT_BUF) || bufferId == DBBufferC$kQUERY_BUF) { return err_UnsupportedBuffer; } if (DBBufferC$mState != DBBufferC$kIDLE) { return err_ResultBufferBusy; } DBBufferC$mState = DBBufferC$kREAD_ROW; *pending = FALSE; err = DBBufferC$getBuf(bufferId, &buf); if (err != err_NoError) { DBBufferC$mState = DBBufferC$kIDLE; goto done; } switch (buf->type) { case kRAM: row = buf->nextFull; if (row == buf->nextFree && buf->numRows != 1) { err = err_NoMoreResults; DBBufferC$mState = DBBufferC$kIDLE; goto done; } bufList = (Handle *)* buf->u.bufdata; if (bufList[row] == (void *)0) { err = err_NoMoreResults; DBBufferC$mState = DBBufferC$kIDLE; goto done; } DBBufferC$QueryResultIntf$fromBytes((QueryResultPtr )*bufList[row], qr, * buf->qh); DBBufferC$mState = DBBufferC$kIDLE; break; case kEEPROM: #line 742 err = err_EepromFailure; *pending = FALSE; DBBufferC$mState = DBBufferC$kIDLE; break; default: err = err_UnknownError; DBBufferC$mState = DBBufferC$kIDLE; } done: return err; } # 107 "d:/tinyos-1.x/tos/lib/TinyDB/DBBuffer.nc" inline static TinyDBError TupleRouterM$DBBuffer$peek(uint8_t arg_0xa61e798, QueryResult *arg_0xa61e8f8, bool *arg_0xa61ea50){ #line 107 enum __nesc_unnamed4265 result; #line 107 #line 107 result = DBBufferC$DBBuffer$peek(arg_0xa61e798, arg_0xa61e8f8, arg_0xa61ea50); #line 107 #line 107 return result; #line 107 } #line 107 static inline # 2640 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$fillInTask(void) #line 2640 { TupleRouterM$fillInAttrVal(SCHEMA_RESULT_READY); } static inline #line 403 void TupleRouterM$SET_FETCHING_ATTRIBUTE(void) #line 403 { #line 403 TupleRouterM$mPendingMask |= TupleRouterM$FETCHING_BIT; } static inline # 882 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkM.nc" uint8_t NetworkM$NetworkMonitor$getQuality(void) { return NetworkM$mCommProb[NetworkM$mParentIx[0]]; } # 71 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkMonitor.nc" inline static uint8_t TinyDBAttrM$NetworkMonitor$getQuality(void){ #line 71 unsigned char result; #line 71 #line 71 result = NetworkM$NetworkMonitor$getQuality(); #line 71 #line 71 return result; #line 71 } #line 71 static inline # 222 "d:/tinyos-1.x/tos/lib/TinyDB/TinyDBAttrM.nc" result_t TinyDBAttrM$QualityAttr$getAttr(char *name, char *resultBuf, SchemaErrorNo *err) { *err = SCHEMA_RESULT_READY; * (uint8_t *)resultBuf = TinyDBAttrM$NetworkMonitor$getQuality(); return SUCCESS; } # 97 "d:/tinyos-1.x/tos/lib/TinyDB/QueryProcessor.nc" inline static ParsedQueryPtr TinyDBAttrM$QueryProcessor$getQueryIdx(short arg_0xa2ec580){ #line 97 struct __nesc_unnamed4276 *result; #line 97 #line 97 result = TupleRouterM$QueryProcessor$getQueryIdx(arg_0xa2ec580); #line 97 #line 97 return result; #line 97 } #line 97 #line 96 inline static short TinyDBAttrM$QueryProcessor$numQueries(void){ #line 96 short result; #line 96 #line 96 result = TupleRouterM$QueryProcessor$numQueries(); #line 96 #line 96 return result; #line 96 } #line 96 static inline # 282 "d:/tinyos-1.x/tos/lib/TinyDB/TinyDBAttrM.nc" result_t TinyDBAttrM$QidAttr$getAttr(char *name, char *resultBuf, SchemaErrorNo *err) { short numqs = TinyDBAttrM$QueryProcessor$numQueries(); uint8_t qid1 = 0xff; #line 285 uint8_t qid2 = 0xff; #line 286 *err = SCHEMA_RESULT_READY; if (numqs >= 1) { qid1 = (uint8_t )TinyDBAttrM$QueryProcessor$getQueryIdx(0)->qid; } #line 289 if (numqs >= 2) { qid2 = (uint8_t )TinyDBAttrM$QueryProcessor$getQueryIdx(1)->qid; } #line 291 * (uint8_t *)resultBuf = qid1; * (uint8_t *)(resultBuf + 1) = qid2; return SUCCESS; } static inline # 877 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkM.nc" uint8_t NetworkM$NetworkMonitor$getDepth(void) { return NetworkM$myLevel(0); } # 69 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkMonitor.nc" inline static uint8_t TinyDBAttrM$NetworkMonitor$getDepth(void){ #line 69 unsigned char result; #line 69 #line 69 result = NetworkM$NetworkMonitor$getDepth(); #line 69 #line 69 return result; #line 69 } #line 69 static inline # 262 "d:/tinyos-1.x/tos/lib/TinyDB/TinyDBAttrM.nc" result_t TinyDBAttrM$DepthAttr$getAttr(char *name, char *resultBuf, SchemaErrorNo *err) { *err = SCHEMA_RESULT_READY; * (uint8_t *)resultBuf = TinyDBAttrM$NetworkMonitor$getDepth(); return SUCCESS; } static inline # 892 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkM.nc" uint8_t NetworkM$NetworkMonitor$getMHopQueueLength(void) { return 0; } # 66 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkMonitor.nc" inline static uint8_t TinyDBAttrM$NetworkMonitor$getMHopQueueLength(void){ #line 66 unsigned char result; #line 66 #line 66 result = NetworkM$NetworkMonitor$getMHopQueueLength(); #line 66 #line 66 return result; #line 66 } #line 66 static inline # 242 "d:/tinyos-1.x/tos/lib/TinyDB/TinyDBAttrM.nc" result_t TinyDBAttrM$MHQueueLenAttr$getAttr(char *name, char *resultBuf, SchemaErrorNo *err) { *err = SCHEMA_RESULT_READY; * (uint8_t *)resultBuf = TinyDBAttrM$NetworkMonitor$getMHopQueueLength(); return SUCCESS; } static inline # 887 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkM.nc" uint8_t NetworkM$NetworkMonitor$getQueueLength(void) { return 0; } # 65 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkMonitor.nc" inline static uint8_t TinyDBAttrM$NetworkMonitor$getQueueLength(void){ #line 65 unsigned char result; #line 65 #line 65 result = NetworkM$NetworkMonitor$getQueueLength(); #line 65 #line 65 return result; #line 65 } #line 65 static inline # 186 "d:/tinyos-1.x/tos/lib/TinyDB/TinyDBAttrM.nc" result_t TinyDBAttrM$QueueLenAttr$getAttr(char *name, char *resultBuf, SchemaErrorNo *err) { *err = SCHEMA_RESULT_READY; * (uint8_t *)resultBuf = TinyDBAttrM$NetworkMonitor$getQueueLength(); return SUCCESS; } static inline # 612 "d:/tinyos-1.x/tos/lib/TinyAlloc.nc" uint16_t TinyAlloc$MemAlloc$freeBytes(void) #line 612 { return TinyAlloc$mFreeBytes; } # 168 "d:/tinyos-1.x/tos/interfaces/MemAlloc.nc" inline static uint16_t TinyDBAttrM$MemAlloc$freeBytes(void){ #line 168 unsigned int result; #line 168 #line 168 result = TinyAlloc$MemAlloc$freeBytes(); #line 168 #line 168 return result; #line 168 } #line 168 static inline # 154 "d:/tinyos-1.x/tos/lib/TinyDB/TinyDBAttrM.nc" result_t TinyDBAttrM$FreeSpaceAttr$getAttr(char *name, char *resultBuf, SchemaErrorNo *err) { *err = SCHEMA_RESULT_READY; * (uint16_t *)resultBuf = TinyDBAttrM$MemAlloc$freeBytes(); return SUCCESS; } static inline # 872 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkM.nc" uint16_t NetworkM$NetworkMonitor$getParent(void) { return NetworkM$mRelatives[NetworkM$mParentIx[0]]; } # 64 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkMonitor.nc" inline static uint16_t TinyDBAttrM$NetworkMonitor$getParent(void){ #line 64 unsigned int result; #line 64 #line 64 result = NetworkM$NetworkMonitor$getParent(); #line 64 #line 64 return result; #line 64 } #line 64 static inline # 116 "d:/tinyos-1.x/tos/lib/TinyDB/TinyDBAttrM.nc" result_t TinyDBAttrM$ParentAttr$getAttr(char *name, char *resultBuf, SchemaErrorNo *err) { *err = SCHEMA_RESULT_READY; * (uint16_t *)resultBuf = TinyDBAttrM$NetworkMonitor$getParent(); return SUCCESS; } static inline # 153 "d:/tinyos-1.x/tos/system/PotM.nc" uint8_t PotM$Pot$get(void) #line 153 { return PotM$potSetting; } # 139 "d:/tinyos-1.x/tos/interfaces/Pot.nc" inline static uint8_t AttrPotM$Pot$get(void){ #line 139 unsigned char result; #line 139 #line 139 result = PotM$Pot$get(); #line 139 #line 139 return result; #line 139 } #line 139 static inline # 81 "d:/tinyos-1.x/tos/lib/Attributes/AttrPotM.nc" result_t AttrPotM$AttrRegister$getAttr(char *name, char *resultBuf, SchemaErrorNo *errorNo) { * (uint8_t *)resultBuf = AttrPotM$Pot$get(); *errorNo = SCHEMA_RESULT_READY; return SUCCESS; } static inline # 100 "d:/tinyos-1.x/tos/lib/Attributes/AttrGlobalM.nc" result_t AttrGlobalM$GroupAttr$getAttr(char *name, char *resultBuf, SchemaErrorNo *errorNo) { *errorNo = SCHEMA_RESULT_READY; * (uint8_t *)resultBuf = TOS_AM_GROUP; return SUCCESS; } static inline #line 82 result_t AttrGlobalM$NodeIdAttr$getAttr(char *name, char *resultBuf, SchemaErrorNo *errorNo) { *errorNo = SCHEMA_RESULT_READY; * (uint16_t *)resultBuf = TOS_LOCAL_ADDRESS; return SUCCESS; } static inline # 139 "d:/tinyos-1.x/tos/system/LogicalTimeM.nc" uint32_t LogicalTimeM$Time$getHigh32(void) #line 139 { uint32_t rval; #line 141 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 141 { rval = LogicalTimeM$time.high32; } #line 143 __nesc_atomic_end(__nesc_atomic); } return rval; } # 54 "d:/tinyos-1.x/tos/interfaces/Time.nc" inline static uint32_t AttrTimeM$Time$getHigh32(void){ #line 54 unsigned long result; #line 54 #line 54 result = LogicalTimeM$Time$getHigh32(); #line 54 #line 54 return result; #line 54 } #line 54 static inline # 98 "d:/tinyos-1.x/tos/lib/Attributes/AttrTimeM.nc" result_t AttrTimeM$TimeHighAttr$getAttr(char *name, char *resultBuf, SchemaErrorNo *errorNo) { * (uint32_t *)resultBuf = AttrTimeM$Time$getHigh32(); *errorNo = SCHEMA_RESULT_READY; return SUCCESS; } static inline # 147 "d:/tinyos-1.x/tos/system/LogicalTimeM.nc" uint32_t LogicalTimeM$Time$getLow32(void) #line 147 { uint32_t rval; #line 149 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 149 { rval = LogicalTimeM$time.low32; } #line 151 __nesc_atomic_end(__nesc_atomic); } return rval; } # 57 "d:/tinyos-1.x/tos/interfaces/Time.nc" inline static uint32_t AttrTimeM$Time$getLow32(void){ #line 57 unsigned long result; #line 57 #line 57 result = LogicalTimeM$Time$getLow32(); #line 57 #line 57 return result; #line 57 } #line 57 static inline # 81 "d:/tinyos-1.x/tos/lib/Attributes/AttrTimeM.nc" result_t AttrTimeM$TimeLowAttr$getAttr(char *name, char *resultBuf, SchemaErrorNo *errorNo) { * (uint32_t *)resultBuf = AttrTimeM$Time$getLow32(); *errorNo = SCHEMA_RESULT_READY; return SUCCESS; } static inline # 200 "d:/tinyos-1.x/tos/platform/mica2/ADCM.nc" result_t ADCM$ADC$getData(uint8_t port) #line 200 { return ADCM$startGet(ADCM$SINGLE_CONVERSION, port); } # 82 "d:/tinyos-1.x/tos/interfaces/ADC.nc" inline static result_t AttrVoltageM$ADC$getData(void){ #line 82 unsigned char result; #line 82 #line 82 result = ADCM$ADC$getData(TOS_ADC_VOLTAGE_PORT); #line 82 #line 82 return result; #line 82 } #line 82 static inline # 82 "d:/tinyos-1.x/tos/lib/Attributes/AttrVoltageM.nc" result_t AttrVoltageM$AttrRegister$getAttr(char *name, char *resultBuf, SchemaErrorNo *errorNo) { AttrVoltageM$result = resultBuf; AttrVoltageM$attrName = name; if (AttrVoltageM$ADC$getData() != SUCCESS) { return FAIL; } #line 94 *errorNo = SCHEMA_RESULT_PENDING; return SUCCESS; } # 82 "d:/tinyos-1.x/tos/interfaces/ADC.nc" inline static result_t PhotoTempM$InternalTempADC$getData(void){ #line 82 unsigned char result; #line 82 #line 82 result = ADCM$ADC$getData(TOS_ADC_TEMP_PORT); #line 82 #line 82 return result; #line 82 } #line 82 static inline # 151 "d:/tinyos-1.x/tos/sensorboards/micasb/PhotoTempM.nc" result_t PhotoTempM$ExternalTempADC$getData(void) #line 151 { uint8_t oldState; #line 153 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 153 { oldState = PhotoTempM$state; if (PhotoTempM$state == PhotoTempM$IDLE) { PhotoTempM$state = PhotoTempM$BUSY; } } #line 158 __nesc_atomic_end(__nesc_atomic); } if (oldState == PhotoTempM$IDLE) { TOSH_CLR_PHOTO_CTL_PIN(); TOSH_MAKE_PHOTO_CTL_INPUT(); TOSH_SET_TEMP_CTL_PIN(); TOSH_MAKE_TEMP_CTL_OUTPUT(); return PhotoTempM$InternalTempADC$getData(); } return FAIL; } # 82 "d:/tinyos-1.x/tos/interfaces/ADC.nc" inline static result_t AttrTempM$ADC$getData(void){ #line 82 unsigned char result; #line 82 #line 82 result = PhotoTempM$ExternalTempADC$getData(); #line 82 #line 82 return result; #line 82 } #line 82 static inline # 85 "d:/tinyos-1.x/tos/lib/Attributes/AttrTempM.nc" result_t AttrTempM$AttrRegister$getAttr(char *name, char *resultBuf, SchemaErrorNo *errorNo) { AttrTempM$result = resultBuf; AttrTempM$attrName = name; if (AttrTempM$ADC$getData() != SUCCESS) { return FAIL; } #line 91 *errorNo = SCHEMA_RESULT_PENDING; return SUCCESS; } # 82 "d:/tinyos-1.x/tos/interfaces/ADC.nc" inline static result_t PhotoTempM$InternalPhotoADC$getData(void){ #line 82 unsigned char result; #line 82 #line 82 result = ADCM$ADC$getData(TOS_ADC_PHOTO_PORT); #line 82 #line 82 return result; #line 82 } #line 82 static inline # 169 "d:/tinyos-1.x/tos/sensorboards/micasb/PhotoTempM.nc" result_t PhotoTempM$ExternalPhotoADC$getData(void) #line 169 { uint8_t oldState; #line 171 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 171 { oldState = PhotoTempM$state; if (PhotoTempM$state == PhotoTempM$IDLE) { PhotoTempM$state = PhotoTempM$BUSY; } } #line 176 __nesc_atomic_end(__nesc_atomic); } if (oldState == PhotoTempM$IDLE) { TOSH_CLR_TEMP_CTL_PIN(); TOSH_MAKE_TEMP_CTL_INPUT(); TOSH_SET_PHOTO_CTL_PIN(); TOSH_MAKE_PHOTO_CTL_OUTPUT(); return PhotoTempM$InternalPhotoADC$getData(); } return FAIL; } # 82 "d:/tinyos-1.x/tos/interfaces/ADC.nc" inline static result_t AttrPhotoM$ADC$getData(void){ #line 82 unsigned char result; #line 82 #line 82 result = PhotoTempM$ExternalPhotoADC$getData(); #line 82 #line 82 return result; #line 82 } #line 82 static inline # 85 "d:/tinyos-1.x/tos/lib/Attributes/AttrPhotoM.nc" result_t AttrPhotoM$AttrRegister$getAttr(char *name, char *resultBuf, SchemaErrorNo *errorNo) { AttrPhotoM$result = resultBuf; AttrPhotoM$attrName = name; if (AttrPhotoM$ADC$getData() != SUCCESS) { return FAIL; } #line 91 *errorNo = SCHEMA_RESULT_PENDING; return SUCCESS; } # 82 "d:/tinyos-1.x/tos/interfaces/ADC.nc" inline static result_t AttrAccelM$AccelY$getData(void){ #line 82 unsigned char result; #line 82 #line 82 result = ADCM$ADC$getData(TOS_ADC_ACCEL_Y_PORT); #line 82 #line 82 return result; #line 82 } #line 82 static inline # 119 "d:/tinyos-1.x/tos/lib/Attributes/AttrAccelM.nc" result_t AttrAccelM$AttrAccelY$getAttr(char *name, char *resultBuf, SchemaErrorNo *errorNo) { AttrAccelM$resultY = resultBuf; AttrAccelM$attrNameY = name; if (AttrAccelM$AccelY$getData() != SUCCESS) { return FAIL; } #line 125 *errorNo = SCHEMA_RESULT_PENDING; return SUCCESS; } # 82 "d:/tinyos-1.x/tos/interfaces/ADC.nc" inline static result_t AttrAccelM$AccelX$getData(void){ #line 82 unsigned char result; #line 82 #line 82 result = ADCM$ADC$getData(TOS_ADC_ACCEL_X_PORT); #line 82 #line 82 return result; #line 82 } #line 82 static inline # 90 "d:/tinyos-1.x/tos/lib/Attributes/AttrAccelM.nc" result_t AttrAccelM$AttrAccelX$getAttr(char *name, char *resultBuf, SchemaErrorNo *errorNo) { AttrAccelM$resultX = resultBuf; AttrAccelM$attrNameX = name; if (AttrAccelM$AccelX$getData() != SUCCESS) { return FAIL; } #line 96 *errorNo = SCHEMA_RESULT_PENDING; return SUCCESS; } static inline # 184 "d:/tinyos-1.x/tos/lib/Attributes/AttrMicM.nc" result_t AttrMicM$AttrTones$getAttr(char *name, char *resultBuf, SchemaErrorNo *errorNo) { *resultBuf = AttrMicM$tones; *errorNo = SCHEMA_RESULT_READY; AttrMicM$tones = 0; return SUCCESS; } static inline #line 137 result_t AttrMicM$AttrNoise$getAttr(char *name, char *resultBuf, SchemaErrorNo *errorNo) { * (uint16_t *)resultBuf = AttrMicM$maxNoise; *errorNo = SCHEMA_RESULT_READY; AttrMicM$maxNoise = 0; return SUCCESS; } static inline # 271 "d:/tinyos-1.x/tos/lib/Attr.nc" result_t Attr$Attr$default$getAttr(uint8_t id, char *name, char *resultBuf, SchemaErrorNo *errorNo) #line 271 { return SUCCESS; } # 77 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t Attr$Attr$getAttr(uint8_t arg_0xa7eac68, char *arg_0xa7e42f0, char *arg_0xa7e4448, SchemaErrorNo *arg_0xa7e45a8){ #line 77 unsigned char result; #line 77 #line 77 switch (arg_0xa7eac68) { #line 77 case 0: #line 77 result = TinyDBAttrM$ParentAttr$getAttr(arg_0xa7e42f0, arg_0xa7e4448, arg_0xa7e45a8); #line 77 break; #line 77 case 1: #line 77 result = TinyDBAttrM$FreeSpaceAttr$getAttr(arg_0xa7e42f0, arg_0xa7e4448, arg_0xa7e45a8); #line 77 break; #line 77 case 2: #line 77 result = TinyDBAttrM$QueueLenAttr$getAttr(arg_0xa7e42f0, arg_0xa7e4448, arg_0xa7e45a8); #line 77 break; #line 77 case 3: #line 77 result = TinyDBAttrM$MHQueueLenAttr$getAttr(arg_0xa7e42f0, arg_0xa7e4448, arg_0xa7e45a8); #line 77 break; #line 77 case 4: #line 77 result = TinyDBAttrM$DepthAttr$getAttr(arg_0xa7e42f0, arg_0xa7e4448, arg_0xa7e45a8); #line 77 break; #line 77 case 5: #line 77 result = TinyDBAttrM$QidAttr$getAttr(arg_0xa7e42f0, arg_0xa7e4448, arg_0xa7e45a8); #line 77 break; #line 77 case 6: #line 77 result = TinyDBAttrM$QualityAttr$getAttr(arg_0xa7e42f0, arg_0xa7e4448, arg_0xa7e45a8); #line 77 break; #line 77 case 7: #line 77 result = AttrPotM$AttrRegister$getAttr(arg_0xa7e42f0, arg_0xa7e4448, arg_0xa7e45a8); #line 77 break; #line 77 case 8: #line 77 result = AttrGlobalM$NodeIdAttr$getAttr(arg_0xa7e42f0, arg_0xa7e4448, arg_0xa7e45a8); #line 77 break; #line 77 case 9: #line 77 result = AttrGlobalM$GroupAttr$getAttr(arg_0xa7e42f0, arg_0xa7e4448, arg_0xa7e45a8); #line 77 break; #line 77 case 10: #line 77 result = AttrTimeM$TimeLowAttr$getAttr(arg_0xa7e42f0, arg_0xa7e4448, arg_0xa7e45a8); #line 77 break; #line 77 case 11: #line 77 result = AttrTimeM$TimeHighAttr$getAttr(arg_0xa7e42f0, arg_0xa7e4448, arg_0xa7e45a8); #line 77 break; #line 77 case 12: #line 77 result = AttrVoltageM$AttrRegister$getAttr(arg_0xa7e42f0, arg_0xa7e4448, arg_0xa7e45a8); #line 77 break; #line 77 case 13: #line 77 result = AttrTempM$AttrRegister$getAttr(arg_0xa7e42f0, arg_0xa7e4448, arg_0xa7e45a8); #line 77 break; #line 77 case 14: #line 77 result = AttrPhotoM$AttrRegister$getAttr(arg_0xa7e42f0, arg_0xa7e4448, arg_0xa7e45a8); #line 77 break; #line 77 case 15: #line 77 result = AttrAccelM$AttrAccelX$getAttr(arg_0xa7e42f0, arg_0xa7e4448, arg_0xa7e45a8); #line 77 break; #line 77 case 16: #line 77 result = AttrAccelM$AttrAccelY$getAttr(arg_0xa7e42f0, arg_0xa7e4448, arg_0xa7e45a8); #line 77 break; #line 77 case 17: #line 77 result = AttrMicM$AttrNoise$getAttr(arg_0xa7e42f0, arg_0xa7e4448, arg_0xa7e45a8); #line 77 break; #line 77 case 18: #line 77 result = AttrMicM$AttrTones$getAttr(arg_0xa7e42f0, arg_0xa7e4448, arg_0xa7e45a8); #line 77 break; #line 77 default: #line 77 result = Attr$Attr$default$getAttr(arg_0xa7eac68, arg_0xa7e42f0, arg_0xa7e4448, arg_0xa7e45a8); #line 77 } #line 77 #line 77 return result; #line 77 } #line 77 static inline # 167 "d:/tinyos-1.x/tos/lib/Attr.nc" result_t Attr$AttrUse$getAttrValue(char *name, char *resultBuf, SchemaErrorNo *errorNo) { AttrDescPtr attrDesc = Attr$AttrUse$getAttr(name); #line 170 if (attrDesc == (void *)0) { return FAIL; } #line 172 if (attrDesc->constIdx >= 0) { nmemcpy(resultBuf, (char *)&Attr$constAttrs[(short )attrDesc->constIdx], attrDesc->nbytes); *errorNo = SCHEMA_RESULT_READY; } else { #line 178 if (Attr$Attr$getAttr(attrDesc->id, name, resultBuf, errorNo) != SUCCESS) { return FAIL; } } #line 180 if (*errorNo == SCHEMA_ERROR) { return FAIL; } #line 182 return SUCCESS; } # 91 "d:/tinyos-1.x/tos/interfaces/AttrUse.nc" inline static result_t TupleRouterM$AttrUse$getAttrValue(char *arg_0xa5e5928, char *arg_0xa5e5a80, SchemaErrorNo *arg_0xa5e5be0){ #line 91 unsigned char result; #line 91 #line 91 result = Attr$AttrUse$getAttrValue(arg_0xa5e5928, arg_0xa5e5a80, arg_0xa5e5be0); #line 91 #line 91 return result; #line 91 } #line 91 static inline # 1514 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" TinyDBError TupleRouterM$SelOperator$processedTuple(Tuple *t, ParsedQuery *q, Expr *e, bool passed) { if (!passed) { e->success = FALSE; TupleRouterM$mCurRouteQuery = TupleRouterM$nextQueryToRoute(TupleRouterM$mCurRouteQuery); } TOS_post(TupleRouterM$routeTask); return err_NoError; } # 136 "d:/tinyos-1.x/tos/lib/TinyDB/Operator.nc" inline static TinyDBError SelOperator$Operator$processedTuple(TuplePtr arg_0xa60d0b0, ParsedQueryPtr arg_0xa60d1f8, ExprPtr arg_0xa60d338, bool arg_0xa60d478){ #line 136 enum __nesc_unnamed4265 result; #line 136 #line 136 result = TupleRouterM$SelOperator$processedTuple(arg_0xa60d0b0, arg_0xa60d1f8, arg_0xa60d338, arg_0xa60d478); #line 136 #line 136 return result; #line 136 } #line 136 # 116 "d:/tinyos-1.x/tos/lib/TinyDB/TupleIntf.nc" inline static CharPtr SelOperator$TupleIntf$getFieldPtr(ParsedQueryPtr arg_0xa5fef10, TuplePtr arg_0xa5ff058, uint8_t arg_0xa5ff1a0){ #line 116 char *result; #line 116 #line 116 result = Tuple$TupleIntf$getFieldPtr(arg_0xa5fef10, arg_0xa5ff058, arg_0xa5ff1a0); #line 116 #line 116 return result; #line 116 } #line 116 #line 80 inline static uint16_t SelOperator$TupleIntf$fieldSize(ParsedQueryPtr arg_0xa605180, uint8_t arg_0xa6052c0){ #line 80 unsigned int result; #line 80 #line 80 result = Tuple$TupleIntf$fieldSize(arg_0xa605180, arg_0xa6052c0); #line 80 #line 80 return result; #line 80 } #line 80 static inline # 82 "d:/tinyos-1.x/tos/lib/TinyDB/ExprEvalC.nc" short ExprEvalC$ExprEval$evaluate(Expr *e, short fieldValue) #line 82 { short fieldOp = e->fieldOp; short fieldConst = e->fieldConst; return ExprEvalC$evaluateSimpleExpr(fieldValue, fieldOp, fieldConst); } # 70 "d:/tinyos-1.x/tos/lib/TinyDB/ExprEval.nc" inline static short SelOperator$ExprEval$evaluate(Expr *arg_0xa88daf0, short arg_0xa88dc30){ #line 70 short result; #line 70 #line 70 result = ExprEvalC$ExprEval$evaluate(arg_0xa88daf0, arg_0xa88dc30); #line 70 #line 70 return result; #line 70 } #line 70 static inline # 106 "d:/tinyos-1.x/tos/lib/TinyDB/SelOperator.nc" void SelOperator$doFilter(void) #line 106 { ParsedQuery *qs = SelOperator$mQs; Tuple *t = SelOperator$mT; Expr *e = SelOperator$mE; OpValExpr ex; short size; char *fieldBytes; short fieldVal = 0; short i; bool result = FALSE; if (! e->isStringExp) { ex = e->ex.opval; size = SelOperator$TupleIntf$fieldSize(qs, (char )ex.field); fieldBytes = SelOperator$TupleIntf$getFieldPtr(qs, t, (char )ex.field); for (i = 0; i < size; i++) { unsigned char b = * fieldBytes++; #line 126 fieldVal += (unsigned short )b << i * 8; } fieldVal = SelOperator$ExprEval$evaluate(e, fieldVal); switch (ex.op) { case EQ: result = fieldVal == ex.value; break; case NEQ: result = fieldVal != ex.value; break; case GT: result = fieldVal > ex.value; break; case GE: result = fieldVal >= ex.value; break; case LT: result = fieldVal < ex.value; break; case LE: result = fieldVal <= ex.value; break; } } else #line 151 { StringExpr sex = e->ex.sexp; int strCmpVal; #line 155 { } #line 155 ; size = SelOperator$TupleIntf$fieldSize(qs, (char )sex.field); fieldBytes = SelOperator$TupleIntf$getFieldPtr(qs, t, (char )ex.field); strCmpVal = strcmp(sex.s, fieldBytes); if (strCmpVal == 0) { result = (sex.op == LE || sex.op == EQ) || sex.op == GE; } else { #line 161 if (strCmpVal < 0) { result = (sex.op == GT || sex.op == GE) || sex.op == NEQ; } else { #line 163 result = (sex.op == LT || sex.op == LE) || sex.op == NEQ; } } } SelOperator$Operator$processedTuple(t, qs, e, result); } static inline #line 94 TinyDBError SelOperator$Operator$processTuple(ParsedQueryPtr qs, TuplePtr t, ExprPtr e) #line 94 { SelOperator$mQs = qs; SelOperator$mT = t; SelOperator$mE = e; TOS_post(SelOperator$doFilter); return err_NoError; } # 88 "d:/tinyos-1.x/tos/lib/TinyDB/Operator.nc" inline static TinyDBError TupleRouterM$SelOperator$processTuple(ParsedQueryPtr arg_0xa60e468, TuplePtr arg_0xa60e5b0, ExprPtr arg_0xa60e6f0){ #line 88 enum __nesc_unnamed4265 result; #line 88 #line 88 result = SelOperator$Operator$processTuple(arg_0xa60e468, arg_0xa60e5b0, arg_0xa60e6f0); #line 88 #line 88 return result; #line 88 } #line 88 static inline # 391 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQuery.nc" TinyDBError ParsedQuery$AggOperator$processedTuple(TuplePtr t, ParsedQueryPtr q, ExprPtr e, bool passed) #line 391 { return err_NoError; } static inline # 1537 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" TinyDBError TupleRouterM$AggOperator$processedTuple(Tuple *t, ParsedQuery *q, Expr *e, bool passed) { TOS_post(TupleRouterM$routeTask); return err_NoError; } # 136 "d:/tinyos-1.x/tos/lib/TinyDB/Operator.nc" inline static TinyDBError AggOperator$Operator$processedTuple(TuplePtr arg_0xa60d0b0, ParsedQueryPtr arg_0xa60d1f8, ExprPtr arg_0xa60d338, bool arg_0xa60d478){ #line 136 enum __nesc_unnamed4265 result; #line 136 #line 136 result = TupleRouterM$AggOperator$processedTuple(arg_0xa60d0b0, arg_0xa60d1f8, arg_0xa60d338, arg_0xa60d478); #line 136 result = ParsedQuery$AggOperator$processedTuple(arg_0xa60d0b0, arg_0xa60d1f8, arg_0xa60d338, arg_0xa60d478); #line 136 #line 136 return result; #line 136 } #line 136 static inline # 131 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinAvgM.nc" void WinAvgM$addData(WinAvgM$TemporalAverageData *tad, int16_t sum, uint16_t count) #line 131 { tad->value[tad->tail].sum = sum; tad->value[tad->tail].count = count; tad->tail = (tad->tail + 1) % tad->size; if (tad->nvals == tad->size) { tad->head = (tad->head + 1) % tad->size; } else { #line 138 tad->nvals++; } } static inline #line 55 result_t WinAvgM$Aggregate$update(char *destdata, char *value, ParamList *params, ParamVals *paramValues) #line 55 { WinAvgM$TemporalAverageData *dest = (WinAvgM$TemporalAverageData *)destdata; int16_t val = * (int16_t *)value; uint8_t epochsPerWindow = getEpochsPerWindow(paramValues); uint8_t slidingDist = getSlidingDist(paramValues); dest->lastResult.sum += val; dest->lastResult.count++; if (epochsPerWindow > slidingDist) { #line 65 WinAvgM$addData(dest, val, 1); } return SUCCESS; } static inline # 36 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinSumM.nc" result_t WinSumM$Aggregate$update(char *destdata, char *value, ParamList *params, ParamVals *paramValues) #line 36 { TemporalAlgebraicData *dest = (TemporalAlgebraicData *)destdata; int16_t val = * (int16_t *)value; uint8_t epochsPerWindow = getEpochsPerWindow(paramValues); uint8_t slidingDist = getSlidingDist(paramValues); dest->lastResult.value += val; if (epochsPerWindow > slidingDist) { #line 45 addValueToTemporalAggState(dest, val); } return SUCCESS; } static inline # 36 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinCountM.nc" result_t WinCountM$Aggregate$update(char *destdata, char *value, ParamList *params, ParamVals *paramValues) #line 36 { TemporalAlgebraicData *dest = (TemporalAlgebraicData *)destdata; uint8_t epochsPerWindow = getEpochsPerWindow(paramValues); uint8_t slidingDist = getSlidingDist(paramValues); dest->lastResult.value++; if (epochsPerWindow > slidingDist) { #line 44 addValueToTemporalAggState(dest, 1); } return SUCCESS; } static inline # 42 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinMaxM.nc" result_t WinMaxM$Aggregate$update(char *destdata, char *value, ParamList *params, ParamVals *paramValues) #line 42 { TemporalAlgebraicData *dest = (TemporalAlgebraicData *)destdata; int16_t val = * (int16_t *)value; uint8_t epochsPerWindow = getEpochsPerWindow(paramValues); uint8_t slidingDist = getSlidingDist(paramValues); if (dest->lastResult.value < val) { dest->lastResult.value = val; dest->lastResult.id = TOS_LOCAL_ADDRESS; } if (epochsPerWindow > slidingDist) { #line 54 addValueToTemporalAggState(dest, val); } return SUCCESS; } static inline # 41 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinMinM.nc" result_t WinMinM$Aggregate$update(char *destdata, char *value, ParamList *params, ParamVals *paramValues) #line 41 { TemporalAlgebraicData *dest = (TemporalAlgebraicData *)destdata; int16_t val = * (int16_t *)value; uint8_t epochsPerWindow = getEpochsPerWindow(paramValues); uint8_t slidingDist = getSlidingDist(paramValues); if (dest->lastResult.value > val) { dest->lastResult.value = val; dest->lastResult.id = TOS_LOCAL_ADDRESS; } if (epochsPerWindow > slidingDist) { #line 53 addValueToTemporalAggState(dest, val); } return SUCCESS; } static inline # 157 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/Aggregates.h" uint8_t getNewBitsPerSample(ParamVals *v) #line 157 { return * (uint8_t *)v->paramDataPtr[kNEW_BITS_PER_SAMPLE]; } static inline # 32 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/ExpAvgM.nc" result_t ExpAvgM$Aggregate$update(char *destdata, char *value, ParamList *params, ParamVals *paramValues) #line 32 { ExpAvgM$ExpAvgData *dest = (ExpAvgM$ExpAvgData *)destdata; int16_t val = * (int16_t *)value; uint8_t newBits = 16 - getNewBitsPerSample(paramValues); dest->value = dest->value - (dest->value >> newBits) + (val >> newBits); return SUCCESS; } static inline # 26 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AvgM.nc" result_t AvgM$Aggregate$update(char *destdata, char *value, ParamList *params, ParamVals *paramValues) #line 26 { AverageData *dest = (AverageData *)destdata; int16_t val = * (int16_t *)value; dest->sum += val; dest->count++; return SUCCESS; } static inline # 27 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/SumM.nc" result_t SumM$Aggregate$update(char *destdata, char *value, ParamList *params, ParamVals *paramValues) #line 27 { AlgebraicData *dest = (AlgebraicData *)destdata; int16_t val = * (int16_t *)value; #line 30 dest->value += val; return SUCCESS; } static inline # 27 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/CountM.nc" result_t CountM$Aggregate$update(char *destdata, char *value, ParamList *params, ParamVals *paramValues) #line 27 { AlgebraicData *dest = (AlgebraicData *)destdata; dest->value++; return SUCCESS; } static inline # 30 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/MinM.nc" result_t MinM$Aggregate$update(char *destdata, char *value, ParamList *params, ParamVals *paramValues) #line 30 { AlgebraicData *dest = (AlgebraicData *)destdata; int16_t val = * (int16_t *)value; if (dest->value > val) { dest->value = val; dest->id = TOS_LOCAL_ADDRESS; } return SUCCESS; } static inline # 30 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/MaxM.nc" result_t MaxM$Aggregate$update(char *destdata, char *value, ParamList *params, ParamVals *paramValues) #line 30 { AlgebraicData *dest = (AlgebraicData *)destdata; int16_t val = * (int16_t *)value; if (dest->value < val) { dest->value = val; dest->id = TOS_LOCAL_ADDRESS; } return SUCCESS; } static inline # 59 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AggregateUseM.nc" result_t AggregateUseM$Agg$default$update(uint8_t id, char *destdata, char *value, ParamList *params, ParamVals *paramValues) #line 60 { return SUCCESS; } # 80 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/Aggregate.nc" inline static result_t AggregateUseM$Agg$update(uint8_t arg_0xa9500a0, char *arg_0xa9516c8, char *arg_0xa951818, ParamList *arg_0xa951978, ParamVals *arg_0xa951ae0){ #line 80 unsigned char result; #line 80 #line 80 switch (arg_0xa9500a0) { #line 80 case kSUM: #line 80 result = SumM$Aggregate$update(arg_0xa9516c8, arg_0xa951818, arg_0xa951978, arg_0xa951ae0); #line 80 break; #line 80 case kMIN: #line 80 result = MinM$Aggregate$update(arg_0xa9516c8, arg_0xa951818, arg_0xa951978, arg_0xa951ae0); #line 80 break; #line 80 case kMAX: #line 80 result = MaxM$Aggregate$update(arg_0xa9516c8, arg_0xa951818, arg_0xa951978, arg_0xa951ae0); #line 80 break; #line 80 case kCOUNT: #line 80 result = CountM$Aggregate$update(arg_0xa9516c8, arg_0xa951818, arg_0xa951978, arg_0xa951ae0); #line 80 break; #line 80 case kAVG: #line 80 result = AvgM$Aggregate$update(arg_0xa9516c8, arg_0xa951818, arg_0xa951978, arg_0xa951ae0); #line 80 break; #line 80 case kEXP_AVG: #line 80 result = ExpAvgM$Aggregate$update(arg_0xa9516c8, arg_0xa951818, arg_0xa951978, arg_0xa951ae0); #line 80 break; #line 80 case kWIN_AVG: #line 80 result = WinAvgM$Aggregate$update(arg_0xa9516c8, arg_0xa951818, arg_0xa951978, arg_0xa951ae0); #line 80 break; #line 80 case kWIN_SUM: #line 80 result = WinSumM$Aggregate$update(arg_0xa9516c8, arg_0xa951818, arg_0xa951978, arg_0xa951ae0); #line 80 break; #line 80 case kWIN_MIN: #line 80 result = WinMinM$Aggregate$update(arg_0xa9516c8, arg_0xa951818, arg_0xa951978, arg_0xa951ae0); #line 80 break; #line 80 case kWIN_MAX: #line 80 result = WinMaxM$Aggregate$update(arg_0xa9516c8, arg_0xa951818, arg_0xa951978, arg_0xa951ae0); #line 80 break; #line 80 case kWIN_COUNT: #line 80 result = WinCountM$Aggregate$update(arg_0xa9516c8, arg_0xa951818, arg_0xa951978, arg_0xa951ae0); #line 80 break; #line 80 default: #line 80 result = AggregateUseM$Agg$default$update(arg_0xa9500a0, arg_0xa9516c8, arg_0xa951818, arg_0xa951978, arg_0xa951ae0); #line 80 } #line 80 #line 80 return result; #line 80 } #line 80 static inline # 26 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AggregateUseM.nc" result_t AggregateUseM$AggregateUse$update(uint8_t id, char *destdata, char *value, ParamList *params, ParamVals *paramValues) #line 26 { return AggregateUseM$Agg$update(id, destdata, value, params, paramValues); } # 81 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AggregateUse.nc" inline static result_t AggOperator$AggregateUse$update(uint8_t arg_0xa928428, char *arg_0xa928578, char *arg_0xa9286c8, ParamList *arg_0xa928828, ParamVals *arg_0xa928990){ #line 81 unsigned char result; #line 81 #line 81 result = AggregateUseM$AggregateUse$update(arg_0xa928428, arg_0xa928578, arg_0xa9286c8, arg_0xa928828, arg_0xa928990); #line 81 #line 81 return result; #line 81 } #line 81 static inline # 175 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/Aggregates.h" void setCurrentEpoch(ParamVals *v, uint16_t curEpoch) #line 175 { * (uint16_t *)v->paramDataPtr[kCURRENT_EPOCH] = curEpoch; } # 70 "d:/tinyos-1.x/tos/lib/TinyDB/ExprEval.nc" inline static short AggOperator$ExprEval$evaluate(Expr *arg_0xa88daf0, short arg_0xa88dc30){ #line 70 short result; #line 70 #line 70 result = ExprEvalC$ExprEval$evaluate(arg_0xa88daf0, arg_0xa88dc30); #line 70 #line 70 return result; #line 70 } #line 70 static inline # 630 "d:/tinyos-1.x/tos/lib/TinyDB/AggOperator.nc" void AggOperator$updateAggregateValue(AggOperator$GroupRecord *d, Expr *e, short fieldValue) #line 630 { ParamVals paramVals; #line 632 setParamValues(¶mVals, e); fieldValue = AggOperator$ExprEval$evaluate(e, fieldValue); d->u.empty = FALSE; if (e->ex.agg.op == kADP_DELTA) { setCurrentEpoch(¶mVals, AggOperator$mCurQuery->currentEpoch); } AggOperator$AggregateUse$update(e->ex.agg.op, d->aggdata, (char *)&fieldValue, (void *)0, ¶mVals); } # 80 "d:/tinyos-1.x/tos/lib/TinyDB/TupleIntf.nc" inline static uint16_t AggOperator$TupleIntf$fieldSize(ParsedQueryPtr arg_0xa605180, uint8_t arg_0xa6052c0){ #line 80 unsigned int result; #line 80 #line 80 result = Tuple$TupleIntf$fieldSize(arg_0xa605180, arg_0xa6052c0); #line 80 #line 80 return result; #line 80 } #line 80 #line 116 inline static CharPtr AggOperator$TupleIntf$getFieldPtr(ParsedQueryPtr arg_0xa5fef10, TuplePtr arg_0xa5ff058, uint8_t arg_0xa5ff1a0){ #line 116 char *result; #line 116 #line 116 result = Tuple$TupleIntf$getFieldPtr(arg_0xa5fef10, arg_0xa5ff058, arg_0xa5ff1a0); #line 116 #line 116 return result; #line 116 } #line 116 static inline # 349 "d:/tinyos-1.x/tos/lib/TinyDB/AggOperator.nc" void AggOperator$updateGroupForTuple(AggOperator$GroupRecord *d) #line 349 { Tuple *t = AggOperator$mCurTuple; Expr *e = AggOperator$mCurExpr; ParsedQuery *q = AggOperator$mCurQuery; char *fieldBytes = AggOperator$TupleIntf$getFieldPtr(q, t, (char )e->ex.agg.field); short size = AggOperator$TupleIntf$fieldSize(q, (char )e->ex.agg.field); short fieldVal = 0; short i; for (i = 0; i < size; i++) { unsigned char b = * fieldBytes++; #line 360 fieldVal += (unsigned short )b << i * 8; } AggOperator$updateAggregateValue(d, e, fieldVal); AggOperator$Operator$processedTuple(t, q, AggOperator$mCurExpr, TRUE); } static inline # 89 "d:/tinyos-1.x/tos/lib/TinyDB/ExprEvalC.nc" short ExprEvalC$ExprEval$evaluateGroupBy(AggregateExpression a, short grpByFieldValue) #line 89 { short grpByFieldOp = a.groupFieldOp; short grpByFieldConst = a.groupFieldConst; return ExprEvalC$evaluateSimpleExpr(grpByFieldValue, grpByFieldOp, grpByFieldConst); } # 73 "d:/tinyos-1.x/tos/lib/TinyDB/ExprEval.nc" inline static short AggOperator$ExprEval$evaluateGroupBy(AggregateExpression arg_0xa886060, short arg_0xa8861a0){ #line 73 short result; #line 73 #line 73 result = ExprEvalC$ExprEval$evaluateGroupBy(arg_0xa886060, arg_0xa8861a0); #line 73 #line 73 return result; #line 73 } #line 73 static inline # 556 "d:/tinyos-1.x/tos/lib/TinyDB/AggOperator.nc" short AggOperator$getGroupNo(Tuple *t, ParsedQuery *q, Expr *e) #line 556 { char *fieldBytes; short size; short fieldVal = 0; short i; #line 561 if (e->ex.agg.groupingField == (short )kNO_GROUPING_FIELD) { #line 561 return 0; } fieldBytes = AggOperator$TupleIntf$getFieldPtr(q, t, (char )e->ex.agg.groupingField); size = AggOperator$TupleIntf$fieldSize(q, (char )e->ex.agg.groupingField); for (i = 0; i < size; i++) { unsigned char b = * fieldBytes++; #line 570 fieldVal += (unsigned short )b << i * 8; } return AggOperator$ExprEval$evaluateGroupBy(e->ex.agg, fieldVal); } static inline #line 300 TinyDBError AggOperator$Operator$processTuple(ParsedQueryPtr qs, TuplePtr t, ExprPtr e) #line 300 { AggOperator$mCurExpr = e; AggOperator$mCurQuery = qs; AggOperator$mCurTuple = t; { } #line 304 ; if (e->opState == (OperatorStateHandle )AggOperator$QUERY_DONE_STATE) { #line 305 return err_NoError; } #line 306 AggOperator$getGroupData(qs, AggOperator$getGroupNo(t, qs, e), e, &AggOperator$updateGroupForTuple); return err_NoError; } # 88 "d:/tinyos-1.x/tos/lib/TinyDB/Operator.nc" inline static TinyDBError TupleRouterM$AggOperator$processTuple(ParsedQueryPtr arg_0xa60e468, TuplePtr arg_0xa60e5b0, ExprPtr arg_0xa60e6f0){ #line 88 enum __nesc_unnamed4265 result; #line 88 #line 88 result = AggOperator$Operator$processTuple(arg_0xa60e468, arg_0xa60e5b0, arg_0xa60e6f0); #line 88 #line 88 return result; #line 88 } #line 88 static inline # 2715 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" bool TupleRouterM$routeToQuery(ParsedQuery *q, Tuple *t) #line 2715 { Expr *e = TupleRouterM$nextExpr(q); if (e != (void *)0) { e->success = TRUE; if (e->opType != kSEL) { TupleRouterM$AggOperator$processTuple(q, t, e); } else #line 2722 { TupleRouterM$SelOperator$processTuple(q, t, e); } return TRUE; } else #line 2726 { return FALSE; } } # 85 "d:/tinyos-1.x/tos/interfaces/MemAlloc.nc" inline static result_t AggOperator$MemAlloc$allocate(HandlePtr arg_0xa60bd50, int16_t arg_0xa60be90){ #line 85 unsigned char result; #line 85 #line 85 result = TinyAlloc$MemAlloc$allocate(arg_0xa60bd50, arg_0xa60be90); #line 85 #line 85 return result; #line 85 } #line 85 static inline # 102 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinAvgM.nc" uint16_t WinAvgM$Aggregate$stateSize(ParamList *params, ParamVals *paramValues) #line 102 { uint8_t epochsPerWindow = getEpochsPerWindow(paramValues); uint8_t slidingDist = getSlidingDist(paramValues); WinAvgM$TemporalAverageData tad; uint16_t size = sizeof tad; if (epochsPerWindow > slidingDist) { size = size - sizeof tad.value + (epochsPerWindow - slidingDist) * sizeof tad.value[0]; } return size; } static inline # 80 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinSumM.nc" uint16_t WinSumM$Aggregate$stateSize(ParamList *params, ParamVals *paramValues) #line 80 { uint8_t epochsPerWindow = getEpochsPerWindow(paramValues); uint8_t slidingDist = getSlidingDist(paramValues); TemporalAlgebraicData tad; uint16_t size = sizeof tad; if (epochsPerWindow > slidingDist) { size = size - sizeof tad.value + (epochsPerWindow - slidingDist) * sizeof tad.value[0]; } return size; } static inline # 80 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinCountM.nc" uint16_t WinCountM$Aggregate$stateSize(ParamList *params, ParamVals *paramValues) #line 80 { uint8_t epochsPerWindow = getEpochsPerWindow(paramValues); uint8_t slidingDist = getSlidingDist(paramValues); TemporalAlgebraicData tad; uint16_t size = sizeof tad; if (epochsPerWindow > slidingDist) { size = size - sizeof tad.value + (epochsPerWindow - slidingDist) * sizeof tad.value[0]; } return size; } static inline # 90 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinMaxM.nc" uint16_t WinMaxM$Aggregate$stateSize(ParamList *params, ParamVals *paramValues) #line 90 { uint8_t epochsPerWindow = getEpochsPerWindow(paramValues); uint8_t slidingDist = getSlidingDist(paramValues); TemporalAlgebraicData tad; uint16_t size = sizeof tad; if (epochsPerWindow > slidingDist) { size = size - sizeof tad.value + (epochsPerWindow - slidingDist) * sizeof tad.value[0]; } return size; } static inline # 89 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinMinM.nc" uint16_t WinMinM$Aggregate$stateSize(ParamList *params, ParamVals *paramValues) #line 89 { uint8_t epochsPerWindow = getEpochsPerWindow(paramValues); uint8_t slidingDist = getSlidingDist(paramValues); TemporalAlgebraicData tad; uint16_t size = sizeof tad; if (epochsPerWindow > slidingDist) { size = size - sizeof tad.value[0] + (epochsPerWindow - slidingDist) * sizeof tad.value[0]; } return size; } static inline # 53 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/ExpAvgM.nc" uint16_t ExpAvgM$Aggregate$stateSize(ParamList *params, ParamVals *paramValues) #line 53 { return sizeof(ExpAvgM$ExpAvgData ); } static inline # 45 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AvgM.nc" uint16_t AvgM$Aggregate$stateSize(ParamList *params, ParamVals *paramValues) #line 45 { return sizeof(AverageData ); } static inline # 44 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/SumM.nc" uint16_t SumM$Aggregate$stateSize(ParamList *params, ParamVals *paramValues) #line 44 { return sizeof(AlgebraicData ); } static inline # 44 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/CountM.nc" uint16_t CountM$Aggregate$stateSize(ParamList *params, ParamVals *paramValues) #line 44 { return sizeof(AlgebraicData ); } static inline # 52 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/MinM.nc" uint16_t MinM$Aggregate$stateSize(ParamList *params, ParamVals *paramValues) #line 52 { return sizeof(AlgebraicData ); } static inline # 52 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/MaxM.nc" uint16_t MaxM$Aggregate$stateSize(ParamList *params, ParamVals *paramValues) #line 52 { return sizeof(AlgebraicData ); } static inline # 69 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AggregateUseM.nc" uint16_t AggregateUseM$Agg$default$stateSize(uint8_t id, ParamList *params, ParamVals *paramValues) #line 70 { return 0; } # 97 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/Aggregate.nc" inline static uint16_t AggregateUseM$Agg$stateSize(uint8_t arg_0xa9500a0, ParamList *arg_0xa983050, ParamVals *arg_0xa9831b8){ #line 97 unsigned int result; #line 97 #line 97 switch (arg_0xa9500a0) { #line 97 case kSUM: #line 97 result = SumM$Aggregate$stateSize(arg_0xa983050, arg_0xa9831b8); #line 97 break; #line 97 case kMIN: #line 97 result = MinM$Aggregate$stateSize(arg_0xa983050, arg_0xa9831b8); #line 97 break; #line 97 case kMAX: #line 97 result = MaxM$Aggregate$stateSize(arg_0xa983050, arg_0xa9831b8); #line 97 break; #line 97 case kCOUNT: #line 97 result = CountM$Aggregate$stateSize(arg_0xa983050, arg_0xa9831b8); #line 97 break; #line 97 case kAVG: #line 97 result = AvgM$Aggregate$stateSize(arg_0xa983050, arg_0xa9831b8); #line 97 break; #line 97 case kEXP_AVG: #line 97 result = ExpAvgM$Aggregate$stateSize(arg_0xa983050, arg_0xa9831b8); #line 97 break; #line 97 case kWIN_AVG: #line 97 result = WinAvgM$Aggregate$stateSize(arg_0xa983050, arg_0xa9831b8); #line 97 break; #line 97 case kWIN_SUM: #line 97 result = WinSumM$Aggregate$stateSize(arg_0xa983050, arg_0xa9831b8); #line 97 break; #line 97 case kWIN_MIN: #line 97 result = WinMinM$Aggregate$stateSize(arg_0xa983050, arg_0xa9831b8); #line 97 break; #line 97 case kWIN_MAX: #line 97 result = WinMaxM$Aggregate$stateSize(arg_0xa983050, arg_0xa9831b8); #line 97 break; #line 97 case kWIN_COUNT: #line 97 result = WinCountM$Aggregate$stateSize(arg_0xa983050, arg_0xa9831b8); #line 97 break; #line 97 default: #line 97 result = AggregateUseM$Agg$default$stateSize(arg_0xa9500a0, arg_0xa983050, arg_0xa9831b8); #line 97 } #line 97 #line 97 return result; #line 97 } #line 97 static inline # 35 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AggregateUseM.nc" uint16_t AggregateUseM$AggregateUse$stateSize(uint8_t id, ParamList *params, ParamVals *paramValues) #line 35 { return AggregateUseM$Agg$stateSize(id, params, paramValues); } # 89 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AggregateUse.nc" inline static uint16_t AggOperator$AggregateUse$stateSize(uint8_t arg_0xa929790, ParamList *arg_0xa9298f0, ParamVals *arg_0xa929a58){ #line 89 unsigned int result; #line 89 #line 89 result = AggregateUseM$AggregateUse$stateSize(arg_0xa929790, arg_0xa9298f0, arg_0xa929a58); #line 89 #line 89 return result; #line 89 } #line 89 static inline # 423 "d:/tinyos-1.x/tos/lib/TinyDB/AggOperator.nc" AggOperator$GroupRecord *AggOperator$findGroup(AggOperator$GroupDataHandle dh, short groupNum) #line 423 { short min = 0; #line 424 short max = (*dh)->numGroups; AggOperator$GroupRecord *gr; if (max == 0) { #line 427 return (void *)0; } #line 428 while (TRUE) { gr = AggOperator$GET_GROUP_DATA(dh, min); if (gr->groupNo == groupNum) { #line 430 return gr; } if (max == min + 1) { #line 432 break; } if (gr->groupNo > groupNum) { max = max - ((max - min) >> 1); } else { #line 437 min = min + ((max - min) >> 1); } } #line 439 return (void *)0; } # 97 "d:/tinyos-1.x/tos/interfaces/MemAlloc.nc" inline static result_t AggOperator$MemAlloc$reallocate(Handle arg_0xa6083e0, int16_t arg_0xa608520){ #line 97 unsigned char result; #line 97 #line 97 result = TinyAlloc$MemAlloc$reallocate(arg_0xa6083e0, arg_0xa608520); #line 97 #line 97 return result; #line 97 } #line 97 static inline # 367 "d:/tinyos-1.x/tos/lib/TinyDB/QueryResult.nc" result_t QueryResult$MemAlloc$reallocComplete(Handle handle, result_t success) #line 367 { return SUCCESS; } static inline # 166 "d:/tinyos-1.x/tos/lib/TinyDB/TinyDBAttrM.nc" result_t TinyDBAttrM$MemAlloc$reallocComplete(Handle handle, result_t success) { return SUCCESS; } # 194 "d:/tinyos-1.x/tos/interfaces/MemAlloc.nc" inline static result_t TinyAlloc$MemAlloc$reallocComplete(Handle arg_0xa624f58, result_t arg_0xa6250a0){ #line 194 unsigned char result; #line 194 #line 194 result = TinyDBAttrM$MemAlloc$reallocComplete(arg_0xa624f58, arg_0xa6250a0); #line 194 result = rcombine(result, AggOperator$MemAlloc$reallocComplete(arg_0xa624f58, arg_0xa6250a0)); #line 194 result = rcombine(result, TupleRouterM$MemAlloc$reallocComplete(arg_0xa624f58, arg_0xa6250a0)); #line 194 result = rcombine(result, DBBufferC$MemAlloc$reallocComplete(arg_0xa624f58, arg_0xa6250a0)); #line 194 result = rcombine(result, QueryResult$MemAlloc$reallocComplete(arg_0xa624f58, arg_0xa6250a0)); #line 194 result = rcombine(result, TableM$MemAlloc$reallocComplete(arg_0xa624f58, arg_0xa6250a0)); #line 194 #line 194 return result; #line 194 } #line 194 static inline # 534 "d:/tinyos-1.x/tos/lib/TinyAlloc.nc" void TinyAlloc$reallocDone(void) #line 534 { TinyAlloc$MemAlloc$reallocComplete(TinyAlloc$mOldHandle, SUCCESS); } static inline #line 595 int8_t TinyAlloc$isLocked(int8_t *ptr) #line 595 { return (((int16_t *)(ptr - TinyAlloc$HEADER_SIZE))[0] & 0x8000) != 0; } static inline # 410 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$UNSET_ROUTING_TUPLES(void) #line 410 { #line 410 TupleRouterM$mPendingMask &= TupleRouterM$ROUTING_BIT ^ 0xFFFF; } # 146 "d:/tinyos-1.x/tos/interfaces/MemAlloc.nc" inline static int16_t TableM$MemAlloc$size(Handle arg_0xa609bd0){ #line 146 int result; #line 146 #line 146 result = TinyAlloc$MemAlloc$size(arg_0xa609bd0); #line 146 #line 146 return result; #line 146 } #line 146 static inline # 191 "d:/tinyos-1.x/tos/lib/TinyDB/TableM.nc" uint8_t TableM$totalNameSize(ParsedQuery *pq) #line 191 { return TableM$MemAlloc$size((Handle )pq->tableInfo) - pq->numFields; } static inline # 302 "d:/tinyos-1.x/tos/lib/TinyDB/Tuple.nc" result_t Tuple$Table$addNamedFieldDone(result_t success) #line 302 { return SUCCESS; } static inline # 395 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQuery.nc" result_t ParsedQuery$Table$addNamedFieldDone(result_t success) #line 395 { return SUCCESS; } static inline # 3378 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" result_t TupleRouterM$Table$addNamedFieldDone(result_t success) #line 3378 { TupleRouterM$continueParsing(success); return SUCCESS; } # 76 "d:/tinyos-1.x/tos/lib/TinyDB/Table.nc" inline static result_t TableM$Table$addNamedFieldDone(result_t arg_0xa63b9e0){ #line 76 unsigned char result; #line 76 #line 76 result = TupleRouterM$Table$addNamedFieldDone(arg_0xa63b9e0); #line 76 result = rcombine(result, ParsedQuery$Table$addNamedFieldDone(arg_0xa63b9e0)); #line 76 result = rcombine(result, Tuple$Table$addNamedFieldDone(arg_0xa63b9e0)); #line 76 #line 76 return result; #line 76 } #line 76 # 97 "d:/tinyos-1.x/tos/interfaces/MemAlloc.nc" inline static result_t TupleRouterM$MemAlloc$reallocate(Handle arg_0xa6083e0, int16_t arg_0xa608520){ #line 97 unsigned char result; #line 97 #line 97 result = TinyAlloc$MemAlloc$reallocate(arg_0xa6083e0, arg_0xa608520); #line 97 #line 97 return result; #line 97 } #line 97 # 75 "d:/tinyos-1.x/tos/lib/TinyDB/TupleIntf.nc" inline static uint16_t TupleRouterM$TupleIntf$tupleSize(ParsedQueryPtr arg_0xa604d30){ #line 75 unsigned int result; #line 75 #line 75 result = Tuple$TupleIntf$tupleSize(arg_0xa604d30); #line 75 #line 75 return result; #line 75 } #line 75 # 146 "d:/tinyos-1.x/tos/interfaces/MemAlloc.nc" inline static int16_t TupleRouterM$MemAlloc$size(Handle arg_0xa609bd0){ #line 146 int result; #line 146 #line 146 result = TinyAlloc$MemAlloc$size(arg_0xa609bd0); #line 146 #line 146 return result; #line 146 } #line 146 static inline # 3101 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" bool TupleRouterM$reallocQueryForTuple(TupleRouterM$MemoryCallback callback, TupleRouterM$QueryListHandle qlh) #line 3101 { ParsedQuery *q = & (*qlh)->q; short size = TupleRouterM$MemAlloc$size((Handle )qlh) + TupleRouterM$TupleIntf$tupleSize(q); { } #line 3106 ; TupleRouterM$mAllocState = TupleRouterM$STATE_RESIZE_QUERY; TupleRouterM$mAllocCallback = callback; { } #line 3109 ; return TupleRouterM$MemAlloc$reallocate((Handle )qlh, size); } # 155 "d:/tinyos-1.x/tos/lib/TinyDB/DBBuffer.nc" inline static TinyDBError TupleRouterM$DBBuffer$alloc(uint8_t arg_0xa642bd8, BufferType arg_0xa642d20, uint16_t arg_0xa642e68, BufferPolicy arg_0xa642fb0, ParsedQuery *arg_0xa643120, char *arg_0xa643270, bool *arg_0xa6433c8, long arg_0xa643500){ #line 155 enum __nesc_unnamed4265 result; #line 155 #line 155 result = DBBufferC$DBBuffer$alloc(arg_0xa642bd8, arg_0xa642d20, arg_0xa642e68, arg_0xa642fb0, arg_0xa643120, arg_0xa643270, arg_0xa6433c8, arg_0xa643500); #line 155 #line 155 return result; #line 155 } #line 155 #line 170 inline static TinyDBError TupleRouterM$DBBuffer$nextUnusedBuffer(uint8_t *arg_0xa640ba8){ #line 170 enum __nesc_unnamed4265 result; #line 170 #line 170 result = DBBufferC$DBBuffer$nextUnusedBuffer(arg_0xa640ba8); #line 170 #line 170 return result; #line 170 } #line 170 # 65 "d:/tinyos-1.x/tos/interfaces/CommandUse.nc" inline static CommandDescPtr TupleRouterM$CommandUse$getCommand(char *arg_0xa345b78){ #line 65 struct __nesc_unnamed4310 *result; #line 65 #line 65 result = Command$CommandUse$getCommand(arg_0xa345b78); #line 65 #line 65 return result; #line 65 } #line 65 static inline # 1302 "d:/tinyos-1.x/tos/lib/TinyDB/DBBufferC.nc" TinyDBError DBBufferC$DBBuffer$openBuffer(uint8_t bufIdx, bool *pending) #line 1302 { DBBufferC$Buffer *buf; if (bufIdx >= DBBufferC$kNUM_BUFS || !(DBBufferC$mUsedBufs & (1 << bufIdx))) { return err_IndexOutOfBounds; } if (DBBufferC$mState == DBBufferC$kIDLE) { DBBufferC$mState = DBBufferC$kOPEN_BUFFER; DBBufferC$mCurBuffer = bufIdx; } else { #line 1312 return err_ResultBufferBusy; } buf = &DBBufferC$mBuffers[bufIdx]; if (buf->type == kEEPROM) { DBBufferC$mState = DBBufferC$kIDLE; *pending = FALSE; return err_NoMatchbox; } else { *pending = FALSE; DBBufferC$mState = DBBufferC$kIDLE; return err_NoError; } } # 193 "d:/tinyos-1.x/tos/lib/TinyDB/DBBuffer.nc" inline static TinyDBError TupleRouterM$DBBuffer$openBuffer(uint8_t arg_0xa63e528, bool *arg_0xa63e680){ #line 193 enum __nesc_unnamed4265 result; #line 193 #line 193 result = DBBufferC$DBBuffer$openBuffer(arg_0xa63e528, arg_0xa63e680); #line 193 #line 193 return result; #line 193 } #line 193 static inline # 444 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$SET_OPENING_WRITE_BUF(void) #line 444 { #line 444 TupleRouterM$mPendingMask |= TupleRouterM$OPENING_WRITE_BUF_BIT; } # 188 "d:/tinyos-1.x/tos/lib/TinyDB/DBBuffer.nc" inline static TinyDBError TupleRouterM$DBBuffer$getBufferIdFromName(char *arg_0xa6418c0, uint8_t *arg_0xa641a20){ #line 188 enum __nesc_unnamed4265 result; #line 188 #line 188 result = DBBufferC$DBBuffer$getBufferIdFromName(arg_0xa6418c0, arg_0xa641a20); #line 188 #line 188 return result; #line 188 } #line 188 static inline # 1063 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$resizedCallback(Handle *memory) #line 1063 { TupleRouterM$QueryListHandle h = (TupleRouterM$QueryListHandle )*memory; ParsedQuery *pq = & (*h)->q; bool pending = FALSE; TinyDBError err = err_NoError; { } #line 1069 ; switch (pq->bufferType) { case kRADIO: pq->bufferId = kRADIO_BUFFER; break; case kRAM: case kEEPROM: { RamBufInfo *ram = & pq->buf.ram; if (ram->hasOutput) { TupleRouterM$mTempPQ = pq; if (strlen(ram->outBufName) != 0 && ! ram->create) { err = TupleRouterM$DBBuffer$getBufferIdFromName(ram->outBufName, & pq->bufferId); if (err != err_NoError) { TupleRouterM$SET_OPENING_WRITE_BUF(); err = err_NoMatchbox; if (err != err_NoError) { TupleRouterM$signalError(err, 1100); goto fail; } else { #line 1103 pending = TRUE; } } if (!pending) { TupleRouterM$DBBuffer$openBuffer(pq->bufferId, &pending); } } else { err = TupleRouterM$DBBuffer$nextUnusedBuffer(& pq->bufferId); if (err == err_NoError) { err = TupleRouterM$DBBuffer$alloc(pq->bufferId, pq->bufferType, ram->numRows, ram->policy, pq, ram->outBufName, &pending, 0); } } TupleRouterM$mTempPQ = pq; if (!pending) { TupleRouterM$finishedOpeningWriteBuffer(pq); } return; } else { pq->bufferId = kRADIO_BUFFER; } } break; case kCOMMAND: { long cmd_param; uint8_t *cmd_buf = (uint8_t *)&cmd_param; CommandDescPtr cmd = TupleRouterM$CommandUse$getCommand(pq->buf.cmd.name); if (cmd == (void *)0) { TupleRouterM$signalError(err_UnknownCommand, 1142); goto fail; } cmd_buf[0] = cmd->idx; * (short *)&cmd_buf[1] = pq->buf.cmd.param; err = TupleRouterM$DBBuffer$nextUnusedBuffer(& pq->bufferId); if (err == err_NoError) { err = TupleRouterM$DBBuffer$alloc(pq->bufferId, kCOMMAND, 0, 0, (void *)0, (void *)0, &pending, cmd_param); } #line 1152 if (err != err_NoError) { TupleRouterM$signalError(err, 1153); goto fail; } } break; default: TupleRouterM$signalError(err_UnknownError, 1159); goto fail; } if (!pending) { #line 1163 TupleRouterM$finishedBufferSetup(pq); } #line 1164 return; fail: TupleRouterM$failedOpeningWriteBuffer(pq); return; } static inline # 76 "d:/tinyos-1.x/tos/lib/TinyDB/Query.nc" Field *Query$QueryIntf$getFieldPtr(QueryPtr q, uint8_t idx) #line 76 { return &q->fields[idx]; } # 84 "d:/tinyos-1.x/tos/lib/TinyDB/QueryIntf.nc" inline static Field *TupleRouterM$QueryIntf$getFieldPtr(QueryPtr arg_0xa5e7ec8, uint8_t arg_0xa5fa030){ #line 84 struct __nesc_unnamed4268 *result; #line 84 #line 84 result = Query$QueryIntf$getFieldPtr(arg_0xa5e7ec8, arg_0xa5fa030); #line 84 #line 84 return result; #line 84 } #line 84 # 97 "d:/tinyos-1.x/tos/interfaces/MemAlloc.nc" inline static result_t TableM$MemAlloc$reallocate(Handle arg_0xa6083e0, int16_t arg_0xa608520){ #line 97 unsigned char result; #line 97 #line 97 result = TinyAlloc$MemAlloc$reallocate(arg_0xa6083e0, arg_0xa608520); #line 97 #line 97 return result; #line 97 } #line 97 #line 85 inline static result_t TableM$MemAlloc$allocate(HandlePtr arg_0xa60bd50, int16_t arg_0xa60be90){ #line 85 unsigned char result; #line 85 #line 85 result = TinyAlloc$MemAlloc$allocate(arg_0xa60bd50, arg_0xa60be90); #line 85 #line 85 return result; #line 85 } #line 85 static inline # 50 "d:/tinyos-1.x/tos/lib/TinyDB/TableM.nc" result_t TableM$Table$addNamedField(ParsedQuery *pq, uint8_t idx, char *name, uint8_t type) #line 50 { if (TableM$mAllocing) { #line 52 return FAIL; } #line 53 TableM$mAllocing = TRUE; TableM$mName = name; TableM$mType = type; TableM$mIdx = idx; TableM$mQuery = pq; if (pq->tableInfo == (void *)0) { return TableM$MemAlloc$allocate((Handle *)& pq->tableInfo, pq->numFields * 2 + strlen(name)); } else #line 63 { int size = TableM$MemAlloc$size((Handle )pq->tableInfo); #line 66 size += strlen(name); size -= TableM$nameSize(TableM$getAliases(pq), idx) - 1; return TableM$MemAlloc$reallocate((Handle )pq->tableInfo, size); } } # 71 "d:/tinyos-1.x/tos/lib/TinyDB/Table.nc" inline static result_t TupleRouterM$Table$addNamedField(ParsedQuery *arg_0xa623960, uint8_t arg_0xa623aa0, char *arg_0xa623bf0, uint8_t arg_0xa623d30){ #line 71 unsigned char result; #line 71 #line 71 result = TableM$Table$addNamedField(arg_0xa623960, arg_0xa623aa0, arg_0xa623bf0, arg_0xa623d30); #line 71 #line 71 return result; #line 71 } #line 71 # 66 "d:/tinyos-1.x/tos/interfaces/AttrUse.nc" inline static AttrDescPtr TupleRouterM$AttrUse$getAttr(char *arg_0xa5e4850){ #line 66 struct __nesc_unnamed4260 *result; #line 66 #line 66 result = Attr$AttrUse$getAttr(arg_0xa5e4850); #line 66 #line 66 return result; #line 66 } #line 66 static inline # 108 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQuery.nc" result_t ParsedQuery$ParsedQueryIntf$setExpr(ParsedQueryPtr q, uint8_t n, Expr e) #line 108 { * (Expr *)&((char *)q)[sizeof(ParsedQuery ) + (q->numFields - 1) * sizeof(char ) + n * sizeof(Expr )] = e; return SUCCESS; } # 90 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQueryIntf.nc" inline static result_t TupleRouterM$ParsedQueryIntf$setExpr(ParsedQueryPtr arg_0xa5f6e38, uint8_t arg_0xa5f6f78, Expr arg_0xa5f70b8){ #line 90 unsigned char result; #line 90 #line 90 result = ParsedQuery$ParsedQueryIntf$setExpr(arg_0xa5f6e38, arg_0xa5f6f78, arg_0xa5f70b8); #line 90 #line 90 return result; #line 90 } #line 90 static inline # 363 "d:/tinyos-1.x/tos/lib/TinyDB/QueryResult.nc" result_t QueryResult$MemAlloc$allocComplete(HandlePtr handle, result_t success) #line 363 { return SUCCESS; } static inline # 174 "d:/tinyos-1.x/tos/lib/TinyDB/TinyDBAttrM.nc" result_t TinyDBAttrM$MemAlloc$allocComplete(HandlePtr handle, result_t success) { return SUCCESS; } # 181 "d:/tinyos-1.x/tos/interfaces/MemAlloc.nc" inline static result_t TinyAlloc$MemAlloc$allocComplete(HandlePtr arg_0xa624908, result_t arg_0xa624a50){ #line 181 unsigned char result; #line 181 #line 181 result = TinyDBAttrM$MemAlloc$allocComplete(arg_0xa624908, arg_0xa624a50); #line 181 result = rcombine(result, AggOperator$MemAlloc$allocComplete(arg_0xa624908, arg_0xa624a50)); #line 181 result = rcombine(result, TupleRouterM$MemAlloc$allocComplete(arg_0xa624908, arg_0xa624a50)); #line 181 result = rcombine(result, DBBufferC$MemAlloc$allocComplete(arg_0xa624908, arg_0xa624a50)); #line 181 result = rcombine(result, QueryResult$MemAlloc$allocComplete(arg_0xa624908, arg_0xa624a50)); #line 181 result = rcombine(result, TableM$MemAlloc$allocComplete(arg_0xa624908, arg_0xa624a50)); #line 181 #line 181 return result; #line 181 } #line 181 static inline # 607 "d:/tinyos-1.x/tos/lib/TinyAlloc.nc" int16_t TinyAlloc$getSize(int8_t *ptr) #line 607 { return (int16_t )(((int16_t *)(ptr - TinyAlloc$HEADER_SIZE))[0] & 0x7FFF); } static inline #line 724 int16_t TinyAlloc$start_offset(int8_t *ptr) #line 724 { if (sizeof(int8_t *) == sizeof(int32_t )) { int16_t len = (int16_t )(ptr - (int8_t *)&TinyAlloc$mFrame[0] - TinyAlloc$HEADER_SIZE); #line 727 return (int16_t )len; } else { #line 729 if (sizeof(int8_t *) == sizeof(int16_t )) { int16_t len = (int16_t )(ptr - (int8_t *)&TinyAlloc$mFrame[0] - TinyAlloc$HEADER_SIZE); #line 731 return len; } else { return -1; } } } static inline #line 427 void TinyAlloc$shiftUp(Handle hand, int bytes) #line 427 { int16_t start = TinyAlloc$start_offset(TinyAlloc$deref(hand)); int16_t end = start + TinyAlloc$getSize(TinyAlloc$deref(hand)); int16_t newstart; int16_t newend; int8_t *p = TinyAlloc$deref(hand) - TinyAlloc$HEADER_SIZE; int8_t *startp = TinyAlloc$deref(hand) - TinyAlloc$HEADER_SIZE - bytes; #line 434 int8_t *q; int cnt = TinyAlloc$getSize(TinyAlloc$deref(hand)); q = startp; while (cnt--) { * q++ = * p++; } TinyAlloc$remapAddr(*hand, startp + TinyAlloc$HEADER_SIZE); *hand = startp + TinyAlloc$HEADER_SIZE; newstart = TinyAlloc$start_offset(TinyAlloc$deref(hand)); newend = newstart + TinyAlloc$getSize(TinyAlloc$deref(hand)); TinyAlloc$setFreeBits(start, end, 0); TinyAlloc$setFreeBits(newstart, newend, 1); } static inline #line 643 Handle TinyAlloc$getH(int8_t *p) #line 643 { int16_t i; #line 645 for (i = 0; i < TinyAlloc$MAX_HANDLES; i++) { if (TinyAlloc$mHandles[i] == p) { return &TinyAlloc$mHandles[i]; } } return 0; } static inline # 218 "d:/tinyos-1.x/tos/lib/TinyDB/TableM.nc" result_t TableM$MemAlloc$compactComplete(void) #line 218 { return SUCCESS; } static inline # 371 "d:/tinyos-1.x/tos/lib/TinyDB/QueryResult.nc" result_t QueryResult$MemAlloc$compactComplete(void) #line 371 { return SUCCESS; } static inline # 2325 "d:/tinyos-1.x/tos/lib/TinyDB/DBBufferC.nc" result_t DBBufferC$MemAlloc$compactComplete(void) #line 2325 { return SUCCESS; } static inline # 3210 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" result_t TupleRouterM$MemAlloc$compactComplete(void) #line 3210 { return SUCCESS; } static inline # 417 "d:/tinyos-1.x/tos/lib/TinyDB/AggOperator.nc" result_t AggOperator$MemAlloc$compactComplete(void) #line 417 { return SUCCESS; } static inline # 170 "d:/tinyos-1.x/tos/lib/TinyDB/TinyDBAttrM.nc" result_t TinyDBAttrM$MemAlloc$compactComplete(void) { return SUCCESS; } # 203 "d:/tinyos-1.x/tos/interfaces/MemAlloc.nc" inline static result_t TinyAlloc$MemAlloc$compactComplete(void){ #line 203 unsigned char result; #line 203 #line 203 result = TinyDBAttrM$MemAlloc$compactComplete(); #line 203 result = rcombine(result, AggOperator$MemAlloc$compactComplete()); #line 203 result = rcombine(result, TupleRouterM$MemAlloc$compactComplete()); #line 203 result = rcombine(result, DBBufferC$MemAlloc$compactComplete()); #line 203 result = rcombine(result, QueryResult$MemAlloc$compactComplete()); #line 203 result = rcombine(result, TableM$MemAlloc$compactComplete()); #line 203 #line 203 return result; #line 203 } #line 203 static inline # 654 "d:/tinyos-1.x/tos/lib/TinyAlloc.nc" int16_t TinyAlloc$getNewHandleIdx(void) #line 654 { int16_t i; #line 656 for (i = 0; i < TinyAlloc$MAX_HANDLES; i++) { if (TinyAlloc$mHandles[i] == 0) { #line 657 return i; } } #line 659 return -1; } # 126 "d:/tinyos-1.x/tos/lib/TinyDB/QueryResultIntf.nc" inline static uint16_t DBBufferC$QueryResultIntf$resultSize(QueryResultPtr arg_0xa62adb8, ParsedQueryPtr arg_0xa62af00){ #line 126 unsigned int result; #line 126 #line 126 result = QueryResult$QueryResultIntf$resultSize(arg_0xa62adb8, arg_0xa62af00); #line 126 #line 126 return result; #line 126 } #line 126 # 97 "d:/tinyos-1.x/tos/interfaces/MemAlloc.nc" inline static result_t DBBufferC$MemAlloc$reallocate(Handle arg_0xa6083e0, int16_t arg_0xa608520){ #line 97 unsigned char result; #line 97 #line 97 result = TinyAlloc$MemAlloc$reallocate(arg_0xa6083e0, arg_0xa608520); #line 97 #line 97 return result; #line 97 } #line 97 # 75 "d:/tinyos-1.x/tos/lib/TinyDB/TupleIntf.nc" inline static uint16_t QueryResult$TupleIntf$tupleSize(ParsedQueryPtr arg_0xa604d30){ #line 75 unsigned int result; #line 75 #line 75 result = Tuple$TupleIntf$tupleSize(arg_0xa604d30); #line 75 #line 75 return result; #line 75 } #line 75 static inline # 113 "d:/tinyos-1.x/tos/lib/TinyDB/QueryResult.nc" TinyDBError QueryResult$QueryResultIntf$fromTuple(QueryResultPtr qr, ParsedQueryPtr pq, TuplePtr t) #line 113 { short size = QueryResult$TupleIntf$tupleSize(pq); char *p; #line 115 char *q; qr->qrType = kNOT_AGG; qr->qid = pq->qid; qr->result_idx = 0; p = (char *)t; q = (char *)& qr->d.t; while (size--) * q++ = * p++; return err_NoError; } # 113 "d:/tinyos-1.x/tos/lib/TinyDB/QueryResultIntf.nc" inline static TinyDBError TupleRouterM$QueryResultIntf$fromTuple(QueryResultPtr arg_0xa617dd8, ParsedQueryPtr arg_0xa617f20, TuplePtr arg_0xa62a080){ #line 113 enum __nesc_unnamed4265 result; #line 113 #line 113 result = QueryResult$QueryResultIntf$fromTuple(arg_0xa617dd8, arg_0xa617f20, arg_0xa62a080); #line 113 #line 113 return result; #line 113 } #line 113 # 162 "d:/tinyos-1.x/tos/lib/TinyDB/DBBuffer.nc" inline static TinyDBError TupleRouterM$DBBuffer$size(uint8_t arg_0xa640180, uint16_t *arg_0xa6402e0){ #line 162 enum __nesc_unnamed4265 result; #line 162 #line 162 result = DBBufferC$DBBuffer$size(arg_0xa640180, arg_0xa6402e0); #line 162 #line 162 return result; #line 162 } #line 162 # 158 "d:/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t TupleRouterM$Leds$yellowToggle(void){ #line 158 unsigned char result; #line 158 #line 158 result = LedsC$Leds$yellowToggle(); #line 158 #line 158 return result; #line 158 } #line 158 static inline # 314 "d:/tinyos-1.x/tos/lib/TinyDB/AggOperator.nc" result_t AggOperator$Operator$endOfEpoch(ParsedQueryPtr q, ExprPtr e) #line 314 { AggOperator$GroupDataHandle gdh = (AggOperator$GroupDataHandle )e->opState; AggOperator$GroupRecord *gr; if (e->opType != kSEL && gdh != (void *)0) { short i; #line 320 for (i = 0; i < (*gdh)->numGroups; i++) { gr = AggOperator$GET_GROUP_DATA(gdh, i); AggOperator$initAggregateValue(gr, e, FALSE); } } return SUCCESS; } # 123 "d:/tinyos-1.x/tos/lib/TinyDB/Operator.nc" inline static result_t TupleRouterM$AggOperator$endOfEpoch(ParsedQueryPtr arg_0xa60c1a8, ExprPtr arg_0xa60c2e8){ #line 123 unsigned char result; #line 123 #line 123 result = AggOperator$Operator$endOfEpoch(arg_0xa60c1a8, arg_0xa60c2e8); #line 123 #line 123 return result; #line 123 } #line 123 # 84 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQueryIntf.nc" inline static ExprPtr TupleRouterM$ParsedQueryIntf$getExprPtr(ParsedQueryPtr arg_0xa5f6348, uint8_t arg_0xa5f6488){ #line 84 struct __nesc_unnamed4288 *result; #line 84 #line 84 result = ParsedQuery$ParsedQueryIntf$getExprPtr(arg_0xa5f6348, arg_0xa5f6488); #line 84 #line 84 return result; #line 84 } #line 84 static inline # 234 "d:/tinyos-1.x/tos/lib/TinyDB/Tuple.nc" result_t Tuple$TupleIntf$tupleInit(ParsedQueryPtr q, TuplePtr t) #line 234 { t->notNull = 0; t->qid = q->qid; t->numFields = q->numFields; return SUCCESS; } # 136 "d:/tinyos-1.x/tos/lib/TinyDB/TupleIntf.nc" inline static result_t TupleRouterM$TupleIntf$tupleInit(ParsedQueryPtr arg_0xa5fc650, TuplePtr arg_0xa5fc798){ #line 136 unsigned char result; #line 136 #line 136 result = Tuple$TupleIntf$tupleInit(arg_0xa5fc650, arg_0xa5fc798); #line 136 #line 136 return result; #line 136 } #line 136 static inline # 2383 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$resetTupleState(ParsedQuery *q) #line 2383 { short i; Expr *e; TupleRouterM$TupleIntf$tupleInit(q, TupleRouterM$ParsedQueryIntf$getTuplePtr(q)); for (i = 0; i < q->numExprs; i++) { e = TupleRouterM$ParsedQueryIntf$getExprPtr(q, i); TupleRouterM$AggOperator$endOfEpoch(q, e); } } static inline #line 2329 void TupleRouterM$startFetchingTuples(void) #line 2329 { TupleRouterM$QueryListHandle qlh = TupleRouterM$mQs; bool mustSample = FALSE; while (qlh != (void *)0) { if ((( #line 2337 *qlh)->q.clocksPerSample > 0 && ( *qlh)->q.clockCount == TupleRouterM$WAKING_CLOCKS) || ( *qlh)->q.clockCount == (int16_t )(*qlh)->q.clocksPerSample) { TupleRouterM$resetTupleState(& (*qlh)->q); } if ((*qlh)->q.running && (*qlh)->q.clocksPerSample > 0) { (*qlh)->q.clockCount -= TupleRouterM$mClockCount; if ((*qlh)->q.clockCount <= 0) { TupleRouterM$Leds$yellowToggle(); if ((*qlh)->q.markedForDeletion > 0) { if (-- (*qlh)->q.markedForDeletion == 0) { TupleRouterM$mQidToRemove = (*qlh)->q.qid; TupleRouterM$mForceRemove = TRUE; TOS_post(TupleRouterM$removeQueryTask); } else #line 2357 { (*qlh)->q.clockCount += (*qlh)->q.clocksPerSample; } } else #line 2360 { if ((*qlh)->q.queryRoot != TOS_LOCAL_ADDRESS) { mustSample = TRUE; } #line 2366 (*qlh)->q.currentEpoch++; } } } qlh = (TupleRouterM$QueryListHandle )(*qlh)->next; } TupleRouterM$mClockCount = 0; if (mustSample) { TupleRouterM$fetchNextAttr(); } } static inline #line 2324 result_t TupleRouterM$Network$sendQueryDone(TOS_MsgPtr msg, result_t success) { return TupleRouterM$outputDone(msg); } # 149 "d:/tinyos-1.x/tos/lib/TinyDB/Network.nc" inline static result_t NetworkM$Network$sendQueryDone(TOS_MsgPtr arg_0xa320c78, result_t arg_0xa320dc0){ #line 149 unsigned char result; #line 149 #line 149 result = TupleRouterM$Network$sendQueryDone(arg_0xa320c78, arg_0xa320dc0); #line 149 #line 149 return result; #line 149 } #line 149 static inline # 2319 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" result_t TupleRouterM$Network$sendQueryRequestDone(TOS_MsgPtr msg, result_t success) { return TupleRouterM$outputDone(msg); } # 124 "d:/tinyos-1.x/tos/lib/TinyDB/Network.nc" inline static result_t NetworkM$Network$sendQueryRequestDone(TOS_MsgPtr arg_0xa31bb98, result_t arg_0xa31bce0){ #line 124 unsigned char result; #line 124 #line 124 result = TupleRouterM$Network$sendQueryRequestDone(arg_0xa31bb98, arg_0xa31bce0); #line 124 #line 124 return result; #line 124 } #line 124 static inline # 154 "d:/tinyos-1.x/tos/lib/Command.nc" result_t Command$CommandUse$invokeBuffer(char *ptr, char *resultBuf, SchemaErrorNo *errorNo) { char *commandName; short i; ParamVals paramVals; CommandDescPtr cmd; commandName = ptr; cmd = Command$CommandUse$getCommand(commandName); if (cmd == (void *)0) { return FAIL; } for (i = 0, ptr += strlen(commandName) + 1; i < cmd->params.numParams; i++) { paramVals.paramDataPtr[i] = ptr; ptr += lengthOf(cmd->params.params[i], ptr); } paramVals.numParams = cmd->params.numParams; return Command$CommandUse$invoke(commandName, resultBuf, errorNo, ¶mVals); } static inline # 188 "d:/tinyos-1.x/tos/system/AMStandard.nc" result_t AMStandard$default$sendDone(void) #line 188 { return SUCCESS; } #line 88 inline static result_t AMStandard$sendDone(void){ #line 88 unsigned char result; #line 88 #line 88 result = AMStandard$default$sendDone(); #line 88 #line 88 return result; #line 88 } #line 88 static inline #line 156 void AMStandard$dbgPacket(TOS_MsgPtr data) #line 156 { uint8_t i; for (i = 0; i < sizeof(TOS_Msg ); i++) { { } #line 161 ; } { } #line 163 ; } # 108 "d:/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t TupleRouterM$Leds$redToggle(void){ #line 108 unsigned char result; #line 108 #line 108 result = LedsC$Leds$redToggle(); #line 108 #line 108 return result; #line 108 } #line 108 static inline # 126 "d:/tinyos-1.x/tos/system/tos.h" result_t rcombine4(result_t r1, result_t r2, result_t r3, result_t r4) { return rcombine(r1, rcombine(r2, rcombine(r3, r4))); } # 90 "d:/tinyos-1.x/tos/interfaces/Timer.nc" inline static result_t AMStandard$ActivityTimer$start(char arg_0xa3f1240, uint32_t arg_0xa3f1390){ #line 90 unsigned char result; #line 90 #line 90 result = LogicalTimeM$Timer$start(0, arg_0xa3f1240, arg_0xa3f1390); #line 90 #line 90 return result; #line 90 } #line 90 static inline # 88 "d:/tinyos-1.x/tos/platform/mica/HPLClock.nc" result_t HPLClock$StdControl$start(void) #line 88 { uint8_t mi; #line 89 uint8_t ms; #line 90 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 90 { mi = HPLClock$minterval; ms = HPLClock$mscale; } #line 93 __nesc_atomic_end(__nesc_atomic); } HPLClock$Clock$setRate(mi, ms); return SUCCESS; } # 59 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t LogicalTimeM$ClockControl$start(void){ #line 59 unsigned char result; #line 59 #line 59 result = HPLClock$StdControl$start(); #line 59 #line 59 return result; #line 59 } #line 59 static inline # 106 "d:/tinyos-1.x/tos/system/LogicalTimeM.nc" result_t LogicalTimeM$StdControl$start(void) #line 106 { LogicalTimeM$ClockControl$start(); return SUCCESS; } # 59 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t CC1000RadioIntM$TimerControl$start(void){ #line 59 unsigned char result; #line 59 #line 59 result = LogicalTimeM$StdControl$start(); #line 59 #line 59 return result; #line 59 } #line 59 static inline # 392 "d:/tinyos-1.x/tos/platform/mica2/CC1000RadioIntM.nc" result_t CC1000RadioIntM$StdControl$start(void) #line 392 { if (CC1000RadioIntM$RadioState == CC1000RadioIntM$DISABLED_STATE) { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 395 { CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE; CC1000RadioIntM$bTxPending = CC1000RadioIntM$bTxBusy = FALSE; CC1000RadioIntM$sMacDelay = -1; } #line 399 __nesc_atomic_end(__nesc_atomic); } CC1000RadioIntM$preamblelen = (({ #line 400 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_LPL_PreambleLength[CC1000RadioIntM$lplpowertx * 2]; #line 400 unsigned char __result; #line 400 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } ) #line 400 << 8) | ({ #line 401 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_LPL_PreambleLength[CC1000RadioIntM$lplpowertx * 2 + 1]; #line 401 unsigned char __result; #line 401 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } ); #line 402 if (CC1000RadioIntM$lplpower == 0) { CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE; CC1000RadioIntM$CC1000StdControl$start(); CC1000RadioIntM$CC1000Control$BIASOn(); CC1000RadioIntM$SpiByteFifo$rxMode(); CC1000RadioIntM$CC1000Control$RxMode(); CC1000RadioIntM$SpiByteFifo$enableIntr(); } else { uint16_t sleeptime = (({ #line 412 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_LPL_SleepTime[CC1000RadioIntM$lplpower * 2]; #line 412 unsigned char __result; #line 412 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } ) #line 412 << 8) | ({ #line 413 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_LPL_SleepTime[CC1000RadioIntM$lplpower * 2 + 1]; #line 413 unsigned char __result; #line 413 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } ); #line 414 CC1000RadioIntM$RadioState = CC1000RadioIntM$POWER_DOWN_STATE; CC1000RadioIntM$TimerControl$start(); CC1000RadioIntM$WakeupTimer$start(TIMER_ONE_SHOT, sleeptime); } } return SUCCESS; } # 59 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t AMStandard$RadioControl$start(void){ #line 59 unsigned char result; #line 59 #line 59 result = CC1000RadioIntM$StdControl$start(); #line 59 #line 59 return result; #line 59 } #line 59 static inline # 91 "d:/tinyos-1.x/tos/system/UARTM.nc" result_t UARTM$Control$start(void) #line 91 { return UARTM$HPLUART$init(); } # 59 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t NoCRCPacket$ByteControl$start(void){ #line 59 unsigned char result; #line 59 #line 59 result = UARTM$Control$start(); #line 59 #line 59 return result; #line 59 } #line 59 static inline # 133 "d:/tinyos-1.x/tos/system/NoCRCPacket.nc" result_t NoCRCPacket$Control$start(void) #line 133 { return NoCRCPacket$ByteControl$start(); } # 59 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t AMStandard$UARTControl$start(void){ #line 59 unsigned char result; #line 59 #line 59 result = NoCRCPacket$Control$start(); #line 59 #line 59 return result; #line 59 } #line 59 inline static result_t AMStandard$TimerControl$start(void){ #line 59 unsigned char result; #line 59 #line 59 result = LogicalTimeM$StdControl$start(); #line 59 #line 59 return result; #line 59 } #line 59 static inline # 126 "d:/tinyos-1.x/tos/system/AMStandard.nc" bool AMStandard$Control$start(void) #line 126 { result_t ok0 = AMStandard$TimerControl$start(); result_t ok1 = AMStandard$UARTControl$start(); result_t ok2 = AMStandard$RadioControl$start(); result_t ok3 = AMStandard$ActivityTimer$start(TIMER_REPEAT, 1000); { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 134 { AMStandard$state = FALSE; } #line 136 __nesc_atomic_end(__nesc_atomic); } AMStandard$PowerManagement$adjustPower(); return rcombine4(ok0, ok1, ok2, ok3); } # 59 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t NetworkM$SubControl$start(void){ #line 59 unsigned char result; #line 59 #line 59 result = AMStandard$Control$start(); #line 59 #line 59 return result; #line 59 } #line 59 static inline # 339 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkM.nc" result_t NetworkM$StdControl$start(void) #line 339 { return NetworkM$SubControl$start(); } # 59 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t TupleRouterM$NetControl$start(void){ #line 59 unsigned char result; #line 59 #line 59 result = NetworkM$StdControl$start(); #line 59 #line 59 return result; #line 59 } #line 59 static inline # 407 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$SET_STARTING_ATTRIBUTE(void) #line 407 { #line 407 TupleRouterM$mPendingMask |= TupleRouterM$ATTR_STARTING_BIT; } static inline #line 526 void TupleRouterM$startAllQueryAttrs(void) { TupleRouterM$QueryListHandle curq; TupleRouterM$SET_STARTING_ATTRIBUTE(); for (curq = TupleRouterM$mQs; curq != (void *)0; curq = (TupleRouterM$QueryListHandle )(*curq)->next) { if ((*curq)->q.clocksPerSample > 0) { TupleRouterM$mNumAttrs += (*curq)->q.numFields; } } #line 537 for (curq = TupleRouterM$mQs; curq != (void *)0; curq = (TupleRouterM$QueryListHandle )(*curq)->next) { if ((*curq)->q.clocksPerSample > 0) { TupleRouterM$startQueryAttrs(& (*curq)->q); } } } # 59 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t TupleRouterM$TimerControl$start(void){ #line 59 unsigned char result; #line 59 #line 59 result = LogicalTimeM$StdControl$start(); #line 59 #line 59 return result; #line 59 } #line 59 # 86 "d:/tinyos-1.x/tos/interfaces/Interrupt.nc" inline static result_t RealMain$Interrupt$enable(void){ #line 86 unsigned char result; #line 86 #line 86 result = HPLInterrupt$Interrupt$enable(); #line 86 #line 86 return result; #line 86 } #line 86 static inline # 158 "d:/tinyos-1.x/tos/platform/avrmote/avrhardware.h" void TOSH_wait(void) { __asm volatile ("nop"); __asm volatile ("nop");} static inline void TOSH_sleep(void) { * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x35 + 0x20) |= 1 << 5; __asm volatile ("sleep");} static inline # 170 "d:/tinyos-1.x/tos/system/sched.c" bool TOSH_run_next_task(void) #line 170 { uint8_t old_full; void (*func)(void ); if (TOSH_sched_full == TOSH_sched_free) { return 0; } else { old_full = TOSH_sched_full; TOSH_sched_full++; TOSH_sched_full &= TOSH_TASK_BITMASK; func = TOSH_queue[(int )old_full].tp; TOSH_queue[(int )old_full].tp = 0; func(); return 1; } } static inline void TOSH_run_task(void) #line 189 { while (TOSH_run_next_task()) ; TOSH_sleep(); TOSH_wait(); } # 72 "d:/tinyos-1.x/tos/interfaces/SendMsg.nc" inline static result_t NetworkM$SendStatusMessage$send(uint16_t arg_0xa32f9f0, uint8_t arg_0xa32fb30, TOS_MsgPtr arg_0xa32fc78){ #line 72 unsigned char result; #line 72 #line 72 result = AMStandard$SendMsg$send(kSTATUS_MESSAGE_ID, arg_0xa32f9f0, arg_0xa32fb30, arg_0xa32fc78); #line 72 #line 72 return result; #line 72 } #line 72 # 97 "d:/tinyos-1.x/tos/lib/TinyDB/QueryProcessor.nc" inline static ParsedQueryPtr NetworkM$QueryProcessor$getQueryIdx(short arg_0xa2ec580){ #line 97 struct __nesc_unnamed4276 *result; #line 97 #line 97 result = TupleRouterM$QueryProcessor$getQueryIdx(arg_0xa2ec580); #line 97 #line 97 return result; #line 97 } #line 97 #line 96 inline static short NetworkM$QueryProcessor$numQueries(void){ #line 96 short result; #line 96 #line 96 result = TupleRouterM$QueryProcessor$numQueries(); #line 96 #line 96 return result; #line 96 } #line 96 static inline # 767 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkM.nc" TOS_MsgPtr NetworkM$RcvStatusMessage$receive(TOS_MsgPtr msg) #line 767 { short numqs; #line 768 short i; StatusMessage *smsg; if (NetworkM$filterMessage(msg, FALSE)) { #line 771 return msg; } #line 772 if (!NetworkM$mRadio) { smsg = (StatusMessage *)& NetworkM$mDbg.data; NetworkM$mLocal = TRUE; NetworkM$mRadio = TRUE; numqs = NetworkM$QueryProcessor$numQueries(); if (numqs > kMAX_QUERIES) { #line 777 numqs = kMAX_QUERIES; } #line 778 smsg->numQueries = numqs; for (i = 0; i < numqs; i++) { uint8_t qid = (uint8_t )NetworkM$QueryProcessor$getQueryIdx(i)->qid; #line 781 { } #line 781 ; smsg->queries[i] = qid; } if (NetworkM$SendStatusMessage$send(TOS_UART_ADDR, kMSG_LEN, &NetworkM$mDbg) != SUCCESS) { NetworkM$mLocal = FALSE; NetworkM$mRadio = FALSE; } } return msg; } # 98 "d:/tinyos-1.x/tos/interfaces/CommandUse.nc" inline static result_t NetworkM$CommandUse$invokeMsg(TOS_MsgPtr arg_0xa341e10, char *arg_0xa34c010, SchemaErrorNo *arg_0xa34c170){ #line 98 unsigned char result; #line 98 #line 98 result = Command$CommandUse$invokeMsg(arg_0xa341e10, arg_0xa34c010, arg_0xa34c170); #line 98 #line 98 return result; #line 98 } #line 98 # 133 "d:/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t NetworkM$Leds$greenToggle(void){ #line 133 unsigned char result; #line 133 #line 133 result = LedsC$Leds$greenToggle(); #line 133 #line 133 return result; #line 133 } #line 133 # 72 "d:/tinyos-1.x/tos/interfaces/SendMsg.nc" inline static result_t NetworkM$SchemaMsg$send(uint16_t arg_0xa32f9f0, uint8_t arg_0xa32fb30, TOS_MsgPtr arg_0xa32fc78){ #line 72 unsigned char result; #line 72 #line 72 result = AMStandard$SendMsg$send(kCOMMAND_MESSAGE_ID, arg_0xa32f9f0, arg_0xa32fb30, arg_0xa32fc78); #line 72 #line 72 return result; #line 72 } #line 72 static inline # 733 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkM.nc" TOS_MsgPtr NetworkM$RcvCommandMsg$receive(TOS_MsgPtr msg) #line 733 { uint8_t rootId; bool amRoot; bool shouldResend; if (NetworkM$filterMessage(msg, FALSE)) { #line 738 return msg; } amRoot = NetworkM$checkRoot(msg, &rootId); shouldResend = ((struct CommandMsg *)msg->data)->fromBase; ( (struct CommandMsg *)msg->data)->fromBase = FALSE; if ((amRoot || shouldResend) && !NetworkM$mRadio) { NetworkM$mWasCommand = TRUE; NetworkM$mRadio = TRUE; if (NetworkM$SchemaMsg$send(TOS_BCAST_ADDR, kMSG_LEN, msg) == SUCCESS) { nmemcpy(&NetworkM$mDbg, msg, sizeof(TOS_Msg )); } else #line 752 { NetworkM$mWasCommand = FALSE; NetworkM$mRadio = FALSE; } } else #line 756 { NetworkM$Leds$greenToggle(); NetworkM$CommandUse$invokeMsg(msg, (void *)0, &NetworkM$errorNo); } return msg; } static inline #line 456 QueryRequestMessagePtr NetworkM$Network$getQueryRequestPayLoad(TOS_MsgPtr msg) { return (QueryRequestMessagePtr )&((NetworkMessage *)msg->data)->data[0]; } static inline # 426 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$UNSET_SENDING_QUERY(void) #line 426 { #line 426 TupleRouterM$mPendingMask &= TupleRouterM$SENDING_QUERY_BIT ^ 0xFFFF; } static inline #line 427 void TupleRouterM$SET_SENDING_QUERY(void) #line 427 { #line 427 TupleRouterM$mPendingMask |= TupleRouterM$SENDING_QUERY_BIT; } static inline #line 425 bool TupleRouterM$IS_SENDING_QUERY(void) #line 425 { #line 425 return (TupleRouterM$mPendingMask & TupleRouterM$SENDING_QUERY_BIT) != 0; } static inline #line 1396 result_t TupleRouterM$Network$queryRequestSub(QueryRequestMessagePtr qmsg) #line 1396 { char qid = qmsg->qid; TupleRouterM$QueryListHandle curq; if (TupleRouterM$IS_SENDING_QUERY() && TupleRouterM$mCurSendingQuery) { if (qid == (*TupleRouterM$mCurSendingQuery)->q.qid) { return SUCCESS; } } if (!TupleRouterM$IS_SENDING_MESSAGE() && (!TupleRouterM$IS_SENDING_QUERY() || TupleRouterM$mTriedQueryRequest)) { TupleRouterM$mTriedQueryRequest = FALSE; TupleRouterM$mCurSendingQuery = (void *)0; TupleRouterM$SET_SENDING_QUERY(); } else #line 1417 { TupleRouterM$mTriedQueryRequest = TRUE; return SUCCESS; } curq = TupleRouterM$mQs; while (curq != (void *)0) { if ((*curq)->q.qid == qid) { TupleRouterM$mCurSendingField = 0; TupleRouterM$mCurSendingExpr = 0; TupleRouterM$mCurSendingQuery = curq; TOS_post(TupleRouterM$sendQuery); break; } curq = (TupleRouterM$QueryListHandle )(*curq)->next; } if (!TupleRouterM$mCurSendingQuery) { #line 1438 TupleRouterM$UNSET_SENDING_QUERY(); } return SUCCESS; } # 176 "d:/tinyos-1.x/tos/lib/TinyDB/Network.nc" inline static result_t NetworkM$Network$queryRequestSub(QueryRequestMessagePtr arg_0xa328490){ #line 176 unsigned char result; #line 176 #line 176 result = TupleRouterM$Network$queryRequestSub(arg_0xa328490); #line 176 #line 176 return result; #line 176 } #line 176 static inline # 649 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkM.nc" TOS_MsgPtr NetworkM$RcvRequestMsg$receive(TOS_MsgPtr msg) #line 649 { NetworkMessage *nw = (NetworkMessage *)msg->data; uint8_t rootId = 0; if (NetworkM$filterMessage(msg, FALSE)) { #line 653 return msg; } NetworkM$checkRoot(msg, &rootId); NetworkM$processHeader(nw->hdr, NetworkM$QUERY_TYPE, rootId); NetworkM$Network$queryRequestSub(NetworkM$Network$getQueryRequestPayLoad(msg)); return msg; } static inline #line 406 QueryMessagePtr NetworkM$Network$getQueryPayLoad(TOS_MsgPtr msg) { return (QueryMessagePtr )&((NetworkMessage *)msg->data)->data[0]; } static inline # 430 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$UNSET_IS_IN_QUERY_MSG(void) #line 430 { #line 430 TupleRouterM$mPendingMask &= TupleRouterM$IN_QUERY_MSG_BIT ^ 0xFFFF; } static inline #line 399 void TupleRouterM$SET_SPACE_ALLOCED(void) #line 399 { #line 399 TupleRouterM$mPendingMask |= TupleRouterM$ALLOCED_BIT; } # 135 "d:/tinyos-1.x/tos/lib/TinyDB/Network.nc" inline static QueryMessagePtr TupleRouterM$Network$getQueryPayLoad(TOS_MsgPtr arg_0xa3201c8){ #line 135 struct QueryMessage *result; #line 135 #line 135 result = NetworkM$Network$getQueryPayLoad(arg_0xa3201c8); #line 135 #line 135 return result; #line 135 } #line 135 static inline # 883 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$continueQuery(Handle *memory) #line 883 { QueryMessage *qmsg = TupleRouterM$Network$getQueryPayLoad(&TupleRouterM$mMsg); short i; TupleRouterM$mCurQuery = (Query **)*memory; (*TupleRouterM$mCurQuery)->qid = qmsg->qid; (*TupleRouterM$mCurQuery)->numFields = qmsg->numFields; (*TupleRouterM$mCurQuery)->numExprs = qmsg->numExprs; (*TupleRouterM$mCurQuery)->epochDuration = qmsg->epochDuration; (*TupleRouterM$mCurQuery)->fromBuffer = qmsg->fromBuffer; (*TupleRouterM$mCurQuery)->fromCatalogBuffer = qmsg->fromCatalogBuffer; (*TupleRouterM$mCurQuery)->bufferType = qmsg->bufferType; (*TupleRouterM$mCurQuery)->queryRoot = qmsg->queryRoot; (*TupleRouterM$mCurQuery)->knownFields = 0; (*TupleRouterM$mCurQuery)->knownExprs = 0; (*TupleRouterM$mCurQuery)->needsEvent = qmsg->hasEvent; { } #line 899 ; (*TupleRouterM$mCurQuery)->hasForClause = qmsg->hasForClause; if ((*TupleRouterM$mCurQuery)->bufferType != kRADIO) { ( *TupleRouterM$mCurQuery)->hasBuf = FALSE; (*TupleRouterM$mCurQuery)->buf.cmd.hasParam = FALSE; } ( *TupleRouterM$mCurQuery)->hasEvent = FALSE; { } #line 910 ; for (i = qmsg->numFields; i < MAX_FIELDS; i++) ( *TupleRouterM$mCurQuery)->knownFields |= 1 << i; for (i = qmsg->numExprs; i < MAX_EXPRS; i++) ( *TupleRouterM$mCurQuery)->knownExprs |= 1 << i; { } #line 917 ; TupleRouterM$SET_SPACE_ALLOCED(); TupleRouterM$addQueryField(qmsg); TupleRouterM$forwardQuery(qmsg); } static inline # 68 "d:/tinyos-1.x/tos/lib/TinyDB/Query.nc" short Query$QueryIntf$size(QueryPtr q) #line 68 { return sizeof(Query ) + (q->numFields - 1) * sizeof(Field ) + q->numExprs * sizeof(Expr ); } # 78 "d:/tinyos-1.x/tos/lib/TinyDB/QueryIntf.nc" inline static short TupleRouterM$QueryIntf$size(QueryPtr arg_0xa5e7528){ #line 78 short result; #line 78 #line 78 result = Query$QueryIntf$size(arg_0xa5e7528); #line 78 #line 78 return result; #line 78 } #line 78 # 85 "d:/tinyos-1.x/tos/interfaces/MemAlloc.nc" inline static result_t TupleRouterM$MemAlloc$allocate(HandlePtr arg_0xa60bd50, int16_t arg_0xa60be90){ #line 85 unsigned char result; #line 85 #line 85 result = TinyAlloc$MemAlloc$allocate(arg_0xa60bd50, arg_0xa60be90); #line 85 #line 85 return result; #line 85 } #line 85 static inline # 3076 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" bool TupleRouterM$allocPendingQuery(TupleRouterM$MemoryCallback callback, Query *q) #line 3076 { TupleRouterM$mAllocState = TupleRouterM$STATE_ALLOC_IN_FLIGHT_QUERY; TupleRouterM$mAllocCallback = callback; return TupleRouterM$MemAlloc$allocate(&TupleRouterM$mTmpHandle, TupleRouterM$QueryIntf$size(q)); } static inline #line 398 void TupleRouterM$UNSET_SPACE_ALLOCED(void) #line 398 { #line 398 TupleRouterM$mPendingMask &= TupleRouterM$ALLOCED_BIT ^ 0xFFFF; } static inline #line 389 void TupleRouterM$SET_READING_QUERY(void) #line 389 { #line 389 TupleRouterM$mPendingMask |= TupleRouterM$READING_BIT; } static inline #line 391 bool TupleRouterM$IS_READING_QUERY(void) #line 391 { #line 391 return (TupleRouterM$mPendingMask & TupleRouterM$READING_BIT) != 0; } static inline bool TupleRouterM$IS_SPACE_ALLOCED(void) #line 397 { #line 397 return (TupleRouterM$mPendingMask & TupleRouterM$ALLOCED_BIT) != 0; } # 128 "d:/tinyos-1.x/tos/interfaces/MemAlloc.nc" inline static int16_t TupleRouterM$MemAlloc$free(Handle arg_0xa6093b0){ #line 128 int result; #line 128 #line 128 result = TinyAlloc$MemAlloc$free(arg_0xa6093b0); #line 128 #line 128 return result; #line 128 } #line 128 static inline # 161 "d:/tinyos-1.x/tos/platform/mica/HPLClock.nc" void HPLClock$Clock$setCounter(uint8_t n) #line 161 { * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x32 + 0x20) = n; } # 188 "d:/tinyos-1.x/tos/interfaces/Clock.nc" inline static void LogicalTimeM$Clock$setCounter(uint8_t arg_0xa50c9a8){ #line 188 HPLClock$Clock$setCounter(arg_0xa50c9a8); #line 188 } #line 188 static inline # 155 "d:/tinyos-1.x/tos/system/LogicalTimeM.nc" void LogicalTimeM$TimeSet$set(tos_time_t t) #line 155 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 156 { LogicalTimeM$time = t; } #line 158 __nesc_atomic_end(__nesc_atomic); } LogicalTimeM$Clock$setCounter(0); if (LogicalTimeM$baseTimerIndex != -1) { #line 162 LogicalTimeM$resetBaseTimer(); } } # 56 "d:/tinyos-1.x/tos/interfaces/TimeSet.nc" inline static void TupleRouterM$TimeSet$set(tos_time_t arg_0xa4fc1e8){ #line 56 LogicalTimeM$TimeSet$set(arg_0xa4fc1e8); #line 56 } #line 56 static inline # 431 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$SET_IS_IN_QUERY_MSG(void) #line 431 { #line 431 TupleRouterM$mPendingMask |= TupleRouterM$IN_QUERY_MSG_BIT; } static inline #line 429 bool TupleRouterM$IS_IN_QUERY_MSG(void) #line 429 { #line 429 return (TupleRouterM$mPendingMask & TupleRouterM$IN_QUERY_MSG_BIT) != 0; } # 141 "d:/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t TupleRouterM$Leds$yellowOn(void){ #line 141 unsigned char result; #line 141 #line 141 result = LedsC$Leds$yellowOn(); #line 141 #line 141 return result; #line 141 } #line 141 #line 116 inline static result_t TupleRouterM$Leds$greenOn(void){ #line 116 unsigned char result; #line 116 #line 116 result = LedsC$Leds$greenOn(); #line 116 #line 116 return result; #line 116 } #line 116 #line 91 inline static result_t TupleRouterM$Leds$redOn(void){ #line 91 unsigned char result; #line 91 #line 91 result = LedsC$Leds$redOn(); #line 91 #line 91 return result; #line 91 } #line 91 static inline # 1782 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$setRate(uint8_t qid, uint16_t epochDur) #line 1782 { ParsedQuery *q; #line 1784 if (TupleRouterM$getQuery(qid, &q)) { q->clocksPerSample = epochDur / TupleRouterM$mOldRate; } } static inline #line 706 result_t TupleRouterM$Network$querySub(QueryMessagePtr qmsg) #line 706 { ParsedQuery *q; bool oldField = TRUE; bool isRoot; if (qmsg->msgType == DROP_TABLE_MSG) { if (TupleRouterM$IS_IN_QUERY_MSG()) { return FAIL; } #line 714 TupleRouterM$SET_IS_IN_QUERY_MSG(); if (qmsg->u.ttl-- > 0) { TupleRouterM$forwardQuery(qmsg); } #line 721 TupleRouterM$UNSET_IS_IN_QUERY_MSG(); return FAIL; } else { #line 724 if (qmsg->msgType == RATE_MSG) { if (TupleRouterM$IS_IN_QUERY_MSG()) { return SUCCESS; } TupleRouterM$SET_IS_IN_QUERY_MSG(); if (!TupleRouterM$getQuery(qmsg->qid, &q)) { goto done_rate; } isRoot = TOS_LOCAL_ADDRESS == q->queryRoot; if (isRoot) { TupleRouterM$forwardQuery(qmsg); } { } #line 741 ; TupleRouterM$setRate(qmsg->qid, qmsg->epochDuration); done_rate: TupleRouterM$UNSET_IS_IN_QUERY_MSG(); return SUCCESS; } else { #line 747 if (qmsg->msgType == DEL_MSG) { ParsedQuery *pq; bool isKnown; TupleRouterM$Leds$yellowToggle(); if (TupleRouterM$IS_IN_QUERY_MSG()) { return SUCCESS; } TupleRouterM$SET_IS_IN_QUERY_MSG(); if (TupleRouterM$getQuery(qmsg->qid, &pq)) { isKnown = TRUE; } else { #line 762 isKnown = FALSE; } TupleRouterM$Leds$redOn(); TupleRouterM$Leds$greenOn(); TupleRouterM$Leds$yellowOn(); TupleRouterM$mQidToRemove = qmsg->qid; TupleRouterM$mForceRemove = FALSE; TOS_post(TupleRouterM$removeQueryTask); if (isKnown) { TupleRouterM$forwardQuery(qmsg); } TupleRouterM$UNSET_IS_IN_QUERY_MSG(); return SUCCESS; } } } if (!TupleRouterM$IS_IN_QUERY_MSG()) { if (!TupleRouterM$getQuery(qmsg->qid, &q)) { tos_time_t mytime; TupleRouterM$SET_IS_IN_QUERY_MSG(); mytime.high32 = qmsg->timeSyncData[0] & 0x000000FF; mytime.low32 = * (uint32_t *)&qmsg->timeSyncData[1]; TupleRouterM$TimeSet$set(mytime); TupleRouterM$mQueryClockCount = qmsg->clockCount; if (TupleRouterM$IS_READING_QUERY()) { if (qmsg->qid != (*TupleRouterM$mCurQuery)->qid) { if (TupleRouterM$IS_SPACE_ALLOCED() || TupleRouterM$mTriedAllocWaiting) { if (TupleRouterM$IS_SPACE_ALLOCED()) { #line 799 TupleRouterM$MemAlloc$free((Handle )TupleRouterM$mCurQuery); } #line 800 TupleRouterM$UNSET_SPACE_ALLOCED(); TupleRouterM$UNSET_READING_QUERY(); } else #line 802 { TupleRouterM$mTriedAllocWaiting = TRUE; TupleRouterM$UNSET_IS_IN_QUERY_MSG(); return SUCCESS; } } else { #line 807 if (!TupleRouterM$IS_SPACE_ALLOCED()) { TupleRouterM$UNSET_IS_IN_QUERY_MSG(); return SUCCESS; } else #line 810 { oldField = TupleRouterM$addQueryField(qmsg); } } if (!oldField || TOS_LOCAL_ADDRESS == qmsg->queryRoot) { TupleRouterM$forwardQuery(qmsg); } } if (!TupleRouterM$IS_READING_QUERY()) { Query pq; QueryMessagePtr qmsgCopy = TupleRouterM$Network$getQueryPayLoad(&TupleRouterM$mMsg); TupleRouterM$SET_READING_QUERY(); TupleRouterM$UNSET_SPACE_ALLOCED(); TupleRouterM$mTriedAllocWaiting = FALSE; pq.qid = qmsg->qid; pq.numFields = qmsg->numFields; pq.numExprs = qmsg->numExprs; *qmsgCopy = *qmsg; if (!TupleRouterM$allocPendingQuery(&TupleRouterM$continueQuery, &pq)) { TupleRouterM$UNSET_READING_QUERY(); } } } else { #line 839 if (TOS_LOCAL_ADDRESS == qmsg->queryRoot) { TupleRouterM$forwardQuery(qmsg); } } #line 841 TupleRouterM$UNSET_IS_IN_QUERY_MSG(); } return SUCCESS; } # 161 "d:/tinyos-1.x/tos/lib/TinyDB/Network.nc" inline static result_t NetworkM$Network$querySub(QueryMessagePtr arg_0xa321760){ #line 161 unsigned char result; #line 161 #line 161 result = TupleRouterM$Network$querySub(arg_0xa321760); #line 161 #line 161 return result; #line 161 } #line 161 static inline # 625 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkM.nc" TOS_MsgPtr NetworkM$RcvQueryMsg$receive(TOS_MsgPtr msg) #line 625 { NetworkMessage *nw = (NetworkMessage *)msg->data; uint8_t rootId = 0; if (NetworkM$filterMessage(msg, TRUE)) { #line 630 return msg; } NetworkM$checkRoot(msg, &rootId); if (NetworkM$processHeader(nw->hdr, NetworkM$QUERY_TYPE, rootId)) { if (!NetworkM$mCentralized) { NetworkM$Network$querySub(NetworkM$Network$getQueryPayLoad(msg)); } else #line 638 { NetworkM$Network$sendDataMessage(msg); } } return msg; } # 142 "d:/tinyos-1.x/tos/lib/TinyDB/QueryResultIntf.nc" inline static TinyDBError TupleRouterM$QueryResultIntf$fromBytes(QueryResultPtr arg_0xa62bb48, QueryResultPtr arg_0xa62bc90, ParsedQueryPtr arg_0xa62bdd8){ #line 142 enum __nesc_unnamed4265 result; #line 142 #line 142 result = QueryResult$QueryResultIntf$fromBytes(arg_0xa62bb48, arg_0xa62bc90, arg_0xa62bdd8); #line 142 #line 142 return result; #line 142 } #line 142 # 72 "d:/tinyos-1.x/tos/interfaces/SendMsg.nc" inline static result_t NetworkM$SendQueryRequest$send(uint16_t arg_0xa32f9f0, uint8_t arg_0xa32fb30, TOS_MsgPtr arg_0xa32fc78){ #line 72 unsigned char result; #line 72 #line 72 result = AMStandard$SendMsg$send(kQUERY_REQUEST_MESSAGE_ID, arg_0xa32f9f0, arg_0xa32fb30, arg_0xa32fc78); #line 72 #line 72 return result; #line 72 } #line 72 static inline # 471 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkM.nc" TinyDBError NetworkM$Network$sendQueryRequest(TOS_MsgPtr msg, uint16_t to) #line 471 { NetworkMessage *nw = (NetworkMessage *)msg->data; uint8_t rootId = 0; bool amRoot = NetworkM$checkRoot(msg, &rootId); NetworkM$mMsg = msg; NetworkM$mAmId = kQUERY_REQUEST_MESSAGE_ID; if (!NetworkM$mRadio) { NetworkM$mRadio = TRUE; NetworkM$initHeader(& nw->hdr, amRoot, rootId); if (NetworkM$SendQueryRequest$send(to, kMSG_LEN, msg) == SUCCESS) { return err_NoError; } else #line 486 { NetworkM$mRadio = FALSE; return err_MessageSendFailed; } } return err_MessageSendFailed; } # 117 "d:/tinyos-1.x/tos/lib/TinyDB/Network.nc" inline static TinyDBError TupleRouterM$Network$sendQueryRequest(TOS_MsgPtr arg_0xa31b588, uint16_t arg_0xa31b6d0){ #line 117 enum __nesc_unnamed4265 result; #line 117 #line 117 result = NetworkM$Network$sendQueryRequest(arg_0xa31b588, arg_0xa31b6d0); #line 117 #line 117 return result; #line 117 } #line 117 #line 110 inline static QueryRequestMessagePtr TupleRouterM$Network$getQueryRequestPayLoad(TOS_MsgPtr arg_0xa31af88){ #line 110 struct __nesc_unnamed4300 *result; #line 110 #line 110 result = NetworkM$Network$getQueryRequestPayLoad(arg_0xa31af88); #line 110 #line 110 return result; #line 110 } #line 110 static inline # 1453 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" result_t TupleRouterM$Network$snoopedSub(QueryResultPtr qrMsg, bool isParent, uint16_t senderid) #line 1453 { ParsedQuery *q; char qid; if (senderid != 0) { QueryRequestMessage *qreq = TupleRouterM$Network$getQueryRequestPayLoad(&TupleRouterM$mMsg); qid = TupleRouterM$QueryResultIntf$queryIdFromMsg(qrMsg); if (!TupleRouterM$getQuery(qid, &q)) { qreq->qid = qid; if (!TupleRouterM$IS_SENDING_MESSAGE()) { TupleRouterM$SET_SENDING_MESSAGE(); if (TupleRouterM$Network$sendQueryRequest(&TupleRouterM$mMsg, senderid) != err_NoError) { TupleRouterM$UNSET_SENDING_MESSAGE(); } } } } if (isParent) { QueryResult qr; qid = TupleRouterM$QueryResultIntf$queryIdFromMsg(qrMsg); if (TupleRouterM$getQuery(qid, &q)) { TupleRouterM$QueryResultIntf$fromBytes(qrMsg, &qr, q); if (qr.epoch > q->currentEpoch + 1) { q->currentEpoch = qr.epoch; } } } return SUCCESS; } # 169 "d:/tinyos-1.x/tos/lib/TinyDB/Network.nc" inline static result_t NetworkM$Network$snoopedSub(QueryResultPtr arg_0xa321c40, bool arg_0xa321d88, uint16_t arg_0xa321ed8){ #line 169 unsigned char result; #line 169 #line 169 result = TupleRouterM$Network$snoopedSub(arg_0xa321c40, arg_0xa321d88, arg_0xa321ed8); #line 169 #line 169 return result; #line 169 } #line 169 # 85 "d:/tinyos-1.x/tos/lib/TinyDB/DBBuffer.nc" inline static TinyDBError TupleRouterM$DBBuffer$enqueue(uint8_t arg_0xa62ddd8, QueryResultPtr arg_0xa62df20, bool *arg_0xa61e098, ParsedQueryPtr arg_0xa61e1e0){ #line 85 enum __nesc_unnamed4265 result; #line 85 #line 85 result = DBBufferC$DBBuffer$enqueue(arg_0xa62ddd8, arg_0xa62df20, arg_0xa61e098, arg_0xa61e1e0); #line 85 #line 85 return result; #line 85 } #line 85 # 81 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQueryIntf.nc" inline static Expr TupleRouterM$ParsedQueryIntf$getExpr(ParsedQueryPtr arg_0xa601da8, uint8_t arg_0xa601ee8){ #line 81 struct __nesc_unnamed4288 result; #line 81 #line 81 result = ParsedQuery$ParsedQueryIntf$getExpr(arg_0xa601da8, arg_0xa601ee8); #line 81 #line 81 return result; #line 81 } #line 81 static inline # 1567 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" result_t TupleRouterM$Network$dataSub(QueryResultPtr qrMsg) #line 1567 { QueryResult qr; ParsedQuery *q; short i; bool gotAgg = FALSE; bool pending; if (TupleRouterM$getQuery(TupleRouterM$QueryResultIntf$queryIdFromMsg(qrMsg), &q)) { { } #line 1581 ; if (q->markedForDeletion) { q->markedForDeletion = TupleRouterM$EPOCHS_TIL_DELETION; } TupleRouterM$QueryResultIntf$fromBytes(qrMsg, &qr, q); for (i = 0; i < q->numExprs; i++) { Expr e = TupleRouterM$ParsedQueryIntf$getExpr(q, i); #line 1592 if (e.opType != kSEL) { gotAgg = TRUE; break; } } if (!gotAgg) { TinyDBError err; #line 1599 { } #line 1599 ; TupleRouterM$mEnqResult = * (QueryResultPtr )qrMsg; err = TupleRouterM$DBBuffer$enqueue(q->bufferId, &TupleRouterM$mEnqResult, &pending, q); if (err != err_ResultBufferBusy && err != err_NoError) { #line 1609 TupleRouterM$signalError(err, 1609); } } else #line 1610 { TupleRouterM$mResult = qr; if (!TupleRouterM$IS_AGGREGATING_RESULT()) { TupleRouterM$aggregateResult(q, &TupleRouterM$mResult, 0); } } } return SUCCESS; } # 155 "d:/tinyos-1.x/tos/lib/TinyDB/Network.nc" inline static result_t NetworkM$Network$dataSub(QueryResultPtr arg_0xa321278){ #line 155 unsigned char result; #line 155 #line 155 result = TupleRouterM$Network$dataSub(arg_0xa321278); #line 155 #line 155 return result; #line 155 } #line 155 # 108 "d:/tinyos-1.x/tos/interfaces/Leds.nc" inline static result_t NetworkM$Leds$redToggle(void){ #line 108 unsigned char result; #line 108 #line 108 result = LedsC$Leds$redToggle(); #line 108 #line 108 return result; #line 108 } #line 108 static inline # 667 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkM.nc" TOS_MsgPtr NetworkM$RcvDataMsg$receive(TOS_MsgPtr msg) #line 667 { NetworkMessage *nw = (NetworkMessage *)msg->data; uint8_t rootId; bool amRoot; if (NetworkM$filterMessage(msg, TRUE)) { #line 672 return msg; } amRoot = NetworkM$checkRoot(msg, &rootId); if (amRoot && nw->hdr.senderid == TOS_UART_ADDR) { if (!NetworkM$mRadio) { NetworkM$mRadio = TRUE; NetworkM$mLocal = TRUE; NetworkM$initHeader(& nw->hdr, TRUE, rootId); NetworkM$Leds$redToggle(); if (NetworkM$SendDataMsg$send(TOS_BCAST_ADDR, kMSG_LEN, msg) == FAIL) { NetworkM$mIdx--; NetworkM$mRadio = FALSE; NetworkM$mLocal = FALSE; } } } if (NetworkM$processHeader(nw->hdr, NetworkM$DATA_TYPE, rootId) && nw->hdr.senderid != NetworkM$mRoots[rootId]) { NetworkM$Network$dataSub(NetworkM$Network$getDataPayLoad(msg)); } else { #line 694 if (nw->hdr.senderid != TOS_UART_ADDR) { NetworkM$Network$snoopedSub(NetworkM$Network$getDataPayLoad(msg), NetworkM$mParentIx[rootId] != NetworkM$PARENT_UNKNOWN && nw->hdr.senderid == NetworkM$mRelatives[NetworkM$mParentIx[rootId]], nw->hdr.senderid); } } #line 697 return msg; } static inline # 282 "d:/tinyos-1.x/tos/system/AMStandard.nc" TOS_MsgPtr AMStandard$ReceiveMsg$default$receive(uint8_t id, TOS_MsgPtr msg) #line 282 { return msg; } # 106 "d:/tinyos-1.x/tos/interfaces/ReceiveMsg.nc" inline static TOS_MsgPtr AMStandard$ReceiveMsg$receive(uint8_t arg_0xa3e52e0, TOS_MsgPtr arg_0xa33a580){ #line 106 struct TOS_Msg *result; #line 106 #line 106 switch (arg_0xa3e52e0) { #line 106 case kQUERY_MESSAGE_ID: #line 106 result = NetworkM$RcvQueryMsg$receive(arg_0xa33a580); #line 106 break; #line 106 case kCOMMAND_MESSAGE_ID: #line 106 result = NetworkM$RcvCommandMsg$receive(arg_0xa33a580); #line 106 break; #line 106 case kQUERY_REQUEST_MESSAGE_ID: #line 106 result = NetworkM$RcvRequestMsg$receive(arg_0xa33a580); #line 106 break; #line 106 case kSTATUS_MESSAGE_ID: #line 106 result = NetworkM$RcvStatusMessage$receive(arg_0xa33a580); #line 106 break; #line 106 case kDATA_MESSAGE_ID: #line 106 result = NetworkM$RcvDataMsg$receive(arg_0xa33a580); #line 106 break; #line 106 default: #line 106 result = AMStandard$ReceiveMsg$default$receive(arg_0xa3e52e0, arg_0xa33a580); #line 106 } #line 106 #line 106 return result; #line 106 } #line 106 static inline # 815 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkM.nc" void NetworkM$tinydbParentInit(DbMsgHdr header, short clockCnt, uint8_t rootId) { NetworkM$mParentIx[rootId] = 0; NetworkM$mRelOccupiedBits = 0x1; NetworkM$mRelatives[0] = header.senderid; NetworkM$mLastIdxRelative[0] = header.idx; NetworkM$mCommProb[0] = 0xff; NetworkM$mRelLevel[rootId][0] = header.level; { } #line 832 ; } static inline #line 920 short NetworkM$tinydbUpdateSenderStats(DbMsgHdr header, short clockCnt, uint8_t rootId) { int i; #line 922 int j; #line 922 int numDrops; unsigned short oldProb; for (i = 0; i < NetworkM$NUM_RELATIVES; i++) { oldProb = NetworkM$mCommProb[i]; if ( #line 927 NetworkM$mRelOccupiedBits & (0x1 << i) && NetworkM$mRelatives[i] == header.senderid) { if (header.idx > NetworkM$mLastIdxRelative[i]) { if (NetworkM$mLastIdxRelative[i] == 0) { numDrops = 0; } else { numDrops = header.idx - NetworkM$mLastIdxRelative[i] - 1; } } else { #line 938 if (NetworkM$mLastIdxRelative[i] >= 0x3f && header.idx < NetworkM$mLastIdxRelative[i] - 0x3f) { numDrops = 0x7f - NetworkM$mLastIdxRelative[i] + header.idx; } else { numDrops = -1; } } if (numDrops >= 0) { if (numDrops > 0) { } #line 950 ; for (j = 0; j < numDrops; j++) NetworkM$mCommProb[i] = NetworkM$mCommProb[i] - (NetworkM$mCommProb[i] >> NetworkM$ALPHABITS); NetworkM$mCommProb[i] -= NetworkM$mCommProb[i] >> NetworkM$ALPHABITS; NetworkM$mCommProb[i] += (1 << (8 - NetworkM$ALPHABITS)) - 1; } else { NetworkM$mCommProb[i] = NetworkM$mCommProb[i] - (NetworkM$mCommProb[i] >> NetworkM$ALPHABITS); NetworkM$mCommProb[i] += (1 << (8 - 2 * NetworkM$ALPHABITS)) - 1; } NetworkM$mLastIdxRelative[i] = header.idx; NetworkM$mRelLevel[rootId][i] = header.level; return i; } } return NetworkM$BAD_IX; } static inline #line 838 bool NetworkM$isParent(uint8_t idx) #line 838 { short i; #line 840 for (i = 0; i < NetworkM$NUM_ROOTS; i++) { if (NetworkM$mRoots[i] != NetworkM$UNKNOWN_ROOT && NetworkM$mParentIx[NetworkM$mRoots[i]] == idx) { return TRUE; } } #line 844 return FALSE; } static inline #line 983 void NetworkM$tinydbRelativeReplace(DbMsgHdr header, short clockCnt, uint8_t rootId) { int i; short worst; unsigned char lowestProb = 255; for (i = 0, worst = -1; i < NetworkM$NUM_RELATIVES; i++) { if (!(NetworkM$mRelOccupiedBits & (0x1 << i))) { worst = i; break; } else { if (( #line 998 worst == -1 || NetworkM$mCommProb[i] < lowestProb) && !NetworkM$isParent(i)) { worst = i; lowestProb = NetworkM$mCommProb[i]; } } } NetworkM$mRelOccupiedBits |= 0x1 << worst; NetworkM$mRelatives[worst] = header.senderid; NetworkM$mLastIdxRelative[worst] = header.idx; NetworkM$mCommProb[worst] = 0xff; NetworkM$mRelLevel[rootId][worst] = header.level; } static inline # 422 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$UNSET_AGGREGATING_RESULT(void) #line 422 { #line 422 TupleRouterM$mPendingMask &= TupleRouterM$AGGREGATING_BIT ^ 0xFFFF; } static inline #line 423 void TupleRouterM$SET_AGGREGATING_RESULT(void) #line 423 { #line 423 TupleRouterM$mPendingMask |= TupleRouterM$AGGREGATING_BIT; } static inline # 387 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQuery.nc" TinyDBError ParsedQuery$AggOperator$processedResult(QueryResultPtr qr, ParsedQueryPtr q, ExprPtr e) #line 387 { return err_NoError; } static inline # 1551 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" TinyDBError TupleRouterM$AggOperator$processedResult(QueryResult *qr, ParsedQuery *q, Expr *e) #line 1551 { TupleRouterM$aggregateResult(q, qr, e->idx + 1); return err_NoError; } # 127 "d:/tinyos-1.x/tos/lib/TinyDB/Operator.nc" inline static TinyDBError AggOperator$Operator$processedResult(QueryResultPtr arg_0xa60c9d0, ParsedQueryPtr arg_0xa60cb18, ExprPtr arg_0xa60cc58){ #line 127 enum __nesc_unnamed4265 result; #line 127 #line 127 result = TupleRouterM$AggOperator$processedResult(arg_0xa60c9d0, arg_0xa60cb18, arg_0xa60cc58); #line 127 result = ParsedQuery$AggOperator$processedResult(arg_0xa60c9d0, arg_0xa60cb18, arg_0xa60cc58); #line 127 #line 127 return result; #line 127 } #line 127 static inline # 33 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinAvgM.nc" result_t WinAvgM$Aggregate$merge(char *destdata, char *mergedata, ParamList *params, ParamVals *paramValues) #line 33 { WinAvgM$TemporalAverageData *dest = (WinAvgM$TemporalAverageData *)destdata; WinAvgM$TemporalAverageData *merge = (WinAvgM$TemporalAverageData *)mergedata; uint8_t epochsPerWindow = getEpochsPerWindow(paramValues); uint8_t slidingDist = getSlidingDist(paramValues); dest->lastResult.sum += merge->lastResult.sum; dest->lastResult.count += merge->lastResult.count; if (epochsPerWindow > slidingDist) { uint16_t i; #line 44 uint16_t n; #line 45 for (i = dest->head, n = 0; n < dest->nvals; i = (i + 1) % dest->size, n++) { dest->value[i].sum += merge->value[i].sum; dest->value[i].count += merge->value[i].count; } } return SUCCESS; } static inline # 17 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinSumM.nc" result_t WinSumM$Aggregate$merge(char *destdata, char *mergedata, ParamList *params, ParamVals *paramValues) #line 17 { TemporalAlgebraicData *dest = (TemporalAlgebraicData *)destdata; TemporalAlgebraicData *merge = (TemporalAlgebraicData *)mergedata; uint8_t epochsPerWindow = getEpochsPerWindow(paramValues); uint8_t slidingDist = getSlidingDist(paramValues); dest->lastResult.value += merge->lastResult.value; if (epochsPerWindow > slidingDist) { uint16_t i; #line 27 uint16_t n; #line 28 for (i = dest->head, n = 0; n < dest->nvals; i = (i + 1) % dest->size, n++) dest->value[i] += merge->value[i]; } return SUCCESS; } static inline # 17 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinCountM.nc" result_t WinCountM$Aggregate$merge(char *destdata, char *mergedata, ParamList *params, ParamVals *paramValues) #line 17 { TemporalAlgebraicData *dest = (TemporalAlgebraicData *)destdata; TemporalAlgebraicData *merge = (TemporalAlgebraicData *)mergedata; uint8_t epochsPerWindow = getEpochsPerWindow(paramValues); uint8_t slidingDist = getSlidingDist(paramValues); dest->lastResult.value += merge->lastResult.value; if (epochsPerWindow > slidingDist) { uint16_t i; #line 27 uint16_t n; #line 28 for (i = dest->head, n = 0; n < dest->nvals; i = (i + 1) % dest->size, n++) dest->value[i] += merge->value[i]; } return SUCCESS; } static inline # 17 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinMaxM.nc" result_t WinMaxM$Aggregate$merge(char *destdata, char *mergedata, ParamList *params, ParamVals *paramValues) #line 17 { TemporalAlgebraicData *dest = (TemporalAlgebraicData *)destdata; TemporalAlgebraicData *merge = (TemporalAlgebraicData *)mergedata; uint8_t epochsPerWindow = getEpochsPerWindow(paramValues); uint8_t slidingDist = getSlidingDist(paramValues); if (dest->lastResult.value < merge->lastResult.value) { dest->lastResult.value = merge->lastResult.value; dest->lastResult.id = merge->lastResult.id; } if (epochsPerWindow > slidingDist) { uint16_t i; #line 30 uint16_t n; #line 31 for (i = dest->head, n = 0; n < dest->nvals; i = (i + 1) % dest->size, n++) { if (dest->value[i] < merge->value[i]) { dest->value[i] = merge->value[i]; } } } return SUCCESS; } static inline # 16 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/WinMinM.nc" result_t WinMinM$Aggregate$merge(char *destdata, char *mergedata, ParamList *params, ParamVals *paramValues) #line 16 { TemporalAlgebraicData *dest = (TemporalAlgebraicData *)destdata; TemporalAlgebraicData *merge = (TemporalAlgebraicData *)mergedata; uint8_t epochsPerWindow = getEpochsPerWindow(paramValues); uint8_t slidingDist = getSlidingDist(paramValues); if (dest->lastResult.value > merge->lastResult.value) { dest->lastResult.value = merge->lastResult.value; dest->lastResult.id = merge->lastResult.id; } if (epochsPerWindow > slidingDist) { uint16_t i; #line 29 uint16_t n; #line 30 for (i = dest->head, n = 0; n < dest->nvals; i = (i + 1) % dest->size, n++) { if (dest->value[i] > merge->value[i]) { dest->value[i] = merge->value[i]; } } } return SUCCESS; } static inline # 20 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/ExpAvgM.nc" result_t ExpAvgM$Aggregate$merge(char *destdata, char *mergedata, ParamList *params, ParamVals *paramValues) #line 20 { ExpAvgM$ExpAvgData *dest = (ExpAvgM$ExpAvgData *)destdata; ExpAvgM$ExpAvgData *merge = (ExpAvgM$ExpAvgData *)mergedata; uint8_t newBits = 16 - getNewBitsPerSample(paramValues); dest->value = dest->value - (dest->value >> newBits) + (merge->value >> newBits); return SUCCESS; } static inline # 16 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AvgM.nc" result_t AvgM$Aggregate$merge(char *destdata, char *mergedata, ParamList *params, ParamVals *paramValues) #line 16 { AverageData *dest = (AverageData *)destdata; AverageData *merge = (AverageData *)mergedata; dest->sum += merge->sum; dest->count += merge->count; return SUCCESS; } static inline # 17 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/SumM.nc" result_t SumM$Aggregate$merge(char *destdata, char *mergedata, ParamList *params, ParamVals *paramValues) #line 17 { AlgebraicData *dest = (AlgebraicData *)destdata; AlgebraicData *merge = (AlgebraicData *)mergedata; dest->value += merge->value; return SUCCESS; } static inline # 17 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/CountM.nc" result_t CountM$Aggregate$merge(char *destdata, char *mergedata, ParamList *params, ParamVals *paramValues) #line 17 { AlgebraicData *dest = (AlgebraicData *)destdata; AlgebraicData *merge = (AlgebraicData *)mergedata; dest->value += merge->value; return SUCCESS; } static inline # 17 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/MinM.nc" result_t MinM$Aggregate$merge(char *destdata, char *mergedata, ParamList *params, ParamVals *paramValues) #line 17 { AlgebraicData *dest = (AlgebraicData *)destdata; AlgebraicData *merge = (AlgebraicData *)mergedata; if (dest->value > merge->value) { dest->value = merge->value; dest->id = merge->id; } return SUCCESS; } static inline # 17 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/MaxM.nc" result_t MaxM$Aggregate$merge(char *destdata, char *mergedata, ParamList *params, ParamVals *paramValues) #line 17 { AlgebraicData *dest = (AlgebraicData *)destdata; AlgebraicData *merge = (AlgebraicData *)mergedata; if (dest->value < merge->value) { dest->value = merge->value; dest->id = merge->id; } return SUCCESS; } static inline # 54 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AggregateUseM.nc" result_t AggregateUseM$Agg$default$merge(uint8_t id, char *destdata, char *mergedata, ParamList *params, ParamVals *paramValues) #line 55 { return SUCCESS; } # 75 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/Aggregate.nc" inline static result_t AggregateUseM$Agg$merge(uint8_t arg_0xa9500a0, char *arg_0xa950e50, char *arg_0xa950fa8, ParamList *arg_0xa951108, ParamVals *arg_0xa951270){ #line 75 unsigned char result; #line 75 #line 75 switch (arg_0xa9500a0) { #line 75 case kSUM: #line 75 result = SumM$Aggregate$merge(arg_0xa950e50, arg_0xa950fa8, arg_0xa951108, arg_0xa951270); #line 75 break; #line 75 case kMIN: #line 75 result = MinM$Aggregate$merge(arg_0xa950e50, arg_0xa950fa8, arg_0xa951108, arg_0xa951270); #line 75 break; #line 75 case kMAX: #line 75 result = MaxM$Aggregate$merge(arg_0xa950e50, arg_0xa950fa8, arg_0xa951108, arg_0xa951270); #line 75 break; #line 75 case kCOUNT: #line 75 result = CountM$Aggregate$merge(arg_0xa950e50, arg_0xa950fa8, arg_0xa951108, arg_0xa951270); #line 75 break; #line 75 case kAVG: #line 75 result = AvgM$Aggregate$merge(arg_0xa950e50, arg_0xa950fa8, arg_0xa951108, arg_0xa951270); #line 75 break; #line 75 case kEXP_AVG: #line 75 result = ExpAvgM$Aggregate$merge(arg_0xa950e50, arg_0xa950fa8, arg_0xa951108, arg_0xa951270); #line 75 break; #line 75 case kWIN_AVG: #line 75 result = WinAvgM$Aggregate$merge(arg_0xa950e50, arg_0xa950fa8, arg_0xa951108, arg_0xa951270); #line 75 break; #line 75 case kWIN_SUM: #line 75 result = WinSumM$Aggregate$merge(arg_0xa950e50, arg_0xa950fa8, arg_0xa951108, arg_0xa951270); #line 75 break; #line 75 case kWIN_MIN: #line 75 result = WinMinM$Aggregate$merge(arg_0xa950e50, arg_0xa950fa8, arg_0xa951108, arg_0xa951270); #line 75 break; #line 75 case kWIN_MAX: #line 75 result = WinMaxM$Aggregate$merge(arg_0xa950e50, arg_0xa950fa8, arg_0xa951108, arg_0xa951270); #line 75 break; #line 75 case kWIN_COUNT: #line 75 result = WinCountM$Aggregate$merge(arg_0xa950e50, arg_0xa950fa8, arg_0xa951108, arg_0xa951270); #line 75 break; #line 75 default: #line 75 result = AggregateUseM$Agg$default$merge(arg_0xa9500a0, arg_0xa950e50, arg_0xa950fa8, arg_0xa951108, arg_0xa951270); #line 75 } #line 75 #line 75 return result; #line 75 } #line 75 static inline # 21 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AggregateUseM.nc" result_t AggregateUseM$AggregateUse$merge(uint8_t id, char *destdata, char *mergedata, ParamList *params, ParamVals *paramValues) #line 21 { return AggregateUseM$Agg$merge(id, destdata, mergedata, params, paramValues); } # 78 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/AggregateUse.nc" inline static result_t AggOperator$AggregateUse$merge(uint8_t arg_0xa8f59a0, char *arg_0xa8f5af8, char *arg_0xa8f5c50, ParamList *arg_0xa8f5db0, ParamVals *arg_0xa8f5f18){ #line 78 unsigned char result; #line 78 #line 78 result = AggregateUseM$AggregateUse$merge(arg_0xa8f59a0, arg_0xa8f5af8, arg_0xa8f5c50, arg_0xa8f5db0, arg_0xa8f5f18); #line 78 #line 78 return result; #line 78 } #line 78 static inline # 615 "d:/tinyos-1.x/tos/lib/TinyDB/AggOperator.nc" void AggOperator$mergeAggregateValues(AggOperator$GroupRecord *dest, AggOperator$GroupRecord *merge, Expr *e) #line 615 { ParamVals paramVals; #line 617 setParamValues(¶mVals, e); dest->u.empty = FALSE; if (e->ex.agg.op == kADP_DELTA) { setCurrentEpoch(¶mVals, AggOperator$mCurQuery->currentEpoch); } AggOperator$AggregateUse$merge(e->ex.agg.op, dest->aggdata, merge->aggdata, (void *)0, ¶mVals); } static inline #line 207 void AggOperator$updateGroupForPartialResult(AggOperator$GroupRecord *d) #line 207 { AggOperator$GroupRecord *gr = (AggOperator$GroupRecord *)((QueryResult *)AggOperator$mCurResult)->d.data; { } #line 210 ; AggOperator$mergeAggregateValues(d, gr, AggOperator$mCurExpr); AggOperator$Operator$processedResult(AggOperator$mCurResult, AggOperator$mCurQuery, AggOperator$mCurExpr); } static inline #line 177 TinyDBError AggOperator$Operator$processPartialResult(QueryResultPtr qr, ParsedQueryPtr qs, ExprPtr e) #line 177 { AggOperator$GroupRecord *gr = (AggOperator$GroupRecord *)qr->d.data; if (qr->qrType != kAGG_SINGLE_FIELD) { #line 180 return err_InvalidAggregateRecord; } if (gr->u.exprIdx != e->idx) { return err_InvalidAggregateRecord; } if (e->opState == (OperatorStateHandle )AggOperator$QUERY_DONE_STATE) { #line 185 return err_NoError; } AggOperator$mCurExpr = e; AggOperator$mCurQuery = qs; AggOperator$mCurResult = qr; { } #line 190 ; AggOperator$getGroupData(qs, gr->groupNo, e, &AggOperator$updateGroupForPartialResult); return err_NoError; } # 113 "d:/tinyos-1.x/tos/lib/TinyDB/Operator.nc" inline static TinyDBError TupleRouterM$AggOperator$processPartialResult(QueryResultPtr arg_0xa60f9b0, ParsedQueryPtr arg_0xa60faf8, ExprPtr arg_0xa60fc38){ #line 113 enum __nesc_unnamed4265 result; #line 113 #line 113 result = AggOperator$Operator$processPartialResult(arg_0xa60f9b0, arg_0xa60faf8, arg_0xa60fc38); #line 113 #line 113 return result; #line 113 } #line 113 static inline # 80 "d:/tinyos-1.x/tos/lib/TinyDB/Query.nc" result_t Query$QueryIntf$setField(QueryPtr q, uint8_t idx, Field f) #line 80 { q->fields[idx] = f; return SUCCESS; } # 91 "d:/tinyos-1.x/tos/lib/TinyDB/QueryIntf.nc" inline static result_t TupleRouterM$QueryIntf$setField(QueryPtr arg_0xa5fa488, uint8_t arg_0xa5fa5c8, Field arg_0xa5fa708){ #line 91 unsigned char result; #line 91 #line 91 result = Query$QueryIntf$setField(arg_0xa5fa488, arg_0xa5fa5c8, arg_0xa5fa708); #line 91 #line 91 return result; #line 91 } #line 91 static inline # 91 "d:/tinyos-1.x/tos/lib/TinyDB/Query.nc" result_t Query$QueryIntf$setExpr(QueryPtr q, uint8_t idx, Expr e) #line 91 { * (Expr *)(char *)((char *)q + sizeof(Query ) + ( q->numFields - 1) * sizeof(Field ) + idx * sizeof(Expr )) = e; return SUCCESS; } # 101 "d:/tinyos-1.x/tos/lib/TinyDB/QueryIntf.nc" inline static result_t TupleRouterM$QueryIntf$setExpr(QueryPtr arg_0xa5fb110, uint8_t arg_0xa5fb250, Expr arg_0xa5fb390){ #line 101 unsigned char result; #line 101 #line 101 result = Query$QueryIntf$setExpr(arg_0xa5fb110, arg_0xa5fb250, arg_0xa5fb390); #line 101 #line 101 return result; #line 101 } #line 101 static inline # 102 "d:/tinyos-1.x/tos/lib/TinyDB/Query.nc" bool Query$QueryIntf$exprsComplete(Query q) #line 102 { return (q.knownExprs & 0xFFFF) == 0xFFFF; } # 107 "d:/tinyos-1.x/tos/lib/TinyDB/QueryIntf.nc" inline static bool TupleRouterM$QueryIntf$exprsComplete(Query arg_0xa5fbc70){ #line 107 unsigned char result; #line 107 #line 107 result = Query$QueryIntf$exprsComplete(arg_0xa5fbc70); #line 107 #line 107 return result; #line 107 } #line 107 static inline # 98 "d:/tinyos-1.x/tos/lib/TinyDB/Query.nc" bool Query$QueryIntf$fieldsComplete(Query q) #line 98 { return (q.knownFields & 0xFFFF) == 0xFFFF; } # 104 "d:/tinyos-1.x/tos/lib/TinyDB/QueryIntf.nc" inline static bool TupleRouterM$QueryIntf$fieldsComplete(Query arg_0xa5fb840){ #line 104 unsigned char result; #line 104 #line 104 result = Query$QueryIntf$fieldsComplete(arg_0xa5fb840); #line 104 #line 104 return result; #line 104 } #line 104 static inline # 3115 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" bool TupleRouterM$queryComplete(Query q) #line 3115 { { } #line 3116 ; if (q.bufferType != kRADIO && ! q.hasBuf) { #line 3119 return FALSE; } #line 3120 if (! q.hasEvent && q.needsEvent) { #line 3120 return FALSE; } #line 3121 if (q.hasForClause && q.numEpochs == 0) { #line 3121 return FALSE; } #line 3122 return TupleRouterM$QueryIntf$fieldsComplete(q) && TupleRouterM$QueryIntf$exprsComplete(q); } static inline #line 393 void TupleRouterM$SET_PARSING_QUERY(void) #line 393 { #line 393 TupleRouterM$mPendingMask |= TupleRouterM$PARSING_BIT; } static inline # 117 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQuery.nc" short ParsedQuery$ParsedQueryIntf$baseSize(QueryPtr q) #line 117 { return sizeof(ParsedQuery ) + sizeof(char ) * (q->numFields - 1) + sizeof(Expr ) * q->numExprs; } # 97 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQueryIntf.nc" inline static short TupleRouterM$ParsedQueryIntf$baseSize(QueryPtr arg_0xa5f7930){ #line 97 short result; #line 97 #line 97 result = ParsedQuery$ParsedQueryIntf$baseSize(arg_0xa5f7930); #line 97 #line 97 return result; #line 97 } #line 97 static inline # 3090 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" bool TupleRouterM$allocQuery(TupleRouterM$MemoryCallback callback, Query *q) #line 3090 { short size = sizeof(TupleRouterM$QueryListEl ) - sizeof(ParsedQuery ) + TupleRouterM$ParsedQueryIntf$baseSize(q); TupleRouterM$mAllocState = TupleRouterM$STATE_ALLOC_PARSED_QUERY; TupleRouterM$mAllocCallback = callback; return TupleRouterM$MemAlloc$allocate((Handle *)&TupleRouterM$mTmpHandle, size); } # 118 "d:/tinyos-1.x/tos/interfaces/MemAlloc.nc" inline static result_t TupleRouterM$MemAlloc$unlock(Handle arg_0xa608ef0){ #line 118 unsigned char result; #line 118 #line 118 result = TinyAlloc$MemAlloc$unlock(arg_0xa608ef0); #line 118 #line 118 return result; #line 118 } #line 118 static inline # 110 "d:/tinyos-1.x/tos/lib/TinyDB/TableM.nc" result_t TableM$Table$getNamedField(ParsedQuery *pq, char *field, uint8_t *fieldId) #line 110 { int i = 0; char *names; if (pq->tableInfo == (void *)0) { #line 114 return FAIL; } #line 115 names = TableM$getAliases(pq); for (i = 0; i < pq->numFields; i++) { if (strcmp(field, &names[TableM$nameOffset(names, i)]) == 0) { *fieldId = i; return SUCCESS; } } return FAIL; } # 73 "d:/tinyos-1.x/tos/lib/TinyDB/Table.nc" inline static result_t ParsedQuery$Table$getNamedField(ParsedQuery *arg_0xa63a840, char *arg_0xa63a990, uint8_t *arg_0xa63aae8){ #line 73 unsigned char result; #line 73 #line 73 result = TableM$Table$getNamedField(arg_0xa63a840, arg_0xa63a990, arg_0xa63aae8); #line 73 #line 73 return result; #line 73 } #line 73 # 66 "d:/tinyos-1.x/tos/interfaces/AttrUse.nc" inline static AttrDescPtr ParsedQuery$AttrUse$getAttr(char *arg_0xa5e4850){ #line 66 struct __nesc_unnamed4260 *result; #line 66 #line 66 result = Attr$AttrUse$getAttr(arg_0xa5e4850); #line 66 #line 66 return result; #line 66 } #line 66 static inline # 212 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQuery.nc" TinyDBError ParsedQuery$ParsedQueryIntf$getResultId(ParsedQueryPtr q, Field *f, uint8_t *id) #line 212 { AttrDescPtr attr = ParsedQuery$AttrUse$getAttr(f->name); uint8_t i; uint8_t fid = 0xFF; if (attr != (void *)0) { for (i = 0; i < q->numFields; i++) { if (q->queryToSchemaFieldMap[i] == attr->idx) { fid = i; } } } if (fid == 0xFF) { if (q->tableInfo != (void *)0) { if (ParsedQuery$Table$getNamedField(q, f->name, &fid) == FAIL) { return err_InvalidIndex; } } } if (fid == 0xFF) { #line 250 return err_InvalidIndex; } for (i = 0; i < q->numExprs; i++) { Expr *e = ParsedQuery$ParsedQueryIntf$getExprPtr(q, i); #line 258 if (e->opType != kSEL && e->ex.agg.groupingField == fid) { *id = GROUP_FIELD; return err_NoError; } } if (f->op == kNOOP) { *id = fid; return err_NoError; } else #line 267 { for (i = 0; i < q->numExprs; i++) { Expr *e = ParsedQuery$ParsedQueryIntf$getExprPtr(q, i); #line 270 if (e->opType != kSEL && e->ex.agg.field == fid && e->ex.agg.op == f->op) { *id = e->idx; return err_NoError; } } } return err_InvalidIndex; } # 131 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQueryIntf.nc" inline static TinyDBError DBBufferC$ParsedQueryIntf$getResultId(ParsedQueryPtr arg_0xa613320, Field *arg_0xa613478, uint8_t *arg_0xa6135d0){ #line 131 enum __nesc_unnamed4265 result; #line 131 #line 131 result = ParsedQuery$ParsedQueryIntf$getResultId(arg_0xa613320, arg_0xa613478, arg_0xa6135d0); #line 131 #line 131 return result; #line 131 } #line 131 static inline # 1083 "d:/tinyos-1.x/tos/lib/TinyDB/DBBufferC.nc" TinyDBError DBBufferC$DBBuffer$getFieldId(uint8_t bufferId, FieldPtr f, uint8_t *id) #line 1083 { TinyDBError err = err_NoError; ParsedQuery **fromPq; int i; #line 1087 switch (bufferId) { case DBBufferC$kATTR_BUF: *id = NULL_QUERY_FIELD; for (i = 0; i < DBBufferC$NUM_ATTR_FIELDS; i++) { if (strcmp(f->name, DBBufferC$ATTR_NAMES[i]) == 0) { *id = i; } } #line 1094 break; default: fromPq = DBBufferC$DBBuffer$getSchema(bufferId); if (fromPq == (void *)0) { #line 1097 return err_UnsupportedBuffer; } #line 1098 err = DBBufferC$ParsedQueryIntf$getResultId(*fromPq, f, id); if (err != err_NoError) { *id = NULL_QUERY_FIELD; } return err; } return err_NoError; } # 131 "d:/tinyos-1.x/tos/lib/TinyDB/DBBuffer.nc" inline static TinyDBError TupleRouterM$DBBuffer$getFieldId(uint8_t arg_0xa61f950, FieldPtr arg_0xa61fa98, uint8_t *arg_0xa61fbf0){ #line 131 enum __nesc_unnamed4265 result; #line 131 #line 131 result = DBBufferC$DBBuffer$getFieldId(arg_0xa61f950, arg_0xa61fa98, arg_0xa61fbf0); #line 131 #line 131 return result; #line 131 } #line 131 static inline # 72 "d:/tinyos-1.x/tos/lib/TinyDB/Query.nc" Field Query$QueryIntf$getField(QueryPtr q, uint8_t idx) #line 72 { return q->fields[idx]; } # 81 "d:/tinyos-1.x/tos/lib/TinyDB/QueryIntf.nc" inline static Field TupleRouterM$QueryIntf$getField(QueryPtr arg_0xa5e7958, uint8_t arg_0xa5e7a98){ #line 81 struct __nesc_unnamed4268 result; #line 81 #line 81 result = Query$QueryIntf$getField(arg_0xa5e7958, arg_0xa5e7a98); #line 81 #line 81 return result; #line 81 } #line 81 # 181 "d:/tinyos-1.x/tos/lib/TinyDB/DBBuffer.nc" inline static TinyDBError TupleRouterM$DBBuffer$getBufferId(uint8_t arg_0xa641038, bool arg_0xa641180, uint8_t *arg_0xa6412e0){ #line 181 enum __nesc_unnamed4265 result; #line 181 #line 181 result = DBBufferC$DBBuffer$getBufferId(arg_0xa641038, arg_0xa641180, arg_0xa6412e0); #line 181 #line 181 return result; #line 181 } #line 181 inline static TinyDBError TupleRouterM$DBBuffer$qidFromBufferId(uint8_t arg_0xa641ee8, uint8_t *arg_0xa63e060){ #line 191 enum __nesc_unnamed4265 result; #line 191 #line 191 result = DBBufferC$DBBuffer$qidFromBufferId(arg_0xa641ee8, arg_0xa63e060); #line 191 #line 191 return result; #line 191 } #line 191 static inline # 2962 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$continueFromBufferFetch(TinyDBError err) #line 2962 { ParsedQuery *pq = TupleRouterM$mTempPQ; uint8_t bufferId; uint8_t i; if (err != err_NoError) { TupleRouterM$parsedQuery(FALSE); return; } if ((pq->bufferType == kRAM || pq->bufferType == kEEPROM) && pq->buf.ram.hasInput) { RamBufInfo *ram = & pq->buf.ram; #line 2976 err = TupleRouterM$DBBuffer$getBufferIdFromName(ram->inBufName, &bufferId); if (err != err_NoError) { TupleRouterM$signalError(err, 2978); TupleRouterM$parsedQuery(FALSE); return; } err = TupleRouterM$DBBuffer$qidFromBufferId(bufferId, & pq->fromBuffer); if (err != err_NoError) { TupleRouterM$signalError(err, 2985); TupleRouterM$parsedQuery(FALSE); return; } } TupleRouterM$mCurField = 0; if ((uint8_t )pq->fromBuffer != kNO_QUERY) { err = TupleRouterM$DBBuffer$getBufferId(pq->fromBuffer, pq->fromCatalogBuffer, &bufferId); if (err != err_NoError) { TupleRouterM$signalError(err, 2997); TupleRouterM$parsedQuery(FALSE); return; } for (i = 0; i < pq->numFields; i++) { Field f = TupleRouterM$QueryIntf$getField(TupleRouterM$mCurQueryPtr, i); #line 3006 err = TupleRouterM$DBBuffer$getFieldId(bufferId, &f, &pq->queryToSchemaFieldMap[i]); if (err != err_NoError) { TupleRouterM$signalError(err, 3008); } } } TupleRouterM$continueParsing(SUCCESS); } static inline #line 443 void TupleRouterM$UNSET_OPENING_WRITE_BUF(void) #line 443 { #line 443 TupleRouterM$mPendingMask &= TupleRouterM$OPENING_WRITE_BUF_BIT ^ 0xFFFF; } static inline #line 2846 bool TupleRouterM$parseQuery(Query *q, ParsedQuery *pq) #line 2846 { TinyDBError err; bool pending = FALSE; { } #line 2851 ; pq->qid = q->qid; pq->numFields = q->numFields; pq->numExprs = q->numExprs; pq->epochDuration = q->epochDuration; pq->savedEpochDur = q->epochDuration; pq->numEpochs = q->numEpochs; pq->fromBuffer = q->fromBuffer; pq->bufferType = q->bufferType; pq->bufferId = q->bufferId; pq->markedForDeletion = 0; pq->currentEpoch = 0; pq->buf = q->buf; pq->queryRoot = q->queryRoot; pq->hasEvent = q->hasEvent; pq->tableInfo = (void *)0; pq->fromCatalogBuffer = q->fromCatalogBuffer; TupleRouterM$mCurQueryPtr = q; TupleRouterM$mTempPQ = pq; if (q->hasEvent) { #line 2908 pq->running = FALSE; } else #line 2909 { if ((pq->bufferType == kRAM || pq->bufferType == kEEPROM) && pq->buf.ram.create == 1) { pq->running = FALSE; } else { #line 2915 pq->running = TRUE; } } if (pq->bufferType == kRAM || pq->bufferType == kEEPROM) { RamBufInfo *ram = & pq->buf.ram; if (ram->hasInput) { uint8_t bufId; err = TupleRouterM$DBBuffer$getBufferIdFromName(ram->inBufName, &bufId); if (err != err_NoError) { TupleRouterM$UNSET_OPENING_WRITE_BUF(); if (pq->bufferType == kEEPROM) { err = err_NoMatchbox; } if (err != err_NoError) { TupleRouterM$signalError(err, 2939); return FALSE; } else { #line 2942 pending = TRUE; } } if (!pending) { err = TupleRouterM$DBBuffer$qidFromBufferId(bufId, & pq->fromBuffer); if (err != err_NoError) { TupleRouterM$signalError(err, 2949); return FALSE; } } } } if (!pending) { #line 2956 TupleRouterM$continueFromBufferFetch(err_NoError); } return TRUE; } # 108 "d:/tinyos-1.x/tos/interfaces/MemAlloc.nc" inline static result_t TupleRouterM$MemAlloc$lock(Handle arg_0xa608a00){ #line 108 unsigned char result; #line 108 #line 108 result = TinyAlloc$MemAlloc$lock(arg_0xa608a00); #line 108 #line 108 return result; #line 108 } #line 108 # 94 "d:/tinyos-1.x/tos/lib/TinyDB/QueryIntf.nc" inline static Expr TupleRouterM$QueryIntf$getExpr(QueryPtr arg_0xa5faba0, uint8_t arg_0xa5face0){ #line 94 struct __nesc_unnamed4288 result; #line 94 #line 94 result = Query$QueryIntf$getExpr(arg_0xa5faba0, arg_0xa5face0); #line 94 #line 94 return result; #line 94 } #line 94 static inline # 995 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$parsedCallback(Handle *memory) #line 995 { TupleRouterM$QueryListHandle h = (TupleRouterM$QueryListHandle )*memory; Expr e; { } #line 999 ; e = TupleRouterM$QueryIntf$getExpr(*TupleRouterM$mCurQuery, 0); TupleRouterM$MemAlloc$lock((Handle )h); { } #line 1003 ; TupleRouterM$mTmpHandle = (Handle )h; if (!TupleRouterM$parseQuery(*TupleRouterM$mCurQuery, & (*h)->q)) { (*h)->q.qid = (*TupleRouterM$mCurQuery)->qid; TupleRouterM$mQidToRemove = (*h)->q.qid; TupleRouterM$mForceRemove = TRUE; TOS_post(TupleRouterM$removeQueryTask); TupleRouterM$MemAlloc$unlock((Handle )h); TupleRouterM$MemAlloc$unlock((Handle )TupleRouterM$mCurQuery); TupleRouterM$MemAlloc$free((Handle )TupleRouterM$mCurQuery); TupleRouterM$UNSET_READING_QUERY(); TupleRouterM$UNSET_PARSING_QUERY(); return; } } static inline # 757 "d:/tinyos-1.x/tos/platform/mica2/CC1000RadioIntM.nc" result_t CC1000RadioIntM$RSSIADC$dataReady(uint16_t data) #line 757 { CC1000RadioIntM$usRSSIVal = data; CC1000RadioIntM$bRSSIValid = TRUE; return SUCCESS; } static inline # 290 "d:/tinyos-1.x/tos/lib/TinyDB/Tuple.nc" result_t Tuple$AttrUse$getAttrDone(char *name, char *resultBuf, SchemaErrorNo errorNo) #line 290 { return SUCCESS; } static inline # 2385 "d:/tinyos-1.x/tos/lib/TinyDB/DBBufferC.nc" result_t DBBufferC$AttrUse$getAttrDone(char *name, char *resultBuf, SchemaErrorNo errorNo) #line 2385 { return SUCCESS; } static inline # 379 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQuery.nc" result_t ParsedQuery$AttrUse$getAttrDone(char *name, char *resultBuf, SchemaErrorNo errorNo) #line 379 { return SUCCESS; } static inline # 2650 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" result_t TupleRouterM$AttrUse$getAttrDone(char *name, char *resultBuf, SchemaErrorNo errorNo) { if (resultBuf == (char *)&TupleRouterM$mVoltage) { TupleRouterM$continueSetSampleRate(); } else { #line 2655 TupleRouterM$fillInAttrVal(errorNo); } #line 2656 return SUCCESS; } # 104 "d:/tinyos-1.x/tos/interfaces/AttrUse.nc" inline static result_t Attr$AttrUse$getAttrDone(char *arg_0xa5e2828, char *arg_0xa5e2980, SchemaErrorNo arg_0xa5e2ac8){ #line 104 unsigned char result; #line 104 #line 104 result = TupleRouterM$AttrUse$getAttrDone(arg_0xa5e2828, arg_0xa5e2980, arg_0xa5e2ac8); #line 104 result = rcombine(result, ParsedQuery$AttrUse$getAttrDone(arg_0xa5e2828, arg_0xa5e2980, arg_0xa5e2ac8)); #line 104 result = rcombine(result, DBBufferC$AttrUse$getAttrDone(arg_0xa5e2828, arg_0xa5e2980, arg_0xa5e2ac8)); #line 104 result = rcombine(result, Tuple$AttrUse$getAttrDone(arg_0xa5e2828, arg_0xa5e2980, arg_0xa5e2ac8)); #line 104 #line 104 return result; #line 104 } #line 104 static inline # 259 "d:/tinyos-1.x/tos/lib/Attr.nc" result_t Attr$Attr$getAttrDone(uint8_t id, char *name, char *resultBuf, SchemaErrorNo errorNo) { Attr$AttrUse$getAttrDone(name, resultBuf, errorNo); return SUCCESS; } # 91 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t AttrVoltageM$AttrRegister$getAttrDone(char *arg_0xa7e5138, char *arg_0xa7e5290, SchemaErrorNo arg_0xa7e53d8){ #line 91 unsigned char result; #line 91 #line 91 result = Attr$Attr$getAttrDone(12, arg_0xa7e5138, arg_0xa7e5290, arg_0xa7e53d8); #line 91 #line 91 return result; #line 91 } #line 91 static inline # 98 "d:/tinyos-1.x/tos/lib/Attributes/AttrVoltageM.nc" result_t AttrVoltageM$ADC$dataReady(uint16_t data) { * (uint16_t *)AttrVoltageM$result = data; AttrVoltageM$AttrRegister$getAttrDone(AttrVoltageM$attrName, AttrVoltageM$result, SCHEMA_RESULT_READY); return SUCCESS; } # 100 "d:/tinyos-1.x/tos/interfaces/ADC.nc" inline static result_t PhotoTempM$ExternalTempADC$dataReady(uint16_t arg_0xa445aa0){ #line 100 unsigned char result; #line 100 #line 100 result = AttrTempM$ADC$dataReady(arg_0xa445aa0); #line 100 #line 100 return result; #line 100 } #line 100 static inline # 258 "d:/tinyos-1.x/tos/sensorboards/micasb/PhotoTempM.nc" result_t PhotoTempM$InternalTempADC$dataReady(uint16_t data) #line 258 { uint8_t oldState; #line 260 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 260 { oldState = PhotoTempM$state; if (PhotoTempM$state == PhotoTempM$BUSY) { PhotoTempM$state = PhotoTempM$IDLE; } } #line 265 __nesc_atomic_end(__nesc_atomic); } if (oldState == PhotoTempM$BUSY) { return PhotoTempM$ExternalTempADC$dataReady(data); } else { #line 270 if (oldState == PhotoTempM$CONTINUOUS) { int ret; #line 272 ret = PhotoTempM$ExternalTempADC$dataReady(data); if (ret == FAIL) { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 276 { PhotoTempM$state = PhotoTempM$IDLE; } #line 278 __nesc_atomic_end(__nesc_atomic); } } return ret; } } #line 282 return FAIL; } # 100 "d:/tinyos-1.x/tos/interfaces/ADC.nc" inline static result_t PhotoTempM$ExternalPhotoADC$dataReady(uint16_t arg_0xa445aa0){ #line 100 unsigned char result; #line 100 #line 100 result = AttrPhotoM$ADC$dataReady(arg_0xa445aa0); #line 100 #line 100 return result; #line 100 } #line 100 static inline # 227 "d:/tinyos-1.x/tos/sensorboards/micasb/PhotoTempM.nc" result_t PhotoTempM$InternalPhotoADC$dataReady(uint16_t data) #line 227 { uint8_t oldState; #line 229 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 229 { oldState = PhotoTempM$state; if (PhotoTempM$state == PhotoTempM$BUSY) { PhotoTempM$state = PhotoTempM$IDLE; } } #line 234 __nesc_atomic_end(__nesc_atomic); } if (oldState == PhotoTempM$BUSY) { return PhotoTempM$ExternalPhotoADC$dataReady(data); } else { #line 239 if (oldState == PhotoTempM$CONTINUOUS) { int ret; #line 241 ret = PhotoTempM$ExternalPhotoADC$dataReady(data); if (ret == FAIL) { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 245 { PhotoTempM$state = PhotoTempM$IDLE; } #line 247 __nesc_atomic_end(__nesc_atomic); } } return ret; } } #line 251 return FAIL; } # 91 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t AttrAccelM$AttrAccelY$getAttrDone(char *arg_0xa7e5138, char *arg_0xa7e5290, SchemaErrorNo arg_0xa7e53d8){ #line 91 unsigned char result; #line 91 #line 91 result = Attr$Attr$getAttrDone(16, arg_0xa7e5138, arg_0xa7e5290, arg_0xa7e53d8); #line 91 #line 91 return result; #line 91 } #line 91 static inline # 134 "d:/tinyos-1.x/tos/lib/Attributes/AttrAccelM.nc" result_t AttrAccelM$AccelY$dataReady(uint16_t data) { * (uint16_t *)AttrAccelM$resultY = data; AttrAccelM$AttrAccelY$getAttrDone(AttrAccelM$attrNameY, AttrAccelM$resultY, SCHEMA_RESULT_READY); return SUCCESS; } # 91 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t AttrAccelM$AttrAccelX$getAttrDone(char *arg_0xa7e5138, char *arg_0xa7e5290, SchemaErrorNo arg_0xa7e53d8){ #line 91 unsigned char result; #line 91 #line 91 result = Attr$Attr$getAttrDone(15, arg_0xa7e5138, arg_0xa7e5290, arg_0xa7e53d8); #line 91 #line 91 return result; #line 91 } #line 91 static inline # 105 "d:/tinyos-1.x/tos/lib/Attributes/AttrAccelM.nc" result_t AttrAccelM$AccelX$dataReady(uint16_t data) { * (uint16_t *)AttrAccelM$resultX = data; AttrAccelM$AttrAccelX$getAttrDone(AttrAccelM$attrNameX, AttrAccelM$resultX, SCHEMA_RESULT_READY); return SUCCESS; } static inline # 157 "d:/tinyos-1.x/tos/lib/Attributes/AttrMicM.nc" result_t AttrMicM$MicADC$dataReady(uint16_t data) { if (AttrMicM$maxNoise < data) { AttrMicM$maxNoise = data; } #line 161 return SUCCESS; } static inline # 120 "d:/tinyos-1.x/tos/platform/mica2/ADCM.nc" result_t ADCM$ADC$default$dataReady(uint8_t port, uint16_t data) #line 120 { return FAIL; } # 100 "d:/tinyos-1.x/tos/interfaces/ADC.nc" inline static result_t ADCM$ADC$dataReady(uint8_t arg_0xa4c97b8, uint16_t arg_0xa445aa0){ #line 100 unsigned char result; #line 100 #line 100 switch (arg_0xa4c97b8) { #line 100 case TOS_ADC_CC_RSSI_PORT: #line 100 result = CC1000RadioIntM$RSSIADC$dataReady(arg_0xa445aa0); #line 100 break; #line 100 case TOS_ADC_PHOTO_PORT: #line 100 result = PhotoTempM$InternalPhotoADC$dataReady(arg_0xa445aa0); #line 100 break; #line 100 case TOS_ADC_TEMP_PORT: #line 100 result = PhotoTempM$InternalTempADC$dataReady(arg_0xa445aa0); #line 100 break; #line 100 case TOS_ADC_MIC_PORT: #line 100 result = AttrMicM$MicADC$dataReady(arg_0xa445aa0); #line 100 break; #line 100 case TOS_ADC_ACCEL_X_PORT: #line 100 result = AttrAccelM$AccelX$dataReady(arg_0xa445aa0); #line 100 break; #line 100 case TOS_ADC_ACCEL_Y_PORT: #line 100 result = AttrAccelM$AccelY$dataReady(arg_0xa445aa0); #line 100 break; #line 100 case TOS_ADC_VOLTAGE_PORT: #line 100 result = AttrVoltageM$ADC$dataReady(arg_0xa445aa0); #line 100 break; #line 100 default: #line 100 result = ADCM$ADC$default$dataReady(arg_0xa4c97b8, arg_0xa445aa0); #line 100 } #line 100 #line 100 return result; #line 100 } #line 100 # 104 "d:/tinyos-1.x/tos/interfaces/HPLADC.nc" inline static result_t ADCM$HPLADC$samplePort(uint8_t arg_0xa4c7af0){ #line 104 unsigned char result; #line 104 #line 104 result = HPLADCM$ADC$samplePort(arg_0xa4c7af0); #line 104 #line 104 return result; #line 104 } #line 104 static inline # 124 "d:/tinyos-1.x/tos/platform/mica2/ADCM.nc" result_t ADCM$HPLADC$dataReady(uint16_t data) #line 124 { uint16_t doneValue = data; uint8_t donePort; uint8_t nextPort = 0xff; result_t Result; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 131 { donePort = ADCM$ReqPort; if (((1 << donePort) & ADCM$ContReqMask) == 0) { ADCM$ReqVector ^= 1 << donePort; } if (ADCM$ReqVector) { do { ADCM$ReqPort++; ADCM$ReqPort %= TOSH_ADC_PORTMAPSIZE; } while ((( #line 142 1 << ADCM$ReqPort) & ADCM$ReqVector) == 0); nextPort = ADCM$ReqPort; } } #line 145 __nesc_atomic_end(__nesc_atomic); } if (nextPort != 0xff) { ADCM$HPLADC$samplePort(nextPort); } { } #line 152 ; Result = ADCM$ADC$dataReady(donePort, doneValue); { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 155 { if (Result == FAIL && ADCM$ContReqMask & (1 << donePort)) { ADCM$ContReqMask ^= 1 << donePort; } } #line 159 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 126 "d:/tinyos-1.x/tos/interfaces/HPLADC.nc" inline static result_t HPLADCM$ADC$dataReady(uint16_t arg_0xa4d8630){ #line 126 unsigned char result; #line 126 #line 126 result = ADCM$HPLADC$dataReady(arg_0xa4d8630); #line 126 #line 126 return result; #line 126 } #line 126 static inline # 1835 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$computeRates(uint32_t lifetimeHoursRem, uint32_t curVReading, uint32_t ujSampleCost, uint32_t ujAggCost, uint32_t numMsgs, uint32_t numSamples, uint32_t *epochDur, uint16_t *aggWinSize, uint16_t *mvPerDay) { uint32_t ujXmitCost = TupleRouterM$uaXmit * TupleRouterM$msXmit * TupleRouterM$Vdraw / 1000; uint32_t mahRemaining = (curVReading - TupleRouterM$minVReading) * TupleRouterM$mahCapacity / (TupleRouterM$maxVReading - TupleRouterM$minVReading); uint32_t uaAvg = mahRemaining * 1000 / lifetimeHoursRem; uint32_t uaAvgActive = (ujSampleCost * numSamples + ujXmitCost * numMsgs + ujAggCost * numSamples) / (TupleRouterM$Vdraw * TupleRouterM$sPerSample) + TupleRouterM$uaActive; uint32_t dutyCycle = (uaAvg - TupleRouterM$uaSleep) * 100000 / (uaAvgActive - TupleRouterM$uaSleep); if (uaAvg < TupleRouterM$uaSleep) { *epochDur = -1; } else #line 1854 { *epochDur = TupleRouterM$sPerSample * 100000 * 1000 / dutyCycle; if (*epochDur < TupleRouterM$sPerSample * 1000) { *epochDur = TupleRouterM$sPerSample * 1000; } } #line 1859 { } #line 1859 ; *aggWinSize = 1; *mvPerDay = (curVReading - TupleRouterM$minVReading) * 24 * 1000 / lifetimeHoursRem; } static inline #line 434 void TupleRouterM$UNSET_SETTING_SAMPLE_RATE(void) #line 434 { #line 434 TupleRouterM$mPendingMask &= TupleRouterM$SETTING_SAMPLE_RATE_BIT ^ 0xFFFF; } # 91 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t AttrPhotoM$AttrRegister$getAttrDone(char *arg_0xa7e5138, char *arg_0xa7e5290, SchemaErrorNo arg_0xa7e53d8){ #line 91 unsigned char result; #line 91 #line 91 result = Attr$Attr$getAttrDone(14, arg_0xa7e5138, arg_0xa7e5290, arg_0xa7e53d8); #line 91 #line 91 return result; #line 91 } #line 91 # 91 "d:/tinyos-1.x/tos/interfaces/AttrRegister.nc" inline static result_t AttrTempM$AttrRegister$getAttrDone(char *arg_0xa7e5138, char *arg_0xa7e5290, SchemaErrorNo arg_0xa7e53d8){ #line 91 unsigned char result; #line 91 #line 91 result = Attr$Attr$getAttrDone(13, arg_0xa7e5138, arg_0xa7e5290, arg_0xa7e53d8); #line 91 #line 91 return result; #line 91 } #line 91 # 72 "d:/tinyos-1.x/tos/platform/mica2/SpiByteFifo.nc" inline static result_t HPLSpiM$SpiByteFifo$dataReady(uint8_t arg_0xa43e690){ #line 72 unsigned char result; #line 72 #line 72 result = CC1000RadioIntM$SpiByteFifo$dataReady(arg_0xa43e690); #line 72 #line 72 return result; #line 72 } #line 72 # 77 "d:/tinyos-1.x/tos/platform/mica2/HPLSpiM.nc" void __attribute((signal)) __vector_17(void) #line 77 { register uint8_t temp = * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0F + 0x20); #line 79 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0F + 0x20) = HPLSpiM$OutgoingByte; HPLSpiM$SpiByteFifo$dataReady(temp); } static inline result_t HPLSpiM$SpiByteFifo$writeByte(uint8_t data) #line 83 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 86 HPLSpiM$OutgoingByte = data; #line 86 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 63 "d:/tinyos-1.x/tos/platform/mica2/SpiByteFifo.nc" inline static result_t CC1000RadioIntM$SpiByteFifo$writeByte(uint8_t arg_0xa42ef08){ #line 63 unsigned char result; #line 63 #line 63 result = HPLSpiM$SpiByteFifo$writeByte(arg_0xa42ef08); #line 63 #line 63 return result; #line 63 } #line 63 static inline # 3538 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$RadioSendCoordinator$startSymbol(void) #line 3538 { if (TupleRouterM$mMustTimestamp) { tos_time_t cur_time = TupleRouterM$Time$get(); QueryMessagePtr qm = TupleRouterM$Network$getQueryPayLoad(TupleRouterM$mTimestampMsg); ParsedQueryPtr pq; #line 3542 ; if (TupleRouterM$getQuery(qm->qid, &pq)) { qm->timeSyncData[0] = (uint8_t )(cur_time.high32 & 0x000000FF); * (uint32_t *)&qm->timeSyncData[1] = cur_time.low32; qm->clockCount = pq->clockCount; } TupleRouterM$mMustTimestamp = FALSE; } } # 29 "d:/tinyos-1.x/tos/interfaces/RadioCoordinator.nc" inline static void CC1000RadioIntM$RadioSendCoordinator$startSymbol(void){ #line 29 TupleRouterM$RadioSendCoordinator$startSymbol(); #line 29 } #line 29 static inline # 36 "d:/tinyos-1.x/tos/platform/avrmote/crc.h" uint16_t crcByte(uint16_t oldCrc, uint8_t byte) { uint16_t *table = crcTable; uint16_t newCrc; __asm ("eor %1,%B3\n" "\tlsl %1\n" "\tadc %B2, __zero_reg__\n" "\tadd %A2, %1\n" "\tadc %B2, __zero_reg__\n" "\tlpm\n" "\tmov %B0, %A3\n" "\tmov %A0, r0\n" "\tadiw r30,1\n" "\tlpm\n" "\teor %B0, r0" : "=r"(newCrc), "+r"(byte), "+z"(table) : "r"(oldCrc)); return newCrc; } static inline # 3554 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$RadioSendCoordinator$byte(TOS_MsgPtr msg, uint8_t byteCount) #line 3554 { } # 32 "d:/tinyos-1.x/tos/interfaces/RadioCoordinator.nc" inline static void CC1000RadioIntM$RadioSendCoordinator$byte(TOS_MsgPtr arg_0xa42c780, uint8_t arg_0xa42c8c8){ #line 32 TupleRouterM$RadioSendCoordinator$byte(arg_0xa42c780, arg_0xa42c8c8); #line 32 } #line 32 static inline # 248 "d:/tinyos-1.x/tos/system/AMStandard.nc" result_t AMStandard$RadioSend$sendDone(TOS_MsgPtr msg, result_t success) #line 248 { return AMStandard$reportSendDone(msg, success); } # 94 "d:/tinyos-1.x/tos/interfaces/BareSendMsg.nc" inline static result_t CC1000RadioIntM$Send$sendDone(TOS_MsgPtr arg_0xa3e1248, result_t arg_0xa3e1390){ #line 94 unsigned char result; #line 94 #line 94 result = AMStandard$RadioSend$sendDone(arg_0xa3e1248, arg_0xa3e1390); #line 94 #line 94 return result; #line 94 } #line 94 static inline # 196 "d:/tinyos-1.x/tos/platform/mica2/CC1000RadioIntM.nc" void CC1000RadioIntM$PacketSent(void) #line 196 { TOS_MsgPtr pBuf; #line 198 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 198 { CC1000RadioIntM$txbufptr->time = 0; pBuf = CC1000RadioIntM$txbufptr; } #line 201 __nesc_atomic_end(__nesc_atomic); } CC1000RadioIntM$Send$sendDone((TOS_MsgPtr )pBuf, SUCCESS); { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 203 CC1000RadioIntM$bTxBusy = FALSE; #line 203 __nesc_atomic_end(__nesc_atomic); } } # 82 "d:/tinyos-1.x/tos/interfaces/ADC.nc" inline static result_t CC1000RadioIntM$RSSIADC$getData(void){ #line 82 unsigned char result; #line 82 #line 82 result = ADCM$ADC$getData(TOS_ADC_CC_RSSI_PORT); #line 82 #line 82 return result; #line 82 } #line 82 static inline # 196 "d:/tinyos-1.x/tos/platform/mica2/CC1000ControlM.nc" result_t CC1000ControlM$CC1000Control$TxMode(void) #line 196 { CC1000ControlM$HPLChipcon$write(0x00, ((( 1 << 7) | (1 << 6)) | (1 << 5)) | ( 1 << 0)); CC1000ControlM$HPLChipcon$write(0x09, ({ #line 202 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_Params[CC1000ControlM$tunefreq][29]; #line 202 unsigned char __result; #line 202 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } )); #line 203 TOSH_uwait(250); CC1000ControlM$HPLChipcon$write(0x0B, CC1000ControlM$rfpower); TOSH_uwait(20); return SUCCESS; } # 93 "d:/tinyos-1.x/tos/platform/mica2/CC1000Control.nc" inline static result_t CC1000RadioIntM$CC1000Control$TxMode(void){ #line 93 unsigned char result; #line 93 #line 93 result = CC1000ControlM$CC1000Control$TxMode(); #line 93 #line 93 return result; #line 93 } #line 93 # 137 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline void TOSH_MAKE_MOSI_OUTPUT(void) #line 137 { #line 137 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x17 + 0x20) |= 1 << 2; } #line 138 static __inline void TOSH_MAKE_MISO_OUTPUT(void) #line 138 { #line 138 * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x17 + 0x20) |= 1 << 3; } static inline # 127 "d:/tinyos-1.x/tos/platform/mica2/HPLSpiM.nc" result_t HPLSpiM$SpiByteFifo$txMode(void) #line 127 { TOSH_MAKE_MISO_OUTPUT(); TOSH_MAKE_MOSI_OUTPUT(); return SUCCESS; } # 69 "d:/tinyos-1.x/tos/platform/mica2/SpiByteFifo.nc" inline static result_t CC1000RadioIntM$SpiByteFifo$txMode(void){ #line 69 unsigned char result; #line 69 #line 69 result = HPLSpiM$SpiByteFifo$txMode(); #line 69 #line 69 return result; #line 69 } #line 69 static inline # 3530 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$RadioReceiveCoordinator$startSymbol(void) #line 3530 { } # 29 "d:/tinyos-1.x/tos/interfaces/RadioCoordinator.nc" inline static void CC1000RadioIntM$RadioReceiveCoordinator$startSymbol(void){ #line 29 TupleRouterM$RadioReceiveCoordinator$startSymbol(); #line 29 } #line 29 static inline # 3534 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$RadioReceiveCoordinator$byte(TOS_MsgPtr msg, uint8_t byteCount) #line 3534 { } # 32 "d:/tinyos-1.x/tos/interfaces/RadioCoordinator.nc" inline static void CC1000RadioIntM$RadioReceiveCoordinator$byte(TOS_MsgPtr arg_0xa42c780, uint8_t arg_0xa42c8c8){ #line 32 TupleRouterM$RadioReceiveCoordinator$byte(arg_0xa42c780, arg_0xa42c8c8); #line 32 } #line 32 static inline # 289 "d:/tinyos-1.x/tos/system/AMStandard.nc" TOS_MsgPtr AMStandard$RadioReceive$receive(TOS_MsgPtr packet) #line 289 { return received(packet); } # 106 "d:/tinyos-1.x/tos/interfaces/ReceiveMsg.nc" inline static TOS_MsgPtr CC1000RadioIntM$Receive$receive(TOS_MsgPtr arg_0xa33a580){ #line 106 struct TOS_Msg *result; #line 106 #line 106 result = AMStandard$RadioReceive$receive(arg_0xa33a580); #line 106 #line 106 return result; #line 106 } #line 106 static inline # 178 "d:/tinyos-1.x/tos/platform/mica2/CC1000RadioIntM.nc" void CC1000RadioIntM$PacketRcvd(void) #line 178 { TOS_MsgPtr pBuf; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 181 { CC1000RadioIntM$rxbufptr->time = 0; pBuf = CC1000RadioIntM$rxbufptr; CC1000RadioIntM$usSquelchVal = (5 * CC1000RadioIntM$rxbufptr->strength + 3 * CC1000RadioIntM$usSquelchVal) >> 3; } #line 186 __nesc_atomic_end(__nesc_atomic); } pBuf = CC1000RadioIntM$Receive$receive((TOS_MsgPtr )pBuf); { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 188 { if (pBuf) { CC1000RadioIntM$rxbufptr = pBuf; } #line 191 CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE; } #line 192 __nesc_atomic_end(__nesc_atomic); } CC1000RadioIntM$SpiByteFifo$enableIntr(); } static inline # 110 "d:/tinyos-1.x/tos/platform/mica/HPLClock.nc" void HPLClock$Clock$setInterval(uint8_t value) #line 110 { * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x31 + 0x20) = value; } # 131 "d:/tinyos-1.x/tos/interfaces/Clock.nc" inline static void LogicalTimeM$Clock$setInterval(uint8_t arg_0xa50ed68){ #line 131 HPLClock$Clock$setInterval(arg_0xa50ed68); #line 131 } #line 131 static inline # 120 "d:/tinyos-1.x/tos/platform/mica/HPLClock.nc" uint8_t HPLClock$Clock$getInterval(void) #line 120 { return * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x31 + 0x20); } # 147 "d:/tinyos-1.x/tos/interfaces/Clock.nc" inline static uint8_t LogicalTimeM$Clock$getInterval(void){ #line 147 unsigned char result; #line 147 #line 147 result = HPLClock$Clock$getInterval(); #line 147 #line 147 return result; #line 147 } #line 147 # 295 "d:/tinyos-1.x/tos/system/LogicalTimeM.nc" static void LogicalTimeM$adjustInterval(void) #line 295 { uint8_t i; #line 296 uint8_t val; #line 296 uint8_t mInterval; #line 297 val = mInterval = LogicalTimeM$Clock$getInterval(); { } #line 298 ; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 299 { if (LogicalTimeM$mState) { for (i = 0; i < NUM_TIMERS; i++) { if (LogicalTimeM$mState & (0x1 << i) && LogicalTimeM$mTimerList[i].ticksLeft < (int32_t )val) { val = LogicalTimeM$mTimerList[i].ticksLeft; } } if (val < mInterval) { LogicalTimeM$Clock$setInterval(val); { } #line 308 ; } } else #line 310 { LogicalTimeM$Clock$setInterval(255); { } #line 312 ; } LogicalTimeM$setIntervalFlag = 0; } #line 315 __nesc_atomic_end(__nesc_atomic); } } static inline # 177 "d:/tinyos-1.x/tos/system/AMStandard.nc" result_t AMStandard$ActivityTimer$fired(void) #line 177 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 178 { AMStandard$lastCount = AMStandard$counter; AMStandard$counter = 0; } #line 181 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } static inline # 346 "d:/tinyos-1.x/tos/platform/mica2/CC1000RadioIntM.nc" result_t CC1000RadioIntM$WakeupTimer$fired(void) #line 346 { uint16_t sleeptime; #line 348 if (CC1000RadioIntM$lplpower == 0) { return SUCCESS; } switch (CC1000RadioIntM$RadioState) { case CC1000RadioIntM$IDLE_STATE: sleeptime = (({ #line 353 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_LPL_SleepTime[CC1000RadioIntM$lplpower * 2]; #line 353 unsigned char __result; #line 353 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } ) #line 353 << 8) | ({ #line 354 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_LPL_SleepTime[CC1000RadioIntM$lplpower * 2 + 1]; #line 354 unsigned char __result; #line 354 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } ); #line 355 if (!CC1000RadioIntM$bTxPending) { CC1000RadioIntM$RadioState = CC1000RadioIntM$POWER_DOWN_STATE; CC1000RadioIntM$WakeupTimer$start(TIMER_ONE_SHOT, sleeptime); CC1000RadioIntM$CC1000StdControl$stop(); CC1000RadioIntM$SpiByteFifo$disableIntr(); } else { CC1000RadioIntM$WakeupTimer$start(TIMER_ONE_SHOT, 16 * 2); } break; case CC1000RadioIntM$POWER_DOWN_STATE: sleeptime = ({ #line 367 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_LPL_SleepPreamble[CC1000RadioIntM$lplpower]; #line 367 unsigned char __result; #line 367 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } ); #line 368 CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE; CC1000RadioIntM$CC1000StdControl$start(); CC1000RadioIntM$CC1000Control$BIASOn(); CC1000RadioIntM$SpiByteFifo$rxMode(); CC1000RadioIntM$CC1000Control$RxMode(); CC1000RadioIntM$SpiByteFifo$enableIntr(); CC1000RadioIntM$WakeupTimer$start(TIMER_ONE_SHOT, sleeptime); break; default: CC1000RadioIntM$WakeupTimer$start(TIMER_ONE_SHOT, 16 * 2); } return SUCCESS; } static inline # 86 "d:/tinyos-1.x/tos/sensorboards/micasb/SounderM.nc" result_t SounderM$StdControl$stop(void) #line 86 { TOSH_CLR_SOUNDER_CTL_PIN(); { } #line 88 ; return SUCCESS; } # 67 "d:/tinyos-1.x/tos/interfaces/StdControl.nc" inline static result_t CommandSounderM$SounderControl$stop(void){ #line 67 unsigned char result; #line 67 #line 67 result = SounderM$StdControl$stop(); #line 67 #line 67 return result; #line 67 } #line 67 static inline # 94 "d:/tinyos-1.x/tos/lib/Commands/CommandSounderM.nc" result_t CommandSounderM$Clock1$fired(void) { result_t ret = CommandSounderM$SounderControl$stop(); #line 97 CommandSounderM$commandPending = FALSE; return ret; } # 134 "d:/tinyos-1.x/tos/platform/mica2/hardware.h" static __inline int TOSH_READ_INT3_PIN(void) #line 134 { #line 134 return (* (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x01 + 0x20) & (1 << 7)) != 0; } # 96 "d:/tinyos-1.x/tos/sensorboards/micasb/sensorboard.h" static __inline char TOSH_READ_TONE_DECODE_SIGNAL_PIN(void) #line 96 { #line 96 return TOSH_READ_INT3_PIN(); } static inline # 150 "d:/tinyos-1.x/tos/sensorboards/micasb/MicM.nc" uint8_t MicM$Mic$readToneDetector(void) #line 150 { return TOSH_READ_TONE_DECODE_SIGNAL_PIN(); } # 96 "d:/tinyos-1.x/tos/interfaces/Mic.nc" inline static uint8_t AttrMicM$Mic$readToneDetector(void){ #line 96 unsigned char result; #line 96 #line 96 result = MicM$Mic$readToneDetector(); #line 96 #line 96 return result; #line 96 } #line 96 static inline # 192 "d:/tinyos-1.x/tos/lib/Attributes/AttrMicM.nc" result_t AttrMicM$ToneDetectTimer$fired(void) { uint8_t in; #line 195 in = AttrMicM$Mic$readToneDetector(); if (in == 0) { if (AttrMicM$tones < 32) { AttrMicM$tones++; } } else { if (AttrMicM$tones > 0) { AttrMicM$tones--; } } #line 206 return SUCCESS; } # 82 "d:/tinyos-1.x/tos/interfaces/ADC.nc" inline static result_t AttrMicM$MicADC$getData(void){ #line 82 unsigned char result; #line 82 #line 82 result = ADCM$ADC$getData(TOS_ADC_MIC_PORT); #line 82 #line 82 return result; #line 82 } #line 82 static inline # 145 "d:/tinyos-1.x/tos/lib/Attributes/AttrMicM.nc" result_t AttrMicM$NoiseSampleTimer$fired(void) { if (AttrMicM$MicADC$getData() != SUCCESS) { return FAIL; } #line 149 return SUCCESS; } static inline # 363 "d:/tinyos-1.x/tos/system/LogicalTimeM.nc" result_t LogicalTimeM$Timer$default$fired(uint8_t id) #line 363 { return SUCCESS; } # 104 "d:/tinyos-1.x/tos/interfaces/Timer.nc" inline static result_t LogicalTimeM$Timer$fired(uint8_t arg_0xa534bd0){ #line 104 unsigned char result; #line 104 #line 104 switch (arg_0xa534bd0) { #line 104 case 0: #line 104 result = AMStandard$ActivityTimer$fired(); #line 104 break; #line 104 case 1: #line 104 result = CC1000RadioIntM$WakeupTimer$fired(); #line 104 break; #line 104 case 2: #line 104 result = CommandSounderM$Clock1$fired(); #line 104 break; #line 104 case 3: #line 104 result = AttrMicM$NoiseSampleTimer$fired(); #line 104 break; #line 104 case 4: #line 104 result = AttrMicM$ToneDetectTimer$fired(); #line 104 break; #line 104 default: #line 104 result = LogicalTimeM$Timer$default$fired(arg_0xa534bd0); #line 104 } #line 104 #line 104 return result; #line 104 } #line 104 static inline # 267 "d:/tinyos-1.x/tos/system/LogicalTimeM.nc" result_t LogicalTimeM$AbsoluteTimer$default$fired(uint8_t id) #line 267 { return SUCCESS; } # 66 "d:/tinyos-1.x/tos/interfaces/AbsoluteTimer.nc" inline static result_t LogicalTimeM$AbsoluteTimer$fired(uint8_t arg_0xa535210){ #line 66 unsigned char result; #line 66 #line 66 switch (arg_0xa535210) { #line 66 case 0: #line 66 result = TupleRouterM$AbsoluteTimer$fired(); #line 66 break; #line 66 case 1: #line 66 result = ServiceSchedulerM$AbsoluteTimer$fired(); #line 66 break; #line 66 default: #line 66 result = LogicalTimeM$AbsoluteTimer$default$fired(arg_0xa535210); #line 66 } #line 66 #line 66 return result; #line 66 } #line 66 # 87 "d:/tinyos-1.x/tos/interfaces/TimeUtil.nc" inline static char LogicalTimeM$TimeUtil$compare(tos_time_t arg_0xa4fb3b8, tos_time_t arg_0xa4fb500){ #line 87 char result; #line 87 #line 87 result = TimeUtilC$TimeUtil$compare(arg_0xa4fb3b8, arg_0xa4fb500); #line 87 #line 87 return result; #line 87 } #line 87 static inline # 272 "d:/tinyos-1.x/tos/system/LogicalTimeM.nc" void LogicalTimeM$timeout(void) #line 272 { int i = 0; bool doSignal; tos_time_t now = LogicalTimeM$Time$get(); #line 276 for (i = 0; i < MAX_NUM_TIMERS; i++) { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 278 { doSignal = LogicalTimeM$useBit & (0x1 << i) && LogicalTimeM$TimeUtil$compare(now, LogicalTimeM$aTimer[i]) >= 0; } #line 280 __nesc_atomic_end(__nesc_atomic); } if (doSignal) { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 282 { LogicalTimeM$useBit &= ~(0x1 << i); } #line 284 __nesc_atomic_end(__nesc_atomic); } LogicalTimeM$AbsoluteTimer$fired(i); } } if (LogicalTimeM$useBit) { LogicalTimeM$selectBaseTimer(); } { } #line 292 ; } static inline #line 367 void LogicalTimeM$timerHandlingTask(void) #line 367 { int i; bool fireTimer; uint32_t mStateCopy; uint8_t mInterval = LogicalTimeM$Clock$getInterval(); #line 372 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 372 { mStateCopy = LogicalTimeM$mState; } #line 374 __nesc_atomic_end(__nesc_atomic); } if (mStateCopy) { for (i = NUM_TIMERS; i >= 0; i--) { if (mStateCopy & (0x1 << i)) { fireTimer = FALSE; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 382 { LogicalTimeM$mTimerList[i].ticksLeft -= mInterval + 1; if (LogicalTimeM$mTimerList[i].ticksLeft <= 0) { if (LogicalTimeM$mTimerList[i].type == TIMER_REPEAT) { LogicalTimeM$mTimerList[i].ticksLeft = LogicalTimeM$mTimerList[i].ticks; if (LogicalTimeM$mTimerList[i].ticksLeft < (int32_t )mInterval) { LogicalTimeM$setIntervalFlag = 1; } } else #line 389 { LogicalTimeM$mState &= ~(0x1 << i); if (!LogicalTimeM$mState) { LogicalTimeM$Clock$setInterval(255); { } #line 393 ; } else #line 394 { LogicalTimeM$setIntervalFlag = 1; } } { } #line 398 ; if (i == NUM_TIMERS) { #line 399 LogicalTimeM$timeout(); } else { #line 400 fireTimer = TRUE; } } } #line 403 __nesc_atomic_end(__nesc_atomic); } #line 403 if (fireTimer) { LogicalTimeM$Timer$fired(i); } } } } if (LogicalTimeM$setIntervalFlag) { LogicalTimeM$adjustInterval(); } return; } static inline # 89 "d:/tinyos-1.x/tos/system/TimeUtilC.nc" tos_time_t TimeUtilC$TimeUtil$addint32(tos_time_t a, int32_t ms) #line 89 { if (ms > 0) { return TimeUtilC$TimeUtil$addUint32(a, ms); } else { return TimeUtilC$TimeUtil$addUint32(a, (uint32_t )-ms); } } # 59 "d:/tinyos-1.x/tos/interfaces/TimeUtil.nc" inline static tos_time_t LogicalTimeM$TimeUtil$addint32(tos_time_t arg_0xa4fa010, int32_t arg_0xa4fa150){ #line 59 struct __nesc_unnamed4317 result; #line 59 #line 59 result = TimeUtilC$TimeUtil$addint32(arg_0xa4fa010, arg_0xa4fa150); #line 59 #line 59 return result; #line 59 } #line 59 static inline # 416 "d:/tinyos-1.x/tos/system/LogicalTimeM.nc" result_t LogicalTimeM$Clock$fire(void) #line 416 { int32_t delta; uint8_t mInterval = LogicalTimeM$Clock$getInterval(); { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 421 { delta = mInterval + 1 + LogicalTimeM$adjustment; LogicalTimeM$time = LogicalTimeM$TimeUtil$addint32(LogicalTimeM$time, delta); if (LogicalTimeM$adjustment != 0) { LogicalTimeM$mTimerList[NUM_TIMERS].ticksLeft += LogicalTimeM$adjustment; LogicalTimeM$adjustment = 0; } } #line 429 __nesc_atomic_end(__nesc_atomic); } TOS_post(LogicalTimeM$timerHandlingTask); return SUCCESS; } # 206 "d:/tinyos-1.x/tos/interfaces/Clock.nc" inline static result_t HPLClock$Clock$fire(void){ #line 206 unsigned char result; #line 206 #line 206 result = LogicalTimeM$Clock$fire(); #line 206 #line 206 return result; #line 206 } #line 206 # 93 "d:/tinyos-1.x/tos/interfaces/ByteComm.nc" inline static result_t UARTM$ByteComm$rxByteReady(uint8_t arg_0xa58df30, bool arg_0xa5a6080, uint16_t arg_0xa5a61d0){ #line 93 unsigned char result; #line 93 #line 93 result = NoCRCPacket$ByteComm$rxByteReady(arg_0xa58df30, arg_0xa5a6080, arg_0xa5a61d0); #line 93 #line 93 return result; #line 93 } #line 93 static inline # 100 "d:/tinyos-1.x/tos/system/UARTM.nc" result_t UARTM$HPLUART$get(uint8_t data) #line 100 { UARTM$ByteComm$rxByteReady(data, FALSE, 0); { } #line 106 ; return SUCCESS; } # 115 "d:/tinyos-1.x/tos/interfaces/HPLUART.nc" inline static result_t HPLUART0M$UART$get(uint8_t arg_0xa5c8400){ #line 115 unsigned char result; #line 115 #line 115 result = UARTM$HPLUART$get(arg_0xa5c8400); #line 115 #line 115 return result; #line 115 } #line 115 # 111 "d:/tinyos-1.x/tos/platform/mica2/HPLUART0M.nc" void __attribute((signal)) __vector_18(void) #line 111 { if (* (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0B + 0x20) & (1 << 7)) { HPLUART0M$UART$get(* (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0C + 0x20)); } } static inline # 286 "d:/tinyos-1.x/tos/system/AMStandard.nc" TOS_MsgPtr AMStandard$UARTReceive$receive(TOS_MsgPtr packet) #line 286 { return received(packet); } # 106 "d:/tinyos-1.x/tos/interfaces/ReceiveMsg.nc" inline static TOS_MsgPtr NoCRCPacket$Receive$receive(TOS_MsgPtr arg_0xa33a580){ #line 106 struct TOS_Msg *result; #line 106 #line 106 result = AMStandard$UARTReceive$receive(arg_0xa33a580); #line 106 #line 106 return result; #line 106 } #line 106 static inline # 342 "d:/tinyos-1.x/tos/system/NoCRCPacket.nc" void NoCRCPacket$receiveTask(void) #line 342 { TOS_MsgPtr tmp; #line 344 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 344 { tmp = NoCRCPacket$bufferPtrs[NoCRCPacket$bufferIndex ^ 1]; } #line 346 __nesc_atomic_end(__nesc_atomic); } tmp = NoCRCPacket$Receive$receive(tmp); if (tmp) { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 349 { NoCRCPacket$bufferPtrs[NoCRCPacket$bufferIndex ^ 1] = tmp; } #line 351 __nesc_atomic_end(__nesc_atomic); } } } # 123 "d:/tinyos-1.x/tos/interfaces/HPLUART.nc" inline static result_t HPLUART0M$UART$putDone(void){ #line 123 unsigned char result; #line 123 #line 123 result = UARTM$HPLUART$putDone(); #line 123 #line 123 return result; #line 123 } #line 123 # 118 "d:/tinyos-1.x/tos/platform/mica2/HPLUART0M.nc" void __attribute((interrupt)) __vector_20(void) #line 118 { HPLUART0M$UART$putDone(); } static inline # 331 "d:/tinyos-1.x/tos/system/NoCRCPacket.nc" result_t NoCRCPacket$ByteComm$txDone(void) #line 331 { bool complete; #line 333 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 333 { complete = NoCRCPacket$txCount == NoCRCPacket$txLength; } #line 335 __nesc_atomic_end(__nesc_atomic); } if (complete) { NoCRCPacket$sendComplete(TRUE); } #line 338 return SUCCESS; } # 110 "d:/tinyos-1.x/tos/interfaces/ByteComm.nc" inline static result_t UARTM$ByteComm$txDone(void){ #line 110 unsigned char result; #line 110 #line 110 result = NoCRCPacket$ByteComm$txDone(); #line 110 #line 110 return result; #line 110 } #line 110 static inline # 245 "d:/tinyos-1.x/tos/system/AMStandard.nc" result_t AMStandard$UARTSend$sendDone(TOS_MsgPtr msg, result_t success) #line 245 { return AMStandard$reportSendDone(msg, success); } # 94 "d:/tinyos-1.x/tos/interfaces/BareSendMsg.nc" inline static result_t NoCRCPacket$Send$sendDone(TOS_MsgPtr arg_0xa3e1248, result_t arg_0xa3e1390){ #line 94 unsigned char result; #line 94 #line 94 result = AMStandard$UARTSend$sendDone(arg_0xa3e1248, arg_0xa3e1390); #line 94 #line 94 return result; #line 94 } #line 94 static inline # 222 "d:/tinyos-1.x/tos/system/NoCRCPacket.nc" void NoCRCPacket$sendDoneSuccessTask(void) #line 222 { TOS_MsgPtr msg; #line 224 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 224 { NoCRCPacket$txCount = 0; NoCRCPacket$state = NoCRCPacket$IDLE; msg = (TOS_MsgPtr )NoCRCPacket$sendPtr; } #line 228 __nesc_atomic_end(__nesc_atomic); } NoCRCPacket$Send$sendDone(msg, SUCCESS); } static inline #line 212 void NoCRCPacket$sendDoneFailTask(void) #line 212 { TOS_MsgPtr msg; #line 214 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 214 { NoCRCPacket$txCount = 0; NoCRCPacket$state = NoCRCPacket$IDLE; msg = (TOS_MsgPtr )NoCRCPacket$sendPtr; } #line 218 __nesc_atomic_end(__nesc_atomic); } NoCRCPacket$Send$sendDone(msg, FAIL); } static inline #line 293 result_t NoCRCPacket$SendVarLenPacket$default$sendDone(uint8_t *packet, result_t success) #line 293 { return success; } # 89 "d:/tinyos-1.x/tos/interfaces/SendVarLenPacket.nc" inline static result_t NoCRCPacket$SendVarLenPacket$sendDone(uint8_t *arg_0xa3e21b8, result_t arg_0xa3e2300){ #line 89 unsigned char result; #line 89 #line 89 result = NoCRCPacket$SendVarLenPacket$default$sendDone(arg_0xa3e21b8, arg_0xa3e2300); #line 89 #line 89 return result; #line 89 } #line 89 static inline # 242 "d:/tinyos-1.x/tos/system/NoCRCPacket.nc" void NoCRCPacket$sendVarLenSuccessTask(void) #line 242 { uint8_t *buf; #line 244 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 244 { NoCRCPacket$txCount = 0; NoCRCPacket$state = NoCRCPacket$IDLE; buf = NoCRCPacket$sendPtr; } #line 248 __nesc_atomic_end(__nesc_atomic); } NoCRCPacket$SendVarLenPacket$sendDone(buf, SUCCESS); } static inline #line 232 void NoCRCPacket$sendVarLenFailTask(void) #line 232 { uint8_t *buf; #line 234 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 234 { NoCRCPacket$txCount = 0; NoCRCPacket$state = NoCRCPacket$IDLE; buf = NoCRCPacket$sendPtr; } #line 238 __nesc_atomic_end(__nesc_atomic); } NoCRCPacket$SendVarLenPacket$sendDone(buf, FAIL); } static inline #line 304 result_t NoCRCPacket$ByteComm$txByteReady(bool success) #line 304 { uint8_t txC; uint8_t txL; #line 307 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 307 { txC = NoCRCPacket$txCount; txL = NoCRCPacket$txLength; } #line 310 __nesc_atomic_end(__nesc_atomic); } if (txC > 0) { if (!success) { { } #line 313 ; NoCRCPacket$sendComplete(FAIL); } else { #line 316 if (txC < txL) { uint8_t byteToSend; #line 318 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 318 { byteToSend = NoCRCPacket$sendPtr[txC]; NoCRCPacket$txCount++; } #line 321 __nesc_atomic_end(__nesc_atomic); } { } #line 322 ; if (!NoCRCPacket$ByteComm$txByte(byteToSend)) { NoCRCPacket$sendComplete(FAIL); } } } } #line 328 return SUCCESS; } # 102 "d:/tinyos-1.x/tos/interfaces/ByteComm.nc" inline static result_t UARTM$ByteComm$txByteReady(bool arg_0xa5a66f0){ #line 102 unsigned char result; #line 102 #line 102 result = NoCRCPacket$ByteComm$txByteReady(arg_0xa5a66f0); #line 102 #line 102 return result; #line 102 } #line 102 static inline # 155 "d:/tinyos-1.x/tos/sensorboards/micasb/MicM.nc" result_t MicM$MicInterrupt$default$toneDetected(void) #line 155 { return SUCCESS; } # 91 "d:/tinyos-1.x/tos/interfaces/MicInterrupt.nc" inline static result_t MicM$MicInterrupt$toneDetected(void){ #line 91 unsigned char result; #line 91 #line 91 result = MicM$MicInterrupt$default$toneDetected(); #line 91 #line 91 return result; #line 91 } #line 91 # 130 "d:/tinyos-1.x/tos/system/sched.c" bool TOS_post(void (*tp)(void)) #line 130 { uint8_t tmp; bool fprev; fprev = TOSH_interrupt_disable(); tmp = TOSH_sched_free; TOSH_sched_free++; TOSH_sched_free &= TOSH_TASK_BITMASK; if (TOSH_sched_free != TOSH_sched_full) { if (fprev) { TOSH_interrupt_enable(); } #line 144 TOSH_queue[tmp].tp = tp; return TRUE; } else { TOSH_sched_free = tmp; if (fprev) { TOSH_interrupt_enable(); } #line 151 return FALSE; } } # 78 "d:/tinyos-1.x/tos/system/RealMain.nc" int main(void) #line 78 { RealMain$hardwareInit(); RealMain$Pot$init(10); TOSH_sched_init(); RealMain$StdControl$init(); RealMain$StdControl$start(); RealMain$Interrupt$enable(); while (1) { TOSH_run_task(); } } static # 116 "d:/tinyos-1.x/tos/system/PotM.nc" void PotM$setPot(uint8_t value) #line 116 { uint8_t i; #line 118 for (i = 0; i < 151; i++) PotM$HPLPot$decrease(); for (i = 0; i < value; i++) PotM$HPLPot$increase(); PotM$HPLPot$finalise(); PotM$potSetting = value; } static # 86 "d:/tinyos-1.x/tos/lib/Attr.nc" result_t Attr$Attr$registerAttr(uint8_t id, char *attrName, TOSType type, uint8_t attrLen) { short attrIdx; AttrDescPtr attrDesc; bool attrExists = FALSE; short len; #line 92 if (Attr$addAttrPending || strlen(attrName) > MAX_ATTR_NAME_LEN) { return FAIL; } else { #line 95 Attr$addAttrPending = TRUE; } for (attrIdx = 0; attrIdx < Attr$attrDescs.numAttrs; attrIdx++) if (strcasecmp(Attr$attrDescs.attrDesc[(int )attrIdx].name, attrName) == 0) { attrExists = TRUE; break; } if (!attrExists) { if (Attr$attrDescs.numAttrs < MAX_ATTRS) { Attr$attrDescs.numAttrs++; } else { Attr$addAttrPending = FALSE; return FAIL; } } attrDesc = &Attr$attrDescs.attrDesc[(int )attrIdx]; attrDesc->type = type; attrDesc->idx = attrIdx; len = sizeOf(type); if (len < 0) { attrDesc->nbytes = attrLen; } else { #line 122 attrDesc->nbytes = (uint8_t )len; } #line 123 attrDesc->id = id; attrDesc->constIdx = -1; strcpy(attrDesc->name, attrName); Attr$addAttrPending = FALSE; return SUCCESS; } static # 69 "d:/tinyos-1.x/tos/interfaces/SchemaType.h" short sizeOf(TOSType type) { switch (type) { case VOID: return 0; case INT8: case UINT8: return 1; case INT16: case UINT16: return 2; case INT32: case UINT32: return 4; case TIMESTAMP: return 4; case STRING: return 8; default: break; } return -1; } static # 138 "d:/tinyos-1.x/tos/platform/mica2/HPLADCM.nc" result_t HPLADCM$ADC$bindPort(uint8_t port, uint8_t adcPort) #line 138 { if ( #line 139 port < TOSH_ADC_PORTMAPSIZE && port != TOS_ADC_BANDGAP_PORT && port != TOS_ADC_GND_PORT) { HPLADCM$init_portmap(); { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 143 HPLADCM$TOSH_adc_portmap[port] = adcPort; #line 143 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } else { return FAIL; } } static #line 89 void HPLADCM$init_portmap(void) #line 89 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 91 { if (HPLADCM$init_portmap_done == FALSE) { int i; #line 94 for (i = 0; i < TOSH_ADC_PORTMAPSIZE; i++) HPLADCM$TOSH_adc_portmap[i] = i; HPLADCM$TOSH_adc_portmap[TOS_ADC_BANDGAP_PORT] = TOSH_ACTUAL_BANDGAP_PORT; HPLADCM$TOSH_adc_portmap[TOS_ADC_GND_PORT] = TOSH_ACTUAL_GND_PORT; HPLADCM$init_portmap_done = TRUE; } } #line 102 __nesc_atomic_end(__nesc_atomic); } } static # 101 "d:/tinyos-1.x/tos/sensorboards/micasb/PhotoTempM.nc" result_t PhotoTempM$PhotoStdControl$init(void) #line 101 { PhotoTempM$ADCControl$bindPort(TOS_ADC_PHOTO_PORT, TOSH_ACTUAL_PHOTO_PORT); { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 103 { PhotoTempM$state = PhotoTempM$IDLE; } #line 105 __nesc_atomic_end(__nesc_atomic); } { } #line 106 ; return PhotoTempM$ADCControl$init(); } static #line 126 result_t PhotoTempM$TempStdControl$init(void) #line 126 { PhotoTempM$ADCControl$bindPort(TOS_ADC_TEMP_PORT, TOSH_ACTUAL_TEMP_PORT); { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 128 { PhotoTempM$state = PhotoTempM$IDLE; } #line 130 __nesc_atomic_end(__nesc_atomic); } { } #line 131 ; return PhotoTempM$ADCControl$init(); } static # 202 "d:/tinyos-1.x/tos/lib/Command.nc" result_t Command$Cmd$registerCommand(uint8_t id, char *commandName, TOSType retType, uint8_t retLen, ParamList *params) { short cmdIdx; bool cmdExists = FALSE; CommandDesc *cmd; short len; #line 211 if (params->numParams > MAX_PARAMS) { return FAIL; } #line 213 if (Command$addCmdPending || strlen(commandName) > MAX_CMD_NAME_LEN) { return FAIL; } else { #line 216 Command$addCmdPending = TRUE; } for (cmdIdx = 0; cmdIdx < Command$commandDescs.numCmds; cmdIdx++) if (strcasecmp(Command$commandDescs.commandDesc[cmdIdx].name, commandName) == 0) { cmdExists = TRUE; break; } if (!cmdExists) { if (Command$commandDescs.numCmds < MAX_COMMANDS) { Command$commandDescs.numCmds++; } else { Command$addCmdPending = FALSE; return FAIL; } } cmd = &Command$commandDescs.commandDesc[cmdIdx]; cmd->idx = cmdIdx; cmd->id = id; strcpy(cmd->name, commandName); cmd->retType = retType; len = sizeOf(retType); if (len < 0) { cmd->retLen = retLen; } else { #line 243 cmd->retLen = (uint8_t )len; } #line 244 cmd->params = *params; Command$addCmdPending = FALSE; return SUCCESS; } static # 91 "d:/tinyos-1.x/tos/system/LogicalTimeM.nc" result_t LogicalTimeM$StdControl$init(void) #line 91 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 93 { LogicalTimeM$time.high32 = 0; LogicalTimeM$time.low32 = 0; LogicalTimeM$setIntervalFlag = 0; LogicalTimeM$useBit = 0; #line 98 LogicalTimeM$mState = 0; LogicalTimeM$baseTimerIndex = -1; LogicalTimeM$ClockControl$init(); LogicalTimeM$adjustment = 0; } #line 102 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } static # 68 "d:/tinyos-1.x/tos/interfaces/Params.h" void setParamList(ParamList *params, uint8_t nargs, ...) { short i; va_list ap; #line 73 params->numParams = nargs; __builtin_va_start(ap, nargs); for (i = 0; i < nargs; i++) params->params[i] = (__builtin_va_arg(ap, TOSType )); __builtin_va_end(ap); } static # 54 "d:/tinyos-1.x/tos/system/TimeUtilC.nc" char TimeUtilC$TimeUtil$compare(tos_time_t a, tos_time_t b) #line 54 { if (a.high32 > b.high32) { #line 55 return 1; } #line 56 if (a.high32 < b.high32) { #line 56 return -1; } #line 57 if (a.low32 > b.low32) { #line 57 return 1; } #line 58 if (a.low32 < b.low32) { #line 58 return -1; } #line 59 return 0; } static # 81 "d:/tinyos-1.x/tos/platform/mica2/HPLUART0M.nc" result_t HPLUART0M$UART$init(void) #line 81 { * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)0x90 = 0; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x09 + 0x20) = 15; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0B + 0x20) = 1 << 1; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)0x95 = (1 << 2) | (1 << 1); * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0A + 0x20) = (((1 << 7) | (1 << 6)) | (1 << 4)) | (1 << 3); HPLUART0M$Interrupt$enable(); return SUCCESS; } static # 103 "d:/tinyos-1.x/tos/platform/mica2/HPLCC1000M.nc" result_t HPLCC1000M$HPLCC1000$write(uint8_t addr, uint8_t data) #line 103 { char cnt = 0; addr <<= 1; TOSH_CLR_CC_PALE_PIN(); for (cnt = 0; cnt < 7; cnt++) { if (addr & 0x80) { TOSH_SET_CC_PDATA_PIN(); } else { #line 114 TOSH_CLR_CC_PDATA_PIN(); } #line 115 TOSH_CLR_CC_PCLK_PIN(); TOSH_SET_CC_PCLK_PIN(); addr <<= 1; } TOSH_SET_CC_PDATA_PIN(); TOSH_CLR_CC_PCLK_PIN(); TOSH_SET_CC_PCLK_PIN(); TOSH_SET_CC_PALE_PIN(); for (cnt = 0; cnt < 8; cnt++) { if (data & 0x80) { TOSH_SET_CC_PDATA_PIN(); } else { #line 131 TOSH_CLR_CC_PDATA_PIN(); } #line 132 TOSH_CLR_CC_PCLK_PIN(); TOSH_SET_CC_PCLK_PIN(); data <<= 1; } TOSH_SET_CC_PALE_PIN(); TOSH_SET_CC_PDATA_PIN(); TOSH_SET_CC_PCLK_PIN(); return SUCCESS; } static #line 156 uint8_t HPLCC1000M$HPLCC1000$read(uint8_t addr) #line 156 { int cnt; uint8_t din; uint8_t data = 0; addr <<= 1; TOSH_CLR_CC_PALE_PIN(); for (cnt = 0; cnt < 7; cnt++) { if (addr & 0x80) { TOSH_SET_CC_PDATA_PIN(); } else { #line 169 TOSH_CLR_CC_PDATA_PIN(); } #line 170 TOSH_CLR_CC_PCLK_PIN(); TOSH_SET_CC_PCLK_PIN(); addr <<= 1; } TOSH_CLR_CC_PDATA_PIN(); TOSH_CLR_CC_PCLK_PIN(); TOSH_SET_CC_PCLK_PIN(); TOSH_MAKE_CC_PDATA_INPUT(); TOSH_SET_CC_PALE_PIN(); for (cnt = 7; cnt >= 0; cnt--) { TOSH_CLR_CC_PCLK_PIN(); din = TOSH_READ_CC_PDATA_PIN(); if (din) { data = (data << 1) | 0x01; } else { #line 189 data = (data << 1) & 0xfe; } #line 190 TOSH_SET_CC_PCLK_PIN(); } TOSH_SET_CC_PALE_PIN(); TOSH_MAKE_CC_PDATA_OUTPUT(); TOSH_SET_CC_PDATA_PIN(); return data; } static # 622 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" result_t TupleRouterM$StdControl$start(void) #line 622 { TupleRouterM$mNumAttrs = 0; TupleRouterM$ChildControl$start(); TupleRouterM$NetControl$start(); if (TupleRouterM$IS_SNOOZING()) { TupleRouterM$mStopped = FALSE; TupleRouterM$startAllQueryAttrs(); TupleRouterM$AbsoluteTimer$fired(); } else #line 635 { TupleRouterM$TimerControl$start(); TupleRouterM$Leds$redOn(); } return SUCCESS; } static # 180 "d:/tinyos-1.x/tos/platform/mica/I2CM.nc" void I2CM$I2C_task(void) #line 180 { uint8_t current_state = I2CM$state; #line 182 I2CM$state = 0; if ((current_state & 0xf) == I2CM$READ_DATA) { I2CM$I2C$readDone(I2CM$i2c_read()); if (current_state & 0xf0) { I2CM$i2c_ack(); } else { #line 188 I2CM$i2c_nack(); } } else { #line 189 if (current_state == I2CM$WRITE_DATA) { I2CM$I2C$writeDone(I2CM$i2c_write(I2CM$local_data)); } else { #line 191 if (current_state == I2CM$SEND_START) { I2CM$i2c_start(); I2CM$I2C$sendStartDone(); } else { #line 194 if (current_state == I2CM$SEND_END) { I2CM$i2c_end(); I2CM$I2C$sendEndDone(); } } } } } static #line 109 char I2CM$read_bit(void) #line 109 { uint8_t i; I2CM$MAKE_DATA_INPUT(); I2CM$wait(); I2CM$SET_CLOCK(); I2CM$wait(); i = I2CM$GET_DATA(); I2CM$CLEAR_CLOCK(); return i; } static #line 244 result_t I2CM$I2C$write(char data) #line 244 { if (I2CM$state != 0) { return FAIL; } #line 247 I2CM$state = I2CM$WRITE_DATA; I2CM$local_data = data; TOS_post(I2CM$I2C_task); return SUCCESS; } static # 190 "d:/tinyos-1.x/tos/system/LogicalTimeM.nc" result_t LogicalTimeM$AbsoluteTimer$set(uint8_t id, tos_time_t in) #line 190 { { } #line 191 ; if (id >= MAX_NUM_TIMERS) { { } #line 193 ; return FAIL; } if (LogicalTimeM$TimeUtil$compare(LogicalTimeM$Time$get(), in) >= 0) { { } #line 201 ; LogicalTimeM$AbsoluteTimer$fired(id); return FAIL; } { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 206 { LogicalTimeM$useBit |= 0x1 << id; LogicalTimeM$aTimer[id] = in; if (LogicalTimeM$baseTimerIndex == -1) { LogicalTimeM$baseTimerIndex = id; LogicalTimeM$resetBaseTimer(); } else #line 212 { if (LogicalTimeM$TimeUtil$compare(LogicalTimeM$aTimer[(int )LogicalTimeM$baseTimerIndex], in) == 1) { LogicalTimeM$baseTimerIndex = id; LogicalTimeM$resetBaseTimer(); } } } #line 219 __nesc_atomic_end(__nesc_atomic); } { } #line 220 ; return SUCCESS; } static # 100 "d:/tinyos-1.x/tos/system/TimeUtilC.nc" tos_time_t TimeUtilC$TimeUtil$addUint32(tos_time_t a, uint32_t ms) #line 100 { tos_time_t result = a; #line 102 result.low32 += ms; if (result.low32 < a.low32) { result.high32++; } return result; } static # 74 "d:/tinyos-1.x/tos/lib/ServiceSchedulerM.nc" result_t ServiceSchedulerM$AbsoluteTimer$fired(void) #line 74 { uint32_t increment; pq_element svcidx = pqueue_dequeue((pqueue_t *)&ServiceSchedulerM$event_q); if (svcidx < 0) { return FAIL; } #line 80 if (ServiceSchedulerM$sched_info[svcidx].flags & START) { ServiceSchedulerM$Services$start(svcidx); ServiceSchedulerM$sched_info[svcidx].flags ^= START | STOP; increment = ServiceSchedulerM$sched_info[svcidx].on_time; ServiceSchedulerM$sched_info[svcidx].start_time = ServiceSchedulerM$TimeUtil$addUint32(ServiceSchedulerM$sched_info[svcidx].start_time, increment); pqueue_enqueue((pqueue_t *)&ServiceSchedulerM$event_q, svcidx); } else { #line 89 if (ServiceSchedulerM$sched_info[svcidx].flags & STOP) { ServiceSchedulerM$Services$stop(svcidx); ServiceSchedulerM$sched_info[svcidx].flags ^= START | STOP; if (ServiceSchedulerM$sched_info[svcidx].off_time > 0) { increment = ServiceSchedulerM$sched_info[svcidx].off_time; ServiceSchedulerM$sched_info[svcidx].start_time = ServiceSchedulerM$TimeUtil$addUint32(ServiceSchedulerM$sched_info[svcidx].start_time, increment); pqueue_enqueue((pqueue_t *)&ServiceSchedulerM$event_q, svcidx); } } } #line 101 svcidx = pqueue_peek((pqueue_t *)&ServiceSchedulerM$event_q); if (svcidx < 0) { return SUCCESS; } #line 104 return ServiceSchedulerM$AbsoluteTimer$set(ServiceSchedulerM$sched_info[svcidx].start_time); } static # 62 "d:/tinyos-1.x/tos/interfaces/pqueue.h" pq_element pqueue_dequeue_idx(pqueue_t *pq, int8_t i) #line 62 { pq_element ret; #line 63 pq_element tmp; int8_t left_child; #line 65 if (pq->n_elements == 0) { return -1; } ret = pq->heap[0]; pq->n_elements--; tmp = pq->heap[pq->n_elements]; while (i < pq->n_elements >> 1) { left_child = (i << 1) + 1; if (left_child < pq->n_elements - 1 && pq->compare(pq->heap[left_child], pq->heap[left_child + 1]) > 0) { left_child++; } if (pq->compare(pq->heap[left_child], tmp) >= 0) { break; } #line 80 pq->heap[i] = pq->heap[left_child]; i = left_child; } pq->heap[i] = tmp; return ret; } static #line 46 result_t pqueue_enqueue(pqueue_t *pq, pq_element e) #line 46 { int8_t ind; #line 47 int8_t parent; #line 48 if (pq->size <= pq->n_elements) { return FAIL; } #line 50 ind = pq->n_elements++; parent = (ind - 1) >> 1; while (ind > 0 && pq->compare(e, pq->heap[parent]) < 0) { pq->heap[ind] = pq->heap[parent]; ind = parent; parent = (ind - 1) >> 1; } pq->heap[ind] = e; return SUCCESS; } static # 656 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" result_t TupleRouterM$StdControl$stop(void) #line 656 { TupleRouterM$QueryListHandle qlh = TupleRouterM$mQs; TupleRouterM$mStopped = TRUE; TupleRouterM$AbsoluteTimer$cancel(); TupleRouterM$Leds$set(0); TupleRouterM$ChildControl$stop(); if (TupleRouterM$mQs != (void *)0 && !TupleRouterM$IS_SENDING_MESSAGE()) { TupleRouterM$NetControl$stop(); } if (TupleRouterM$IS_SENDING_MESSAGE()) { TupleRouterM$UNSET_SENDING_MESSAGE(); } if (TupleRouterM$IS_DELIVERING_TUPLES()) { TupleRouterM$UNSET_DELIVERING_TUPLES(); } #line 692 while (qlh != (void *)0) { (*qlh)->q.clockCount = TupleRouterM$WAKING_CLOCKS; qlh = (*qlh)->next; } return SUCCESS; } static # 225 "d:/tinyos-1.x/tos/system/LogicalTimeM.nc" result_t LogicalTimeM$AbsoluteTimer$cancel(uint8_t id) #line 225 { uint8_t running; #line 227 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 227 { running = LogicalTimeM$useBit & (0x01 << id); } #line 229 __nesc_atomic_end(__nesc_atomic); } if (id >= MAX_NUM_TIMERS || running == 0) { { } #line 231 ; return FAIL; } { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 235 { LogicalTimeM$useBit &= ~(0x1 << id); if (LogicalTimeM$baseTimerIndex == id) { LogicalTimeM$Timer$stop(NUM_TIMERS); LogicalTimeM$selectBaseTimer(); } } #line 241 __nesc_atomic_end(__nesc_atomic); } { } #line 242 ; return SUCCESS; } static #line 319 result_t LogicalTimeM$Timer$stop(uint8_t id) #line 319 { result_t rval = FAIL; #line 321 if (id >= NUM_TIMERS) { #line 321 return FAIL; } #line 322 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 322 { if (LogicalTimeM$mState & (0x1 << id)) { LogicalTimeM$mState &= ~(0x1 << id); if (!LogicalTimeM$mState) { LogicalTimeM$setIntervalFlag = 1; } { } #line 328 ; rval = SUCCESS; } } #line 331 __nesc_atomic_end(__nesc_atomic); } { } #line 332 ; return rval; } static #line 246 void LogicalTimeM$selectBaseTimer(void) #line 246 { uint8_t i; #line 247 uint8_t Index = 0xff; #line 248 if (LogicalTimeM$useBit) { for (i = 0; i < MAX_NUM_TIMERS; i++) { if (LogicalTimeM$useBit & (0x1 << i)) { #line 251 Index = i; #line 251 break; } } { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 254 { while (++i < MAX_NUM_TIMERS) { if (LogicalTimeM$useBit & (0x1 << i)) { if (LogicalTimeM$TimeUtil$compare(LogicalTimeM$aTimer[Index], LogicalTimeM$aTimer[i]) == 1) { Index = i; } } } } #line 262 __nesc_atomic_end(__nesc_atomic); } #line 261 LogicalTimeM$baseTimerIndex = Index; { } #line 262 ; LogicalTimeM$resetBaseTimer(); } } static #line 181 void LogicalTimeM$resetBaseTimer(void) #line 181 { tos_time_t td = LogicalTimeM$Time$get(); #line 183 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 183 { td = LogicalTimeM$TimeUtil$subtract(LogicalTimeM$aTimer[LogicalTimeM$baseTimerIndex], td); } #line 185 __nesc_atomic_end(__nesc_atomic); } LogicalTimeM$Timer$start(NUM_TIMERS, TIMER_ONE_SHOT, td.low32); { } #line 187 ; } static #line 336 result_t LogicalTimeM$Timer$start(uint8_t id, char type, uint32_t interval) #line 337 { uint8_t mInterval = LogicalTimeM$Clock$getInterval(); #line 339 { } #line 339 ; if (id > NUM_TIMERS) { { } #line 341 ; return FAIL; } if (type > 1) { { } #line 345 ; return FAIL; } { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 348 { LogicalTimeM$mTimerList[id].ticksLeft = --interval; LogicalTimeM$mTimerList[id].ticks = interval; LogicalTimeM$mTimerList[id].type = type; LogicalTimeM$mState |= 0x1 << id; if (interval < mInterval) { LogicalTimeM$Clock$setInterval(interval); { } #line 356 ; } } #line 358 __nesc_atomic_end(__nesc_atomic); } { } #line 359 ; return SUCCESS; } static # 106 "d:/tinyos-1.x/tos/platform/mica2/HPLSpiM.nc" result_t HPLSpiM$SpiByteFifo$disableIntr(void) #line 106 { * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x0D + 0x20) &= ~(1 << 7); * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x17 + 0x20) |= 1 << 0; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x18 + 0x20) &= ~(1 << 0); HPLSpiM$PowerManagement$adjustPower(); return SUCCESS; } static # 87 "d:/tinyos-1.x/tos/platform/mica2/HPLPowerManagementM.nc" uint8_t HPLPowerManagementM$PowerManagement$adjustPower(void) #line 87 { uint8_t mcu; #line 89 if (!HPLPowerManagementM$disabled) { TOS_post(HPLPowerManagementM$doAdjustment); } else #line 91 { mcu = * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x35 + 0x20); mcu &= 0xe3; mcu |= HPLPowerManagementM$IDLE; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x35 + 0x20) = mcu; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x35 + 0x20) |= 1 << 5; } return 0; } static # 1949 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" result_t TupleRouterM$AbsoluteTimer$fired(void) #line 1949 { if (TupleRouterM$mIsRunning) { if ( #line 1954 TupleRouterM$mAllQueriesSameRate && !TupleRouterM$IS_SNOOZING() && TupleRouterM$mQs != (void *)0) { result_t r; ParsedQueryPtr pq = & (*TupleRouterM$mQs)->q; tos_time_t t = TupleRouterM$Time$get(); tos_service_schedule sched; short sleepClocks = pq->clocksPerSample; long sleepUs = sleepClocks * TupleRouterM$mOldRate; if (pq->clocksPerSample <= TupleRouterM$WAKING_CLOCKS) { TupleRouterM$mStopped = FALSE; goto dontSleep; } sched.start_time = TupleRouterM$TimeUtil$addUint32(t, 1); sched.on_time = (TupleRouterM$WAKING_CLOCKS + 1) * TupleRouterM$mOldRate; sched.off_time = (sleepClocks - (TupleRouterM$WAKING_CLOCKS + 1)) * TupleRouterM$mOldRate; TupleRouterM$SET_SNOOZING(); r = TupleRouterM$ServiceScheduler$reschedule(kTINYDB_SERVICE_ID, sched); } else { dontSleep: if (!TupleRouterM$mStopped) { tos_time_t cur_time = TupleRouterM$Time$get(); uint32_t rateUs = (uint32_t )TupleRouterM$mOldRate; cur_time.low32 -= cur_time.low32 % rateUs; cur_time.low32 += rateUs; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 1992 { TupleRouterM$AbsoluteTimer$set(cur_time); } #line 1994 __nesc_atomic_end(__nesc_atomic); } TupleRouterM$decrementQueryCounter(); TOS_post(TupleRouterM$mainTask); } } } return SUCCESS; } static # 91 "d:/tinyos-1.x/tos/interfaces/pqueue.h" pq_element pqueue_remove(pqueue_t *pq, pq_element e) #line 91 { int8_t i; #line 93 for (i = 0; i < pq->size; i++) { if (pq->heap[i] == e) { return pqueue_dequeue_idx(pq, i); } } return -1; } static # 853 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkM.nc" void NetworkM$NetworkMonitor$updateContention(bool failure, int status) #line 853 { if (failure) { if (status == SEND_BUSY_FAILURE) { NetworkM$mContention++; } else { #line 858 NetworkM$mContention += 10; } } else #line 860 { NetworkM$mContention -= NetworkM$mContention >> NetworkM$CONTENT_SHIFT; if (NetworkM$mContention < 1 << NetworkM$CONTENT_SHIFT) { NetworkM$mRem += NetworkM$mContention; } #line 864 if (NetworkM$mRem > 1 << NetworkM$CONTENT_SHIFT) { NetworkM$mContention--; NetworkM$mRem -= 1 << NetworkM$CONTENT_SHIFT; } } } static # 1287 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$sendQuery(void) #line 1287 { TupleRouterM$QueryListHandle curq = TupleRouterM$mCurSendingQuery; QueryMessage *qmsg = TupleRouterM$Network$getQueryPayLoad(&TupleRouterM$mQmsg); if (curq == (void *)0) { TupleRouterM$UNSET_SENDING_QUERY(); return; } if ((*curq)->q.fromBuffer != kNO_QUERY) { TupleRouterM$UNSET_SENDING_QUERY(); return; } if (TupleRouterM$mCurSendingField < (*curq)->q.numFields) { char fieldId = TupleRouterM$ParsedQueryIntf$getFieldId(& (*curq)->q, (short )TupleRouterM$mCurSendingField); qmsg->msgType = ADD_MSG; qmsg->qid = (*curq)->q.qid; qmsg->numFields = (*curq)->q.numFields; qmsg->numExprs = (*curq)->q.numExprs; qmsg->fromBuffer = (*curq)->q.fromBuffer; qmsg->fromCatalogBuffer = (*curq)->q.fromCatalogBuffer; qmsg->hasForClause = (*curq)->q.hasForClause; qmsg->epochDuration = (*curq)->q.epochDuration; qmsg->bufferType = (*curq)->q.bufferType; qmsg->queryRoot = (*curq)->q.queryRoot; TupleRouterM$mCurSendingField++; if (!TupleRouterM$ParsedQueryIntf$queryFieldIsNull(fieldId)) { AttrDescPtr attr = TupleRouterM$AttrUse$getAttrById(fieldId); qmsg->type = kFIELD; qmsg->idx = TupleRouterM$mCurSendingField - 1; strcpy(qmsg->u.field.name, attr->name); TupleRouterM$Leds$greenToggle(); if (!TupleRouterM$IS_SENDING_MESSAGE()) { TupleRouterM$SET_SENDING_MESSAGE(); TupleRouterM$mMustTimestamp = TRUE; TupleRouterM$mTimestampMsg = &TupleRouterM$mQmsg; if (TupleRouterM$Network$sendQueryMessage(&TupleRouterM$mQmsg) != err_NoError) { TupleRouterM$UNSET_SENDING_MESSAGE(); TupleRouterM$mMustTimestamp = FALSE; } } } else { TOS_post(TupleRouterM$sendQuery); } } else { if (TupleRouterM$mCurSendingExpr < (*curq)->q.numExprs) { Expr e = TupleRouterM$ParsedQueryIntf$getExpr(& (*curq)->q, TupleRouterM$mCurSendingExpr); #line 1349 TupleRouterM$mCurSendingExpr++; qmsg->type = kEXPR; qmsg->idx = TupleRouterM$mCurSendingExpr - 1; qmsg->u.expr = e; TupleRouterM$Leds$redToggle(); if (!TupleRouterM$IS_SENDING_MESSAGE()) { TupleRouterM$SET_SENDING_MESSAGE(); TupleRouterM$mMustTimestamp = TRUE; TupleRouterM$mTimestampMsg = &TupleRouterM$mQmsg; if (TupleRouterM$Network$sendQueryMessage(&TupleRouterM$mQmsg) != err_NoError) { TupleRouterM$UNSET_SENDING_MESSAGE(); TupleRouterM$mMustTimestamp = FALSE; } } } else { #line 1367 if ((*curq)->q.bufferType != kRADIO) { qmsg->type = kBUF_MSG; qmsg->u.buf = (*curq)->q.buf; TupleRouterM$Leds$yellowToggle(); if (!TupleRouterM$IS_SENDING_MESSAGE()) { TupleRouterM$SET_SENDING_MESSAGE(); if (TupleRouterM$Network$sendQueryMessage(&TupleRouterM$mQmsg) != err_NoError) { TupleRouterM$UNSET_SENDING_MESSAGE(); } } } else { TupleRouterM$UNSET_SENDING_QUERY(); } } } } static # 149 "d:/tinyos-1.x/tos/lib/Attr.nc" AttrDescPtr Attr$AttrUse$getAttrById(uint8_t attrIdx) { short numAttrs = Attr$attrDescs.numAttrs; #line 152 if (attrIdx >= numAttrs) { return (void *)0; } #line 154 return &Attr$attrDescs.attrDesc[(short )attrIdx]; } static # 139 "d:/tinyos-1.x/tos/system/LedsC.nc" result_t LedsC$Leds$greenToggle(void) #line 139 { result_t rval; #line 141 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 141 { if (LedsC$ledsOn & LedsC$GREEN_BIT) { rval = LedsC$Leds$greenOff(); } else { #line 145 rval = LedsC$Leds$greenOn(); } } #line 147 __nesc_atomic_end(__nesc_atomic); } #line 147 return rval; } static # 425 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkM.nc" TinyDBError NetworkM$Network$sendQueryMessage(TOS_MsgPtr msg) #line 425 { NetworkMessage *nw = (NetworkMessage *)msg->data; uint8_t rootId = 0; bool amRoot = NetworkM$checkRoot(msg, &rootId); NetworkM$mMsg = msg; NetworkM$mAmId = kQUERY_MESSAGE_ID; if (!NetworkM$mRadio) { NetworkM$mRadio = TRUE; NetworkM$initHeader(& nw->hdr, amRoot, rootId); NetworkM$mRetryCnt = NetworkM$QUERY_RETRIES; if (NetworkM$SendQueryMsg$send(TOS_BCAST_ADDR, kMSG_LEN, msg) == SUCCESS) { NetworkM$Leds$redToggle(); return err_NoError; } else #line 444 { NetworkM$mIdx--; NetworkM$mRadio = FALSE; return err_MessageSendFailed; } } return err_MessageSendFailed; } static #line 324 bool NetworkM$checkRoot(TOS_MsgPtr msg, uint8_t *rootIdPtr) #line 324 { short root = NetworkM$QueryProcessor$msgToQueryRoot(msg); uint8_t rootId; if (root == -1) { *rootIdPtr = 0; return FALSE; } rootId = NetworkM$getRootId(root); *rootIdPtr = rootId; if (root == TOS_LOCAL_ADDRESS) { #line 335 NetworkM$setRoot(rootId); } #line 336 return root == TOS_LOCAL_ADDRESS; } static # 2763 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" bool TupleRouterM$getQuery(uint8_t qid, ParsedQuery **q) #line 2763 { TupleRouterM$QueryListHandle curq; curq = TupleRouterM$mQs; while (curq != (void *)0) { if ((*curq)->q.qid == qid) { *q = & (*curq)->q; return TRUE; } else { #line 2772 curq = (TupleRouterM$QueryListHandle )(*curq)->next; } } #line 2774 *q = (void *)0; return FALSE; } static # 797 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkM.nc" void NetworkM$initHeader(DbMsgHdr *header, bool amRoot, uint8_t rootId) #line 797 { header->senderid = TOS_LOCAL_ADDRESS; if (!amRoot) { header->parentid = NetworkM$mRelatives[NetworkM$mParentIx[rootId]]; header->level = NetworkM$myLevel(rootId); } else #line 802 { header->parentid = 0; header->level = 0; } header->idx = NetworkM$mIdx++; } static #line 245 uint8_t NetworkM$myLevel(uint8_t rootId) #line 245 { if (NetworkM$mRoots[rootId] == TOS_LOCAL_ADDRESS) { #line 246 return 0; } #line 247 if (NetworkM$mParentIx[rootId] == NetworkM$PARENT_UNKNOWN || NetworkM$mRelLevel[rootId][NetworkM$mParentIx[rootId]] == NetworkM$LEVEL_UNKNOWN) { return NetworkM$LEVEL_UNKNOWN; } #line 249 return NetworkM$mRelLevel[rootId][NetworkM$mParentIx[rootId]] + 1; } static # 209 "d:/tinyos-1.x/tos/system/AMStandard.nc" result_t AMStandard$SendMsg$send(uint8_t id, uint16_t addr, uint8_t length, TOS_MsgPtr data) #line 209 { bool oldState; #line 211 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 211 { oldState = AMStandard$state; AMStandard$state = TRUE; } #line 214 __nesc_atomic_end(__nesc_atomic); } if (!oldState) { if (length > DATA_LENGTH) { { } #line 218 ; return FAIL; } if (!TOS_post(AMStandard$sendTask)) { { } #line 222 ; return FAIL; } else { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 226 { AMStandard$state = TRUE; } #line 228 __nesc_atomic_end(__nesc_atomic); } } { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 230 { AMStandard$buffer = data; data->length = length; data->addr = addr; data->type = id; AMStandard$buffer->group = TOS_AM_GROUP; { } #line 236 ; AMStandard$dbgPacket(data); } #line 238 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } return FAIL; } static # 133 "d:/tinyos-1.x/tos/system/UARTM.nc" result_t UARTM$ByteComm$txByte(uint8_t data) #line 133 { bool oldState; { } #line 136 ; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 138 { oldState = UARTM$state; UARTM$state = TRUE; } #line 141 __nesc_atomic_end(__nesc_atomic); } if (oldState) { return FAIL; } UARTM$HPLUART$put(data); return SUCCESS; } static # 93 "d:/tinyos-1.x/tos/system/RandomLFSR.nc" uint16_t RandomLFSR$Random$rand(void) #line 93 { bool endbit; uint16_t tmpShiftReg; #line 96 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 96 { tmpShiftReg = RandomLFSR$shiftReg; endbit = (tmpShiftReg & 0x8000) != 0; tmpShiftReg <<= 1; if (endbit) { tmpShiftReg ^= 0x100b; } #line 102 tmpShiftReg++; RandomLFSR$shiftReg = tmpShiftReg; tmpShiftReg = tmpShiftReg ^ RandomLFSR$mask; } #line 105 __nesc_atomic_end(__nesc_atomic); } return tmpShiftReg; } static # 209 "d:/tinyos-1.x/tos/platform/mica2/CC1000ControlM.nc" result_t CC1000ControlM$CC1000Control$RxMode(void) #line 209 { CC1000ControlM$HPLChipcon$write(0x00, ( 1 << 4) | (1 << 0)); CC1000ControlM$HPLChipcon$write(0x09, ({ #line 215 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_Params[CC1000ControlM$tunefreq][0x09]; #line 215 unsigned char __result; #line 215 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } )); #line 216 CC1000ControlM$HPLChipcon$write(0x0B, 0x00); TOSH_uwait(250); return SUCCESS; } static # 167 "d:/tinyos-1.x/tos/system/AMStandard.nc" result_t AMStandard$reportSendDone(TOS_MsgPtr msg, result_t success) #line 167 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 168 { AMStandard$state = FALSE; } #line 170 __nesc_atomic_end(__nesc_atomic); } AMStandard$SendMsg$sendDone(msg->type, msg, success); AMStandard$sendDone(); return SUCCESS; } static # 496 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkM.nc" result_t NetworkM$sendDone(TOS_MsgPtr msg, result_t success) #line 496 { { } #line 497 ; if (NetworkM$mUart && msg == &NetworkM$mDbg) { NetworkM$mUart = FALSE; } else { #line 501 if (NetworkM$mRadio) { NetworkM$mRadio = FALSE; if (!NetworkM$mLocal && !NetworkM$mWasCommand) { switch (NetworkM$mAmId) { case kDATA_MESSAGE_ID: NetworkM$Network$sendDataDone(msg, success); break; case kQUERY_MESSAGE_ID: NetworkM$Network$sendQueryDone(msg, success); break; case kQUERY_REQUEST_MESSAGE_ID: NetworkM$Network$sendQueryRequestDone(msg, success); break; } } else { #line 515 if (NetworkM$mWasCommand) { NetworkM$CommandUse$invokeMsg(&NetworkM$mDbg, (void *)0, &NetworkM$errorNo); NetworkM$mWasCommand = FALSE; } else #line 519 { NetworkM$mLocal = FALSE; } } } } #line 523 return SUCCESS; } static # 2276 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" result_t TupleRouterM$outputDone(TOS_MsgPtr msg) #line 2276 { if (TupleRouterM$IS_SENDING_MESSAGE()) { TupleRouterM$UNSET_SENDING_MESSAGE(); TupleRouterM$Leds$greenToggle(); if (TupleRouterM$IS_SENDING_QUERY()) { TupleRouterM$mSendQueryNextClock = TRUE; } } if (TupleRouterM$mRadioWaiting) { TupleRouterM$mRadioWaiting = FALSE; } if (TupleRouterM$mSendingResult) { TOS_post(TupleRouterM$deliverTuplesTask); TupleRouterM$mSendingResult = FALSE; } return SUCCESS; } static #line 2114 void TupleRouterM$deliverTuplesTask(void) #line 2114 { bool success; bool didAgg = FALSE; bool pending = FALSE; { } #line 2120 ; TupleRouterM$SET_DELIVERING_TUPLES(); TupleRouterM$mCurRouteQuery = TupleRouterM$nextQueryToRoute(TupleRouterM$mCurRouteQuery); if (TupleRouterM$mCurRouteQuery != (void *)0) { ParsedQuery *pq = & (*TupleRouterM$mCurRouteQuery)->q; Expr *e = TupleRouterM$nextExpr(pq); TinyDBError err = err_NoError; QueryResult qr; uint16_t size; success = TOS_LOCAL_ADDRESS == pq->queryRoot ? FALSE : TRUE; TupleRouterM$QueryResultIntf$initQueryResult(&qr); { } #line 2140 ; qr.epoch = pq->currentEpoch; qr.qid = pq->qid; while (e != (void *)0) { if (e->opType != kSEL) { err = TupleRouterM$addResults(&qr, pq, e); didAgg = TRUE; } else { if (! e->success) { #line 2155 success = FALSE; } } #line 2157 e = TupleRouterM$nextExpr(pq); } if (didAgg && err == err_NoError && TupleRouterM$QueryResultIntf$numRecords(&qr, pq) > 0) { TupleRouterM$mEnqResult = qr; err = TupleRouterM$DBBuffer$enqueue(pq->bufferId, &TupleRouterM$mEnqResult, &pending, pq); if (err != err_ResultBufferBusy && err != err_NoError) { TupleRouterM$signalError(err, 2172); } } if (success && !didAgg) { TupleRouterM$mEnqResult = qr; TupleRouterM$QueryResultIntf$fromTuple(&TupleRouterM$mEnqResult, pq, TupleRouterM$ParsedQueryIntf$getTuplePtr(pq)); err = TupleRouterM$DBBuffer$enqueue(pq->bufferId, &TupleRouterM$mEnqResult, &pending, pq); #line 2213 if (err != err_ResultBufferBusy && err != err_NoError) { TupleRouterM$signalError(err, 2214); } } if (TupleRouterM$mAllQueriesSameRate && pq->clocksPerSample >= TupleRouterM$WAKING_CLOCKS) { pq->clockCount += TupleRouterM$WAKING_CLOCKS; } else #line 2222 { pq->clockCount += pq->clocksPerSample; } if (pq->fromBuffer != kNO_QUERY && pq->epochDuration == kONE_SHOT) { uint8_t fromBuf; #line 2235 err = TupleRouterM$DBBuffer$getBufferId(pq->fromBuffer, pq->fromCatalogBuffer, &fromBuf); err = TupleRouterM$DBBuffer$size(fromBuf, &size); if (err != err_NoError || pq->curResult++ >= size) { if (pq->hasEvent) { pq->running = FALSE; pq->curResult = 0; } else { pq->markedForDeletion = TupleRouterM$EPOCHS_TIL_DELETION; } } } else { if (pq->hasForClause && pq->numEpochs > 0 && pq->currentEpoch > pq->numEpochs) { pq->markedForDeletion = TupleRouterM$EPOCHS_TIL_DELETION; } } if (!pending) { #line 2263 TOS_post(TupleRouterM$deliverTuplesTask); } #line 2264 TupleRouterM$mCurExpr = -1; } else { TupleRouterM$UNSET_DELIVERING_TUPLES(); { } #line 2269 ; TupleRouterM$startFetchingTuples(); } } static #line 2689 TupleRouterM$QueryListHandle TupleRouterM$nextQueryToRoute(TupleRouterM$QueryListHandle curQuery) #line 2689 { TupleRouterM$mCurTuple = (void *)0; if (curQuery == (void *)0) { curQuery = TupleRouterM$mQs; } else { #line 2694 curQuery = (TupleRouterM$QueryListHandle )(*curQuery)->next; } while (curQuery != (void *)0) { if ((*curQuery)->q.clocksPerSample > 0 && (*curQuery)->q.clockCount <= 0) { TupleRouterM$mCurTuple = TupleRouterM$ParsedQueryIntf$getTuplePtr(& (*curQuery)->q); break; } else #line 2700 { curQuery = (TupleRouterM$QueryListHandle )(*curQuery)->next; } } return curQuery; } static # 113 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQuery.nc" TuplePtr ParsedQuery$ParsedQueryIntf$getTuplePtr(ParsedQueryPtr q) #line 113 { return (Tuple *)&((char *)q)[sizeof(ParsedQuery ) + (q->numFields - 1) * sizeof(char ) + q->numExprs * sizeof(Expr )]; } static # 2745 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" Expr *TupleRouterM$nextExpr(ParsedQuery *q) #line 2745 { if (++TupleRouterM$mCurExpr >= q->numExprs) { TupleRouterM$mCurExpr = -1; return (void *)0; } else #line 2749 { Expr *e; #line 2751 e = TupleRouterM$ParsedQueryIntf$getExprPtr(q, TupleRouterM$mCurExpr); return e; } } static # 100 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQuery.nc" ExprPtr ParsedQuery$ParsedQueryIntf$getExprPtr(ParsedQueryPtr q, uint8_t n) #line 100 { return (Expr *)&((char *)q)[sizeof(ParsedQuery ) + (q->numFields - 1) * sizeof(char ) + n * sizeof(Expr )]; } static # 115 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/Aggregates.h" void setParamValues(ParamVals *v, Expr *e) #line 115 { v->numParams = 4; v->paramDataPtr[0] = (char *)&e->ex.tagg.args[0]; v->paramDataPtr[1] = (char *)&e->ex.tagg.args[1]; v->paramDataPtr[2] = (char *)&e->ex.tagg.args[2]; } static # 274 "d:/tinyos-1.x/tos/lib/TinyDB/QueryResult.nc" short QueryResult$QueryResultIntf$numRecords(QueryResultPtr qr, ParsedQueryPtr q) #line 274 { if (qr->qrType == kIS_AGG) { return qr->result_idx; } else { #line 277 if (qr->qrType == kAGG_SINGLE_FIELD) { return 1; } else { #line 279 if (qr->qrType == kNOT_AGG) { return 1; } else { #line 283 return 0; } } } } static # 457 "d:/tinyos-1.x/tos/lib/TinyDB/DBBufferC.nc" TinyDBError DBBufferC$DBBuffer$enqueue(uint8_t bufferId, QueryResultPtr r, bool *pending, ParsedQuery *pq) #line 457 { DBBufferC$Buffer *buf; uint16_t row; TinyDBError err = err_NoError; Handle *bufList; *pending = FALSE; switch (bufferId) { case kRADIO_BUFFER: { int i; int numResults = DBBufferC$QueryResultIntf$numRecords(r, pq); QueryResult newqr; ResultTuple rtup; for (i = 0; i < numResults; i++) { rtup = DBBufferC$QueryResultIntf$getResultTuple(r, i, pq); if (rtup.error != err_NoError) { #line 476 return rtup.error; } err = DBBufferC$QueryResultIntf$fromResultTuple(rtup, &newqr, pq); if (err != err_NoError) { #line 479 break; } err = DBBufferC$RadioQueue$enqueue((QueryResultPtr )&newqr, pending); if (err != err_NoError) { #line 483 break; } } return err; } case DBBufferC$kATTR_BUF: case DBBufferC$kEVENT_BUF: case DBBufferC$kCOMMAND_BUF: case DBBufferC$kQUERY_BUF: return err_UnsupportedBuffer; default: err = DBBufferC$getBuf(bufferId, &buf); if (err != err_NoError) { #line 496 return err; } #line 497 break; } switch (buf->type) { case kCOMMAND: { char *cmdStr = (char *)& buf->data; CommandDescPtr cmd = DBBufferC$CommandUse$getCommandById((uint8_t )cmdStr[0]); if (cmd != (void *)0) { ParamVals params; SchemaErrorNo schema_err; char result[1]; switch (cmd->params.numParams) { case 0: params.numParams = 0; break; case 1: if ( #line 520 cmd->params.params[0] != INT16 && cmd->params.params[0] != UINT16 && cmd->params.params[0] != INT8 && cmd->params.params[0] != UINT8) { return err_UnknownError; } #line 525 params.numParams = 1; params.paramDataPtr[0] = &cmdStr[1]; break; default: return err_InvalidIndex; } DBBufferC$CommandUse$invoke(cmd->name, result, &schema_err, ¶ms); } } break; case kEEPROM: if (DBBufferC$mState != DBBufferC$kIDLE) { return err_ResultBufferBusy; } if (! buf->u.eeprom.isOpen) { return err_BufferNotOpen; } err = DBBufferC$calcNextFreeRow(buf); if (err != err_NoError) { return err; } DBBufferC$mState = DBBufferC$kEEPROM_ALLOC_ROW; DBBufferC$mCurResult = r; DBBufferC$mCurBuffer = bufferId; *pending = TRUE; DBBufferC$mCurRowHandle = DBBufferC$mEepromRow; if (DBBufferC$mEepromRow == (void *)0) { if (DBBufferC$MemAlloc$allocate(&DBBufferC$mEepromRow, DBBufferC$QueryResultIntf$resultSize(r, pq) + 1) != SUCCESS) { *pending = FALSE; DBBufferC$mState = DBBufferC$kIDLE; DBBufferC$cleanupBuffer(bufferId, 565); return err_EepromFailure; } } else #line 568 { if (DBBufferC$MemAlloc$reallocate(DBBufferC$mEepromRow, DBBufferC$QueryResultIntf$resultSize(r, pq) + 1) != SUCCESS) { *pending = FALSE; DBBufferC$mState = DBBufferC$kIDLE; DBBufferC$cleanupBuffer(bufferId, 573); return err_EepromFailure; } } break; case kRAM: if (DBBufferC$mState != DBBufferC$kIDLE) { return err_ResultBufferBusy; } DBBufferC$mState = DBBufferC$kALLOC_ROW; row = buf->nextFree; err = DBBufferC$calcNextFreeRow(buf); if (err != err_NoError) { DBBufferC$mState = DBBufferC$kIDLE; return err; } DBBufferC$mCurResult = r; DBBufferC$mCurRow = row; DBBufferC$mCurBuffer = bufferId; *pending = TRUE; bufList = (Handle *)* buf->u.bufdata; if (bufList[row] != (void *)0) { DBBufferC$mCurRowHandle = bufList[row]; if (DBBufferC$MemAlloc$reallocate(bufList[row], DBBufferC$QueryResultIntf$resultSize(r, pq)) != SUCCESS) { *pending = FALSE; DBBufferC$mState = DBBufferC$kIDLE; DBBufferC$cleanupBuffer(bufferId, 611); return err_OutOfMemory; } } else #line 614 { if (DBBufferC$MemAlloc$allocate(&DBBufferC$mCurRowHandle, DBBufferC$QueryResultIntf$resultSize(r, pq)) != SUCCESS) { *pending = FALSE; DBBufferC$mState = DBBufferC$kIDLE; DBBufferC$cleanupBuffer(bufferId, 618); return err_OutOfMemory; } } break; default: return err_UnknownError; } return err_NoError; } static # 288 "d:/tinyos-1.x/tos/lib/TinyDB/QueryResult.nc" ResultTuple QueryResult$QueryResultIntf$getResultTuple(QueryResultPtr qr, short i, ParsedQueryPtr q) #line 288 { ResultTuple rf; rf.error = err_NoError; if (i >= QueryResult$QueryResultIntf$numRecords(qr, q)) { rf.error = err_IndexOutOfBounds; } rf.qid = qr->qid; rf.isAgg = qr->qrType == kIS_AGG; rf.epoch = qr->epoch; if (qr->qrType == kIS_AGG) { rf.u.agg.group = qr->d.buf[i].group; rf.u.agg.id = i; rf.u.agg.len = QueryResult$BUF_SIZE; rf.data = qr->d.buf[i].data; } else { #line 307 if (qr->qrType == kAGG_SINGLE_FIELD) { rf.u.agg.id = 0; rf.u.agg.group = kNO_GROUPING_FIELD; rf.u.agg.len = QueryResult$BUF_SIZE; rf.data = (char *)qr->d.data; } else #line 312 { rf.u.tupleField = i; rf.data = (char *)& qr->d.t; } } return rf; } static #line 222 TinyDBError QueryResult$QueryResultIntf$fromResultTuple(ResultTuple r, QueryResultPtr qr, ParsedQueryPtr pq) #line 222 { qr->qid = r.qid; qr->qrType = r.isAgg ? kAGG_SINGLE_FIELD : kNOT_AGG; qr->epoch = r.epoch; if (r.isAgg) { qr->result_idx = r.u.agg.id; nmemcpy(qr->d.data, r.data, QueryResult$BUF_SIZE); } else #line 230 { qr->result_idx = 0; nmemcpy((char *)& qr->d.t, r.data, QueryResult$TupleIntf$tupleSize(pq)); } return err_NoError; } static # 142 "d:/tinyos-1.x/tos/system/tos.h" void *nmemcpy(void *to, const void *from, size_t n) { char *cto = to; const char *cfrom = from; while (n--) * cto++ = * cfrom++; return to; } static # 93 "d:/tinyos-1.x/tos/lib/TinyDB/Tuple.nc" uint16_t Tuple$TupleIntf$tupleSize(ParsedQueryPtr q) #line 93 { short i; short size = sizeof(Tuple ); for (i = 0; i < q->numFields; i++) { size += Tuple$TupleIntf$fieldSize(q, (uint8_t )i); } return size; } static uint16_t Tuple$TupleIntf$fieldSize(ParsedQueryPtr q, uint8_t fieldNo) #line 106 { if (q->fromCatalogBuffer) { uint8_t from_fieldNo = q->queryToSchemaFieldMap[(short )fieldNo]; #line 109 return Tuple$CatalogTable$catalogFieldSize(q->fromBuffer, from_fieldNo); } else { #line 110 if (q->fromBuffer != kNO_QUERY) { int8_t bufferId; ParsedQuery *fromq; uint8_t from_fieldNo = q->queryToSchemaFieldMap[(short )fieldNo]; Tuple$DBBuffer$getBufferId(q->fromBuffer, FALSE, &bufferId); fromq = *Tuple$DBBuffer$getSchema(bufferId); if (fromq == (void *)0) { return 0; } if (!Tuple$ParsedQueryIntf$queryFieldIsNull(fromq->queryToSchemaFieldMap[(short )from_fieldNo])) { if (fromq->queryToSchemaFieldMap[(short )from_fieldNo] == GROUP_FIELD) { return Tuple$typeToSize(UINT16); } else #line 128 { AttrDescPtr attr = (void *)0; #line 130 if (Tuple$ParsedQueryIntf$queryFieldIsTyped(fromq->queryToSchemaFieldMap[(short )from_fieldNo])) { if (fromq->tableInfo != (void *)0) { char *name; #line 133 Tuple$Table$getFieldName(fromq, from_fieldNo, &name); attr = Tuple$AttrUse$getAttr(name); } } else { #line 137 attr = Tuple$AttrUse$getAttrById(fromq->queryToSchemaFieldMap[(short )from_fieldNo]); } #line 138 if (attr != (void *)0) { return Tuple$typeToSize(attr->type); } else { #line 141 return 0; } } } else { #line 145 return 0; } } else #line 146 { if (!Tuple$ParsedQueryIntf$queryFieldIsNull(q->queryToSchemaFieldMap[(short )fieldNo])) { if (Tuple$ParsedQueryIntf$queryFieldIsTyped(q->queryToSchemaFieldMap[(short )fieldNo])) { if (q->tableInfo == (void *)0) { return 0; } else #line 151 { uint8_t type; #line 153 if (Tuple$Table$getType(q, (short )fieldNo, &type) == SUCCESS) { return Tuple$typeToSize(type); } } } else #line 156 { AttrDescPtr attr = Tuple$AttrUse$getAttrById(q->queryToSchemaFieldMap[(short )fieldNo]); #line 158 if (attr != (void *)0) { return Tuple$typeToSize(attr->type); } else { #line 161 return 0; } } } else { #line 164 return 0; } } } #line 166 return 0; } static # 2615 "d:/tinyos-1.x/tos/lib/TinyDB/DBBufferC.nc" TinyDBError DBBufferC$getSpecialBufferId(BufferType type, uint8_t *bufferId) #line 2615 { switch (type) { case kRADIO: *bufferId = kRADIO_BUFFER; break; case kATTRLIST: *bufferId = DBBufferC$kATTR_BUF; break; case kQUERYLIST: *bufferId = DBBufferC$kQUERY_BUF; break; case kCOMMANDLIST: *bufferId = DBBufferC$kCOMMAND_BUF; break; case kEVENTLIST: *bufferId = DBBufferC$kEVENT_BUF; break; default: return err_UnsupportedBuffer; } return err_NoError; } static #line 1194 TinyDBError DBBufferC$DBBuffer$getBufferId(uint8_t bufIdx, bool special, uint8_t *bufferId) #line 1194 { int i; int qid; if (special) { return DBBufferC$getSpecialBufferId(bufIdx, bufferId); } qid = bufIdx; for (i = 1; i < DBBufferC$kNUM_BUFS; i++) { if (DBBufferC$mUsedBufs & (1 << i)) { if ((* DBBufferC$mBuffers[i].qh)->qid == qid) { *bufferId = i; return err_NoError; } } } return err_InvalidIndex; } static #line 1073 ParsedQuery **DBBufferC$DBBuffer$getSchema(uint8_t bufferId) #line 1073 { DBBufferC$Buffer *buf; TinyDBError err = DBBufferC$getBuf(bufferId, &buf); #line 1076 if (err != err_NoError) { #line 1076 return (void *)0; } #line 1077 return buf->qh; } static #line 2540 TinyDBError DBBufferC$getBuf(uint8_t bufId, DBBufferC$Buffer **buf) #line 2540 { if (bufId >= DBBufferC$kNUM_BUFS) { return err_IndexOutOfBounds; } #line 2543 if ((DBBufferC$mUsedBufs & (1 << bufId)) == 0) { return err_InvalidIndex; } #line 2545 *buf = &DBBufferC$mBuffers[bufId]; return err_NoError; } static # 168 "d:/tinyos-1.x/tos/lib/TinyDB/TableM.nc" uint8_t TableM$nameOffset(char *names, uint8_t i) #line 168 { uint8_t offset = 0; #line 170 while (i--) { while (names[offset] != 0) offset++; offset++; } return offset; } static # 133 "d:/tinyos-1.x/tos/lib/Attr.nc" AttrDescPtr Attr$AttrUse$getAttr(char *name) { short numAttrs = Attr$attrDescs.numAttrs; short i; #line 138 for (i = 0; i < numAttrs; i++) { if (strcasecmp(Attr$attrDescs.attrDesc[i].name, name) == 0) { return &Attr$attrDescs.attrDesc[i]; } } #line 143 return (void *)0; } static # 97 "d:/tinyos-1.x/tos/lib/TinyDB/TableM.nc" result_t TableM$Table$getType(ParsedQuery *pq, uint8_t fieldIdx, uint8_t *type) #line 97 { if (pq->tableInfo != (void *)0 && pq->numFields > fieldIdx) { *type = TableM$getTypes(pq)[fieldIdx]; return SUCCESS; } return FAIL; } static # 364 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkM.nc" TinyDBError NetworkM$Network$sendDataMessage(TOS_MsgPtr msg) #line 364 { NetworkMessage *nw = (NetworkMessage *)msg->data; bool amRoot; uint8_t rootId = 0; NetworkM$mMsg = msg; NetworkM$mAmId = kDATA_MESSAGE_ID; amRoot = NetworkM$checkRoot(msg, &rootId); if (!NetworkM$mRadio) { NetworkM$mRadio = TRUE; NetworkM$initHeader(& nw->hdr, amRoot, rootId); if (amRoot) { NetworkM$mIdx--; if (NetworkM$SendDataMsg$send(TOS_UART_ADDR, kMSG_LEN, msg) == SUCCESS) { return err_NoError; } else #line 388 { NetworkM$mRadio = FALSE; return err_MessageSendFailed; } } else #line 392 { NetworkM$mRetryCnt = NetworkM$DATA_RETRIES; if (NetworkM$SendDataMsg$send(TOS_BCAST_ADDR, kMSG_LEN, msg) == SUCCESS) { return err_NoError; } else #line 396 { NetworkM$mIdx--; NetworkM$mRadio = FALSE; return err_MessageSendFailed; } } } #line 402 return err_MessageSendFailed; } static # 119 "d:/tinyos-1.x/tos/lib/Command.nc" result_t Command$CommandUse$invoke(char *commandName, char *resultBuf, SchemaErrorNo *errorNo, ParamVals *params) { CommandDescPtr commandDesc = Command$CommandUse$getCommand(commandName); #line 125 if (commandDesc == (void *)0 || commandDesc->params.numParams != params->numParams) { return FAIL; } #line 127 if (Command$Cmd$commandFunc(commandDesc->id, commandName, resultBuf, errorNo, params) != SUCCESS) { return FAIL; } #line 129 if (*errorNo == SCHEMA_ERROR) { return FAIL; } #line 131 return SUCCESS; } static #line 81 CommandDescPtr Command$CommandUse$getCommand(char *cmd) { short numCmds = Command$commandDescs.numCmds; short i; #line 86 for (i = 0; i < numCmds; i++) { if (strcasecmp(Command$commandDescs.commandDesc[i].name, cmd) == 0) { return &Command$commandDescs.commandDesc[i]; } } #line 91 return (void *)0; } static # 94 "d:/tinyos-1.x/tos/interfaces/SchemaType.h" short lengthOf(TOSType type, char *data) { short len = sizeOf(type); #line 98 if (type == STRING) { len = strlen(data) + 1; } #line 100 return len; } static # 110 "d:/tinyos-1.x/tos/system/LedsC.nc" result_t LedsC$Leds$redToggle(void) #line 110 { result_t rval; #line 112 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 112 { if (LedsC$ledsOn & LedsC$RED_BIT) { rval = LedsC$Leds$redOff(); } else { #line 116 rval = LedsC$Leds$redOn(); } } #line 118 __nesc_atomic_end(__nesc_atomic); } #line 118 return rval; } static #line 168 result_t LedsC$Leds$yellowToggle(void) #line 168 { result_t rval; #line 170 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 170 { if (LedsC$ledsOn & LedsC$YELLOW_BIT) { rval = LedsC$Leds$yellowOff(); } else { #line 174 rval = LedsC$Leds$yellowOn(); } } #line 176 __nesc_atomic_end(__nesc_atomic); } #line 176 return rval; } static # 2504 "d:/tinyos-1.x/tos/lib/TinyDB/DBBufferC.nc" TinyDBError DBBufferC$calcNextFreeRow(DBBufferC$Buffer *buf) #line 2504 { switch (buf->policy) { case EvictOldestPolicy: buf->nextFree++; if (buf->nextFree >= buf->numRows) { buf->nextFree = 0; } if (buf->nextFree == buf->nextFull) { buf->nextFull++; if (buf->nextFull >= buf->numRows) { buf->nextFull = 0; } } break; } return err_NoError; } static # 204 "d:/tinyos-1.x/tos/lib/TinyAlloc.nc" result_t TinyAlloc$MemAlloc$allocate(HandlePtr handlePtr, int16_t size) #line 204 { if (size > TinyAlloc$MAX_SIZE || TinyAlloc$mAllocing) { return FAIL; } TinyAlloc$mAllocing = 1; TinyAlloc$mSize = size + TinyAlloc$HEADER_SIZE; TinyAlloc$mHandle = handlePtr; TinyAlloc$mCompacted = 0; TinyAlloc$mNeedFree = 0; TinyAlloc$mContig = 0; TinyAlloc$mLast = 0; TinyAlloc$mStartByte = 0; TinyAlloc$mFreeBytes -= TinyAlloc$mSize; TOS_post(TinyAlloc$allocTask); return SUCCESS; } static void TinyAlloc$allocTask(void) #line 222 { int16_t endByte; int16_t i; #line 224 int16_t j; i = TinyAlloc$mLast++; if (i == TinyAlloc$FREE_SIZE) { if (TinyAlloc$mCompacted) { TinyAlloc$mAllocing = 0; if (TinyAlloc$mReallocing) { TinyAlloc$finish_realloc(TinyAlloc$mHandle, 0); } else { TinyAlloc$MemAlloc$allocComplete(TinyAlloc$mHandle, FAIL); } } else { TinyAlloc$mCompacted = 1; TOS_post(TinyAlloc$compactTask); } return; } if (TinyAlloc$mNeedFree && TinyAlloc$mFree[i] != 0xFF) { TinyAlloc$mStartByte = i << 3; for (j = 0; j < 8; j++) { if (TinyAlloc$mFree[i] & (1 << j)) { if (TinyAlloc$mContig >= TinyAlloc$mSize) { endByte = TinyAlloc$mStartByte + TinyAlloc$mSize; TinyAlloc$doAlloc(TinyAlloc$mStartByte, endByte); return; } else { TinyAlloc$mStartByte += TinyAlloc$mContig + 1; TinyAlloc$mContig = 0; } } else { TinyAlloc$mContig++; } } if (TinyAlloc$mContig >= TinyAlloc$mSize) { endByte = TinyAlloc$mStartByte + TinyAlloc$mSize; TinyAlloc$doAlloc(TinyAlloc$mStartByte, endByte); return; } else { TinyAlloc$mNeedFree = 0; } } else { #line 278 if (TinyAlloc$mNeedFree == 0) { if (TinyAlloc$mFree[i] == 0) { TinyAlloc$mContig += 8; } else { for (j = 0; j < 8; j++) { if ((TinyAlloc$mFree[i] & (1 << j)) == 0) { TinyAlloc$mContig++; } else { break; } } } if (TinyAlloc$mContig >= TinyAlloc$mSize) { endByte = TinyAlloc$mStartByte + TinyAlloc$mSize; TinyAlloc$doAlloc(TinyAlloc$mStartByte, endByte); return; } else { #line 300 if (TinyAlloc$mFree[i] != 0) { TinyAlloc$mContig = 0; TinyAlloc$mNeedFree = 1; TinyAlloc$mLast--; } } } } #line 306 TOS_post(TinyAlloc$allocTask); } static #line 539 int8_t TinyAlloc$finish_realloc(Handle *hand, int8_t success) #line 539 { if (success) { int8_t *p = * *hand; int8_t *q = *TinyAlloc$mOldHandle; int16_t cnt = TinyAlloc$getSize(*TinyAlloc$mOldHandle); while (cnt--) { * p++ = * q++; } TinyAlloc$setFreeBits(TinyAlloc$start_offset(*TinyAlloc$mOldHandle), TinyAlloc$start_offset(*TinyAlloc$mOldHandle) + TinyAlloc$getSize(*TinyAlloc$mOldHandle), 0); TinyAlloc$remapAddr(*TinyAlloc$mOldHandle, * *hand); TinyAlloc$markHandleFree(*hand); TinyAlloc$mReallocing = 0; TinyAlloc$MemAlloc$reallocComplete(TinyAlloc$mOldHandle, SUCCESS); } else { TinyAlloc$mReallocing = 0; TinyAlloc$MemAlloc$reallocComplete(TinyAlloc$mOldHandle, FAIL); return FAIL; } return SUCCESS; } static #line 683 void TinyAlloc$setFreeBits(int16_t startByte, int16_t endByte, int8_t on) #line 683 { int16_t leadInBits = startByte - ((startByte >> 3) << 3); int16_t leadOutBits = endByte - ((endByte >> 3) << 3); int16_t i; int16_t startFree = startByte >> 3; int16_t endFree = endByte >> 3; { } #line 690 ; if (startFree == endFree) { leadInBits = 8; } if (on) { for (i = leadInBits; i < 8; i++) { TinyAlloc$mFree[startFree] |= 1 << i; } for (i = 0; i < leadOutBits; i++) { TinyAlloc$mFree[endFree] |= 1 << i; } startFree++; for (i = startFree; i < endFree; i++) { TinyAlloc$mFree[i] = 0xFF; } } else #line 707 { for (i = leadInBits; i < 8; i++) { TinyAlloc$mFree[startFree] &= 0xFF ^ (1 << i); } for (i = 0; i < leadOutBits; i++) { TinyAlloc$mFree[endFree] &= 0xFF ^ (1 << i); } startFree++; for (i = startFree; i < endFree; i++) { TinyAlloc$mFree[i] = 0x00; } } } static #line 632 void TinyAlloc$remapAddr(int8_t *oldAddr, int8_t *newAddr) #line 632 { int16_t i; #line 634 for (i = 0; i < TinyAlloc$MAX_HANDLES; i++) { if (TinyAlloc$mHandles[i] == oldAddr) { TinyAlloc$mHandles[i] = newAddr; } } } static #line 665 void TinyAlloc$markHandleFree(Handle hand) #line 665 { int i; #line 667 for (i = 0; i < TinyAlloc$MAX_HANDLES; i++) { if (&TinyAlloc$mHandles[i] == hand) { TinyAlloc$mHandles[i] = 0; break; } } } static # 395 "d:/tinyos-1.x/tos/lib/TinyDB/AggOperator.nc" result_t AggOperator$MemAlloc$reallocComplete(Handle h, uint8_t success) #line 395 { AggOperator$GroupRecord *newGroup; if (h != (Handle )AggOperator$mAlloced) { #line 399 return SUCCESS; } #line 400 AggOperator$mAlloced = (void *)0; { } #line 401 ; if (!success) { if (!AggOperator$removeEmptyGroup((AggOperator$GroupDataHandle )h)) { { } #line 405 ; AggOperator$signalError(err_OutOfMemory, 406); } } newGroup = AggOperator$addGroup((AggOperator$GroupDataHandle )h, AggOperator$mCurGroup); AggOperator$initAggregateValue(newGroup, AggOperator$mCurExpr, TRUE); (*AggOperator$mCallback)(newGroup); return SUCCESS; } static #line 153 void AggOperator$SET_GROUP_DATA(AggOperator$GroupDataHandle dHan, uint8_t n, char *dataptr) #line 153 { nmemcpy(AggOperator$GET_GROUP_DATA(dHan, n), (const char *)dataptr, (*dHan)->groupSize); } static # 3264 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$signalError(TinyDBError err, int lineNo) #line 3264 { char errStr[sizeof(TOS_Msg )]; char errNo[10]; #line 3266 char lineNoStr[10]; errStr[0] = 0; itoa(err, errNo, 10); itoa(lineNo, lineNoStr, 10); #line 3310 strcat(errStr, "Err: "); strcat(errStr, errNo); strcat(errStr, "(L:"); strcat(errStr, lineNoStr); strcat(errStr, ")"); strcat(errStr, "\0"); TupleRouterM$statusMessage(errStr); } static # 474 "d:/tinyos-1.x/tos/lib/TinyDB/AggOperator.nc" AggOperator$GroupRecord *AggOperator$addGroup(AggOperator$GroupDataHandle dh, short groupNum) #line 474 { short i; bool shift = FALSE; #line 476 bool first = FALSE; AggOperator$GroupRecord *gr; #line 477 AggOperator$GroupRecord lastgr; #line 477 AggOperator$GroupRecord newgr; #line 477 AggOperator$GroupRecord tempgr; #line 477 AggOperator$GroupRecord *ret = (void *)0; newgr.groupNo = groupNum; (*dh)->numGroups++; for (i = 0; i < (*dh)->numGroups; i++) { gr = AggOperator$GET_GROUP_DATA(dh, i); if ((!shift && gr->groupNo > groupNum) || i + 1 == (*dh)->numGroups) { lastgr = newgr; shift = TRUE; first = TRUE; } if (shift) { tempgr = *gr; AggOperator$SET_GROUP_DATA(dh, i, (char *)&lastgr); lastgr = tempgr; if (first) { first = FALSE; ret = AggOperator$GET_GROUP_DATA(dh, i); } } } if (ret == (void *)0) { { } #line 507 ; } return ret; } static #line 649 void AggOperator$initAggregateValue(AggOperator$GroupRecord *d, Expr *e, bool isFirstTime) #line 649 { ParamVals paramVals; #line 651 setParamValues(¶mVals, e); d->u.empty = TRUE; AggOperator$AggregateUse$init(e->ex.agg.op, d->aggdata, (void *)0, ¶mVals, isFirstTime); } static # 3188 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" result_t TupleRouterM$MemAlloc$reallocComplete(Handle handle, result_t complete) #line 3188 { { } #line 3189 ; if (TupleRouterM$mAllocState == TupleRouterM$STATE_NOT_ALLOCING) { #line 3191 return SUCCESS; } #line 3192 if (TupleRouterM$mAllocState == TupleRouterM$STATE_RESIZE_QUERY) { TupleRouterM$mAllocState = TupleRouterM$STATE_NOT_ALLOCING; { } #line 3195 ; TupleRouterM$mTmpHandle = handle; if (complete) { (*TupleRouterM$mAllocCallback)(&TupleRouterM$mTmpHandle); } else { #line 3203 TupleRouterM$signalError(err_OutOfMemory, 3203); } } else { #line 3206 TupleRouterM$signalError(err_UnknownAllocationState, 3206); } #line 3207 return SUCCESS; } static # 2329 "d:/tinyos-1.x/tos/lib/TinyDB/DBBufferC.nc" result_t DBBufferC$MemAlloc$reallocComplete(Handle handle, result_t success) #line 2329 { if (DBBufferC$mState != DBBufferC$kIDLE && handle == DBBufferC$mCurRowHandle) { return DBBufferC$MemAlloc$allocComplete(&DBBufferC$mCurRowHandle, success); } else { #line 2333 return SUCCESS; } } static #line 2146 result_t DBBufferC$MemAlloc$allocComplete(HandlePtr handle, result_t success) #line 2146 { Handle *bufList; if (DBBufferC$mState == DBBufferC$kIDLE || DBBufferC$mState == DBBufferC$kREAD_ROW) { return SUCCESS; } if (success) { switch (DBBufferC$mState) { case DBBufferC$kALLOC_SCHEMA: nmemcpy(* *handle, (char *)DBBufferC$mAllocSchema, DBBufferC$ParsedQueryIntf$pqSize(DBBufferC$mAllocSchema)); DBBufferC$mState = DBBufferC$kALLOC_BUFFER; switch (DBBufferC$mBuffers[DBBufferC$mCurBuffer].type) { case kRAM: if (DBBufferC$MemAlloc$allocate((HandlePtr )& DBBufferC$mBuffers[DBBufferC$mCurBuffer].u.bufdata, DBBufferC$mBuffers[DBBufferC$mCurBuffer].len) == FAIL) { DBBufferC$mState = DBBufferC$kIDLE; DBBufferC$cleanupBuffer(DBBufferC$mCurBuffer, 2167); DBBufferC$DBBuffer$allocComplete(DBBufferC$mCurBuffer, err_UnknownError); } break; case kEEPROM: #line 2183 { DBBufferC$Buffer *buf = &DBBufferC$mBuffers[DBBufferC$mCurBuffer]; DBBufferC$mState = DBBufferC$kALLOC_NAME; buf->u.eeprom.isOpen = TRUE; buf->u.eeprom.isWrite = TRUE; if (DBBufferC$MemAlloc$allocate((HandlePtr )& DBBufferC$mBuffers[DBBufferC$mCurBuffer].name, strlen(DBBufferC$mNamePtr) + 1) == FAIL) { DBBufferC$mState = DBBufferC$kIDLE; DBBufferC$cleanupBuffer(DBBufferC$mCurBuffer, 2194); DBBufferC$DBBuffer$allocComplete(DBBufferC$mCurBuffer, err_OutOfMemory); } } break; default: break; } break; case DBBufferC$kEEPROM_ALLOC_ROW: { DBBufferC$Buffer *buf = &DBBufferC$mBuffers[DBBufferC$mCurBuffer]; DBBufferC$MemAlloc$lock(*handle); DBBufferC$QueryResultIntf$toBytes(DBBufferC$mCurResult, * buf->qh, (char *)* *handle + 1); (* *handle)[0] = (char )(DBBufferC$MemAlloc$size(*handle) - 1); DBBufferC$mState = DBBufferC$kEEPROM_WRITE; DBBufferC$MemAlloc$unlock(*handle); DBBufferC$mState = DBBufferC$kIDLE; DBBufferC$cleanupBuffer(DBBufferC$mCurBuffer, 2223); DBBufferC$DBBuffer$putComplete(DBBufferC$mCurBuffer, DBBufferC$mCurResult, err_EepromFailure); } break; case DBBufferC$kALLOC_BUFFER: nmemset(* *handle, 0, DBBufferC$mBuffers[DBBufferC$mCurBuffer].len); if (DBBufferC$mNamePtr != (void *)0) { DBBufferC$mState = DBBufferC$kALLOC_NAME; if (DBBufferC$MemAlloc$allocate((HandlePtr )& DBBufferC$mBuffers[DBBufferC$mCurBuffer].name, strlen(DBBufferC$mNamePtr) + 1) == FAIL) { DBBufferC$mState = DBBufferC$kIDLE; DBBufferC$cleanupBuffer(DBBufferC$mCurBuffer, 2235); DBBufferC$DBBuffer$allocComplete(DBBufferC$mCurBuffer, err_UnknownError); } } else #line 2238 { DBBufferC$mState = DBBufferC$kIDLE; DBBufferC$mUsedBufs |= 1 << DBBufferC$mCurBuffer; DBBufferC$DBBuffer$allocComplete(DBBufferC$mCurBuffer, err_NoError); } break; case DBBufferC$kALLOC_NAME: DBBufferC$mUsedBufs |= 1 << DBBufferC$mCurBuffer; strcpy(* DBBufferC$mBuffers[DBBufferC$mCurBuffer].name, DBBufferC$mNamePtr); DBBufferC$mState = DBBufferC$kIDLE; DBBufferC$DBBuffer$allocComplete(DBBufferC$mCurBuffer, err_NoError); break; case DBBufferC$kALLOC_ROW: { DBBufferC$Buffer *buf = &DBBufferC$mBuffers[DBBufferC$mCurBuffer]; #line 2262 bufList = (Handle *)* buf->u.bufdata; bufList[DBBufferC$mCurRow] = *handle; DBBufferC$MemAlloc$lock(*handle); DBBufferC$QueryResultIntf$toBytes(DBBufferC$mCurResult, * buf->qh, (char *)* *handle); DBBufferC$MemAlloc$unlock(*handle); DBBufferC$mState = DBBufferC$kIDLE; DBBufferC$DBBuffer$putComplete(DBBufferC$mCurBuffer, DBBufferC$mCurResult, err_NoError); } break; #line 2289 default: break; } } else #line 2292 { switch (DBBufferC$mState) { case DBBufferC$kALLOC_BUFFER: case DBBufferC$kALLOC_SCHEMA: case DBBufferC$kALLOC_NAME: DBBufferC$cleanupBuffer(DBBufferC$mCurBuffer, 2298); DBBufferC$DBBuffer$allocComplete(DBBufferC$mCurBuffer, err_UnknownError); break; case DBBufferC$kALLOC_ROW: DBBufferC$cleanupBuffer(DBBufferC$mCurBuffer, 2304); DBBufferC$DBBuffer$putComplete(DBBufferC$mCurBuffer, DBBufferC$mCurResult, err_UnknownError); break; case DBBufferC$kALLOC_FOR_READ: DBBufferC$DBBuffer$getComplete(DBBufferC$mCurBuffer, DBBufferC$mCurResult, err_OutOfMemory); break; default: break; } DBBufferC$mState = DBBufferC$kIDLE; } return SUCCESS; } static # 122 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQuery.nc" short ParsedQuery$ParsedQueryIntf$pqSize(ParsedQueryPtr pq) #line 122 { return sizeof(ParsedQuery ) + sizeof(char ) * (pq->numFields - 1) + sizeof(Expr ) * pq->numExprs; } static # 2554 "d:/tinyos-1.x/tos/lib/TinyDB/DBBufferC.nc" void DBBufferC$cleanupBuffer(int b, int lineNo) #line 2554 { DBBufferC$Buffer *buf = &DBBufferC$mBuffers[b]; { } #line 2558 ; DBBufferC$mUsedBufs &= 0xFFFFFFFF ^ (1 << b); if (buf->type == kRAM) { uint16_t i; #line 2573 if (buf->u.bufdata != (void *)0) { Handle *bufList = (Handle *)* buf->u.bufdata; #line 2575 for (i = 0; i < buf->numRows; i++) { if (bufList[i] != (void *)0) { DBBufferC$MemAlloc$free((Handle )bufList[i]); } } DBBufferC$MemAlloc$free((Handle )buf->u.bufdata); } } else { #line 2582 if (buf->type == kEEPROM) { if (buf->u.eeprom.isOpen) { buf->u.eeprom.isOpen = FALSE; } if (DBBufferC$mEepromRow != (void *)0) { DBBufferC$MemAlloc$free((Handle )DBBufferC$mEepromRow); DBBufferC$mEepromRow = (void *)0; } } } if (buf->qh != (void *)0) { DBBufferC$MemAlloc$free((Handle )buf->qh); } if (buf->name != (void *)0) { DBBufferC$MemAlloc$free((Handle )buf->name); } } static # 455 "d:/tinyos-1.x/tos/lib/TinyAlloc.nc" int16_t TinyAlloc$MemAlloc$free(Handle hand) #line 455 { int8_t *startPtr; int16_t start; int16_t end; if (TinyAlloc$mAllocing) { #line 460 return FAIL; } if (!TinyAlloc$isValid(hand)) { #line 462 return FAIL; } if (sizeof(int8_t *) == sizeof(int16_t )) { startPtr = TinyAlloc$deref(hand) - TinyAlloc$HEADER_SIZE; start = (int16_t )(startPtr - (int8_t *)&TinyAlloc$mFrame); end = start + TinyAlloc$getSize(TinyAlloc$deref(hand)); } else { if (sizeof(int8_t *) == sizeof(int32_t )) { startPtr = TinyAlloc$deref(hand) - TinyAlloc$HEADER_SIZE; start = (int16_t )(startPtr - (int8_t *)&TinyAlloc$mFrame); end = start + TinyAlloc$getSize(TinyAlloc$deref(hand)); } else { return FAIL; } } TinyAlloc$mFreeBytes += TinyAlloc$getSize(TinyAlloc$deref(hand)); TinyAlloc$setFreeBits(start, end, 0); TinyAlloc$markHandleFree(hand); return end - start; } static # 1215 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$removeQueryTask(void) #line 1215 { TupleRouterM$QueryListHandle curq; TupleRouterM$QueryListHandle last = (void *)0; if (( #line 1220 !TupleRouterM$mForceRemove && (((TupleRouterM$IS_FETCHING_ATTRIBUTE() || TupleRouterM$IS_ROUTING_TUPLES()) || TupleRouterM$IS_DELIVERING_TUPLES()) || TupleRouterM$IS_SENDING_MESSAGE())) || TupleRouterM$IS_STARTING_ATTRIBUTE()) { TupleRouterM$signalError(err_RemoveFailedRouterBusy, 1222); } curq = TupleRouterM$mQs; while (curq != (void *)0) { if ((*curq)->q.qid == TupleRouterM$mQidToRemove) { if (TupleRouterM$IS_SENDING_QUERY() && TupleRouterM$mCurSendingQuery == curq) { TupleRouterM$signalError(err_RemoveFailedRouterBusy, 1231); } if (last != (void *)0) { (*last)->next = (*curq)->next; } else #line 1235 { TupleRouterM$mQs = (TupleRouterM$QueryListHandle )(*curq)->next; } if (TupleRouterM$mTail == curq) { TupleRouterM$mTail = last; } #line 1241 if (TupleRouterM$mQs == (void *)0) { TupleRouterM$mIsRunning = FALSE; TupleRouterM$UNSET_SNOOZING(); TupleRouterM$ServiceScheduler$remove(kTINYDB_SERVICE_ID); TupleRouterM$mOldRate = 0; TupleRouterM$Leds$redOff(); TupleRouterM$Leds$yellowOff(); TupleRouterM$Leds$greenOff(); } #line 1273 { } #line 1273 ; TupleRouterM$QueryProcessor$queryComplete(& (*curq)->q); TupleRouterM$MemAlloc$free((Handle )curq); return; } else #line 1277 { last = curq; curq = (TupleRouterM$QueryListHandle )(*curq)->next; } } } static # 96 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQuery.nc" Expr ParsedQuery$ParsedQueryIntf$getExpr(ParsedQueryPtr q, uint8_t n) #line 96 { return * (Expr *)&((char *)q)[sizeof(ParsedQuery ) + (q->numFields - 1) * sizeof(char ) + n * sizeof(Expr )]; } static # 1186 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$finishedOpeningWriteBuffer(ParsedQuery *pq) #line 1186 { { } #line 1188 ; if (!TupleRouterM$ParsedQueryIntf$typeCheck(*TupleRouterM$DBBuffer$getSchema(pq->bufferId), pq)) { goto fail; } else #line 1193 { } { } #line 1196 ; TupleRouterM$finishedBufferSetup(pq); return; fail: TupleRouterM$failedOpeningWriteBuffer(pq); return; } static # 291 "d:/tinyos-1.x/tos/lib/TinyDB/ParsedQuery.nc" result_t ParsedQuery$ParsedQueryIntf$getFieldType(ParsedQuery *pq, uint8_t fieldIdx, uint8_t *type) #line 292 { AttrDescPtr attr; if (fieldIdx >= pq->numFields || ParsedQuery$ParsedQueryIntf$queryFieldIsNull(pq->queryToSchemaFieldMap[fieldIdx])) { #line 296 return FAIL; } if (ParsedQuery$ParsedQueryIntf$queryFieldIsTyped(pq->queryToSchemaFieldMap[fieldIdx])) { result_t success; success = ParsedQuery$Table$getType(pq, fieldIdx, type); return success; } if (pq->fromBuffer != kNO_QUERY) { uint8_t bufId; uint8_t fid = pq->queryToSchemaFieldMap[fieldIdx]; TinyDBError err = ParsedQuery$DBBuffer$getBufferId(pq->fromBuffer, pq->fromCatalogBuffer, &bufId); ParsedQuery **fromSchema; #line 317 if (err != err_NoError) { #line 317 return FAIL; } #line 318 fromSchema = ParsedQuery$DBBuffer$getSchema(bufId); if (ParsedQuery$ParsedQueryIntf$queryFieldIsNull((*fromSchema)->queryToSchemaFieldMap[fid])) { #line 319 return FAIL; } attr = ParsedQuery$AttrUse$getAttrById((*fromSchema)->queryToSchemaFieldMap[fid]); } else { attr = ParsedQuery$AttrUse$getAttrById(pq->queryToSchemaFieldMap[fieldIdx]); } if (attr != (void *)0) { *type = attr->type; return SUCCESS; } else { #line 331 return FAIL; } } static # 981 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$finishedBufferSetup(ParsedQuery *pq) #line 981 { TupleRouterM$SET_STARTING_ATTRIBUTE(); TupleRouterM$mNumAttrs += pq->numFields; TupleRouterM$startQueryAttrs(pq); TupleRouterM$setSampleRate(); TupleRouterM$UNSET_READING_QUERY(); TupleRouterM$UNSET_PARSING_QUERY(); } static #line 516 void TupleRouterM$startQueryAttrs(ParsedQuery *pq) { short i; #line 519 for (i = 0; i < pq->numFields; i++) { if (TupleRouterM$AttrUse$startAttr(pq->queryToSchemaFieldMap[i]) == FAIL) { TupleRouterM$mNumAttrs--; } } } static # 141 "d:/tinyos-1.x/tos/lib/TinyDB/QueryResult.nc" TinyDBError QueryResult$QueryResultIntf$toBytes(QueryResultPtr qr, ParsedQueryPtr pq, CharPtr bytes) #line 141 { short size = sizeof(QueryResult ) - sizeof qr->d; char *p; #line 143 char *q; if ( #line 146 qr->qrType != kIS_AGG && qr->qrType != kNOT_AGG && qr->qrType != kAGG_SINGLE_FIELD) { return err_UnknownError; } if (qr->qrType != kIS_AGG) { size += QueryResult$TupleIntf$tupleSize(pq); } q = (char *)bytes; p = (char *)qr; while (size--) * q++ = * p++; if (qr->qrType == kIS_AGG) { short i; #line 162 for (i = 0; i < qr->result_idx; i++) { * (int16_t *)q = qr->d.buf[i].group; q += sizeof(int16_t ); size = QueryResult$BUF_SIZE; p = qr->d.buf[i].data; while (size--) * q++ = * p++; } } return err_NoError; } static # 601 "d:/tinyos-1.x/tos/lib/TinyAlloc.nc" int16_t TinyAlloc$MemAlloc$size(Handle h) #line 601 { return TinyAlloc$getSize(*h) - TinyAlloc$HEADER_SIZE; } static # 2575 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$fillInAttrVal(SchemaErrorNo errorNo) { ParsedQuery *pq = TupleRouterM$mLastQuery; char *resultBuf; TinyDBError err; if (pq->fromBuffer == kNO_QUERY) { short id = TupleRouterM$mFetchingFieldId; short i; TupleRouterM$QueryListHandle qlh = TupleRouterM$mQs; resultBuf = TupleRouterM$mResultBuf; { } #line 2588 ; while (qlh != (void *)0) { ParsedQuery *q = & (*qlh)->q; #line 2592 if (q->clocksPerSample > 0 && q->clockCount <= 0 && q->fromBuffer == kNO_QUERY) { Tuple *t = TupleRouterM$ParsedQueryIntf$getTuplePtr(q); #line 2595 for (i = 0; i < q->numFields; i++) { if (q->queryToSchemaFieldMap[i] == id) { TupleRouterM$TupleIntf$setField(q, t, i, resultBuf); { } #line 2599 ; } } } qlh = (TupleRouterM$QueryListHandle )(*qlh)->next; } } else { Tuple *t = TupleRouterM$ParsedQueryIntf$getTuplePtr(pq); uint8_t bufId; resultBuf = TupleRouterM$TupleIntf$getFieldPtr(pq, t, TupleRouterM$mCurTupleIdx); if (resultBuf == (void *)0) { return; } err = TupleRouterM$DBBuffer$getBufferId(pq->fromBuffer, pq->fromCatalogBuffer, &bufId); if (err != err_NoError) { TupleRouterM$signalError(err, 2619); return; } err = TupleRouterM$DBBuffer$getField(bufId, &TupleRouterM$mResult, pq->queryToSchemaFieldMap[TupleRouterM$mCurTupleIdx], resultBuf); if (err != err_NoError) { TupleRouterM$signalError(err, 2628); return; } TupleRouterM$TupleIntf$setField(pq, t, TupleRouterM$mCurTupleIdx, resultBuf); } TupleRouterM$keepRouting(); } static # 170 "d:/tinyos-1.x/tos/lib/TinyDB/Tuple.nc" result_t Tuple$TupleIntf$setField(ParsedQueryPtr q, TuplePtr t, uint8_t fieldIdx, CharPtr data) #line 170 { char *dest = Tuple$TupleIntf$getFieldPtr(q, t, fieldIdx); #line 172 if (dest == (void *)0) { #line 172 return FAIL; } #line 173 if (dest != data) { nmemcpy(dest, data, Tuple$TupleIntf$fieldSize(q, fieldIdx)); } #line 175 t->notNull |= 1 << fieldIdx; return SUCCESS; } static #line 202 CharPtr Tuple$TupleIntf$getFieldPtr(ParsedQueryPtr q, TuplePtr t, uint8_t fieldIdx) #line 202 { short i; short offset = 0; if (Tuple$TupleIntf$fieldSize(q, fieldIdx) == 0) { #line 207 return (void *)0; } #line 208 for (i = 0; i < fieldIdx; i++) { offset += Tuple$TupleIntf$fieldSize(q, i); } return (char *)&t->fields[offset]; } static CharPtr Tuple$TupleIntf$getFieldPtrNoQuery(TuplePtr t, uint8_t fieldIdx, uint8_t numFields, uint8_t sizes[], uint8_t types[]) #line 223 { short i; short offset = 0; #line 226 for (i = 0; i < fieldIdx; i++) { offset += Tuple$typeToSize(types[i]); } return (char *)&t->fields[offset]; } static # 2412 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" bool TupleRouterM$fetchNextAttr(void) #line 2412 { AttrDescPtr queryField; TupleRouterM$TupleFieldDesc fieldDesc; SchemaErrorNo errorNo; ParsedQuery *q; short i; #line 2417 short fieldId = -1; bool pending; TinyDBError tdberr; uint8_t bufId; { } #line 2422 ; fieldDesc = TupleRouterM$getNextQueryField(&q); if (fieldDesc.isNull == FALSE) { if (q->fromBuffer != kNO_QUERY) { TupleRouterM$mCurTupleIdx = fieldDesc.u.tupleIdx; if (TupleRouterM$mLastQuery == (void *)0 || TupleRouterM$mLastQuery != q) { TupleRouterM$mLastQuery = q; tdberr = TupleRouterM$DBBuffer$getBufferId(q->fromBuffer, q->fromCatalogBuffer, &bufId); if (tdberr != err_NoError) { TupleRouterM$signalError(tdberr, 2439); return FALSE; } if (q->epochDuration == kONE_SHOT) { tdberr = TupleRouterM$DBBuffer$getResult(bufId, q->curResult, &TupleRouterM$mResult, &pending); } else #line 2444 { tdberr = TupleRouterM$DBBuffer$peek(bufId, &TupleRouterM$mResult, &pending); } if (tdberr == err_ResultBufferBusy) { TupleRouterM$signalError(tdberr, 2449); return TRUE; } if (tdberr != err_NoError) { TupleRouterM$signalError(tdberr, 2453); return FALSE; } if (!pending) { #line 2457 TOS_post(TupleRouterM$fillInTask); } } else #line 2459 { TOS_post(TupleRouterM$fillInTask); } return TRUE; } else { #line 2463 if (q->fromBuffer == kNO_QUERY) { queryField = fieldDesc.u.attr; TupleRouterM$mFetchingFieldId = queryField->idx; TupleRouterM$SET_FETCHING_ATTRIBUTE(); TupleRouterM$mLastQuery = q; for (i = 0; i < q->numFields; i++) { if (q->queryToSchemaFieldMap[i] == queryField->idx) { fieldId = i; } } #line 2482 if (fieldId != -1) { TupleRouterM$mResultBuf = TupleRouterM$TupleIntf$getFieldPtr(q, TupleRouterM$ParsedQueryIntf$getTuplePtr(q), fieldId); if ( #line 2485 TupleRouterM$AttrUse$getAttrValue(queryField->name, TupleRouterM$mResultBuf, &errorNo) == SUCCESS) { if (errorNo != SCHEMA_RESULT_PENDING) { TOS_post(TupleRouterM$fillInTask); } if (errorNo != SCHEMA_ERROR) { return TRUE; } } } } } } else #line 2497 { } TupleRouterM$mLastQuery = (void *)0; return FALSE; } static # 272 "d:/tinyos-1.x/tos/lib/TinyDB/Tuple.nc" TinyDBError Tuple$TupleIntf$getNextEmptyFieldIdx(ParsedQueryPtr q, TuplePtr t, uint8_t *fieldIdx) #line 272 { short i; for (i = 0; i < q->numFields; i++) { if (!Tuple$ParsedQueryIntf$queryFieldIsNull(q->queryToSchemaFieldMap[i]) && ( t->notNull & (1 << i)) == 0) { *fieldIdx = i; return err_NoError; } } return err_NoMoreResults; } static # 939 "d:/tinyos-1.x/tos/lib/TinyDB/DBBufferC.nc" TinyDBError DBBufferC$DBBuffer$size(uint8_t bufferId, uint16_t *size) #line 939 { DBBufferC$Buffer *buf; TinyDBError err = err_NoError; switch (bufferId) { case DBBufferC$kATTR_BUF: *size = DBBufferC$AttrUse$numAttrs(); return err_NoError; default: err = DBBufferC$getBuf(bufferId, &buf); if (err != err_NoError) { #line 950 return err; } if (buf->nextFull == buf->nextFree) { *size = 0; } else { #line 955 if (buf->nextFull > buf->nextFree) { *size = buf->numRows - buf->nextFull + buf->nextFree; } else #line 957 { *size = buf->nextFree - buf->nextFull; } } #line 960 break; } return err_NoError; } static # 189 "d:/tinyos-1.x/tos/lib/TinyDB/QueryResult.nc" TinyDBError QueryResult$QueryResultIntf$fromBytes(QueryResultPtr bytes, QueryResultPtr qr, ParsedQueryPtr pq) #line 189 { short size = sizeof(QueryResult ) - sizeof qr->d; char *p; #line 191 char *q; q = (char *)qr; p = (char *)bytes; while (size--) * q++ = * p++; if (qr->qrType == kIS_AGG) { short i; for (i = 0; i < qr->result_idx; i++) { qr->d.buf[i].group = * (uint16_t *)p; p += sizeof(uint16_t ); qr->d.buf[i].data = p; p += QueryResult$BUF_SIZE; } } else { size = qr->qrType == kAGG_SINGLE_FIELD ? sizeof qr->d : QueryResult$TupleIntf$tupleSize(pq); while (size--) * q++ = * p++; } return err_NoError; } static # 164 "d:/tinyos-1.x/tos/platform/mica2/ADCM.nc" result_t ADCM$startGet(uint8_t newState, uint8_t port) #line 164 { uint16_t PortMask; #line 165 uint16_t oldReqVector = 1; result_t Result = SUCCESS; if (port > TOSH_ADC_PORTMAPSIZE) { return FAIL; } PortMask = 1 << port; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 174 { if ((PortMask & ADCM$ReqVector) != 0) { Result = FAIL; } else { oldReqVector = ADCM$ReqVector; ADCM$ReqVector |= PortMask; if (newState == ADCM$CONTINUOUS_CONVERSION) { ADCM$ContReqMask |= PortMask; } if (oldReqVector == 0) { ADCM$ReqPort = port; } } } #line 190 __nesc_atomic_end(__nesc_atomic); } if (oldReqVector == 0) { Result = ADCM$HPLADC$samplePort(port); } return Result; } static # 150 "d:/tinyos-1.x/tos/platform/mica2/HPLADCM.nc" result_t HPLADCM$ADC$samplePort(uint8_t port) #line 150 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 151 { * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x07 + 0x20) = HPLADCM$TOSH_adc_portmap[port] & 0x1F; } #line 153 __nesc_atomic_end(__nesc_atomic); } * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x06 + 0x20) |= 1 << 7; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x06 + 0x20) |= 1 << 3; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x06 + 0x20) |= 1 << 6; return SUCCESS; } static # 2786 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" short TupleRouterM$QueryProcessor$numQueries(void) #line 2786 { TupleRouterM$QueryListHandle curq; short count = 0; curq = TupleRouterM$mQs; while (curq != (void *)0) { count++; curq = (TupleRouterM$QueryListHandle )(*curq)->next; } return count; } static ParsedQueryPtr TupleRouterM$QueryProcessor$getQueryIdx(short i) #line 2799 { TupleRouterM$QueryListHandle curq; curq = TupleRouterM$mQs; while (curq != (void *)0) { if (i-- == 0) { #line 2804 return & (*curq)->q; } #line 2805 curq = (TupleRouterM$QueryListHandle )(*curq)->next; } return (void *)0; } static #line 2670 void TupleRouterM$routeTask(void) #line 2670 { if (TupleRouterM$mCurRouteQuery != (void *)0) { ParsedQuery *q = & (*TupleRouterM$mCurRouteQuery)->q; #line 2673 if (!TupleRouterM$routeToQuery(q, TupleRouterM$mCurTuple)) { TupleRouterM$mCurRouteQuery = TupleRouterM$nextQueryToRoute(TupleRouterM$mCurRouteQuery); TOS_post(TupleRouterM$routeTask); } } else #line 2678 { TupleRouterM$UNSET_ROUTING_TUPLES(); } } static # 514 "d:/tinyos-1.x/tos/lib/TinyDB/AggOperator.nc" void AggOperator$getGroupData(ParsedQuery *pq, short groupNo, Expr *e, AggOperator$GroupDataCallback callback) #line 514 { AggOperator$GroupDataHandle dh = (AggOperator$GroupDataHandle )e->opState; AggOperator$mCallback = callback; AggOperator$mCurExpr = e; AggOperator$mCurQuery = pq; AggOperator$mCurGroup = groupNo; { } #line 522 ; if (dh == (void *)0) { AggOperator$mAlloced = (Handle )& e->opState; if (AggOperator$MemAlloc$allocate((HandlePtr )& e->opState, AggOperator$groupSize(e) + sizeof(AggOperator$GroupData )) == FAIL) { AggOperator$MemAlloc$allocComplete((Handle *)& e->opState, FALSE); } } else #line 530 { AggOperator$GroupRecord *gr; gr = AggOperator$findGroup(dh, groupNo); AggOperator$mGroupRecord = gr; if (gr != (void *)0) { ( #line 537 *callback)(gr); } else #line 538 { AggOperator$mAlloced = (Handle )e->opState; if (AggOperator$MemAlloc$reallocate((Handle )e->opState, AggOperator$groupSize(e) * ((*dh)->numGroups + 1) + sizeof(AggOperator$GroupData )) == FAIL) { AggOperator$MemAlloc$reallocComplete((Handle )e->opState, FALSE); } } } } static #line 602 short AggOperator$groupSize(Expr *e) #line 602 { AggOperator$GroupRecord g; short base; ParamVals paramVals; #line 607 setParamValues(¶mVals, e); base = sizeof g - sizeof g.aggdata[0]; return base + AggOperator$AggregateUse$stateSize(e->ex.agg.op, (void *)0, ¶mVals); } static #line 371 result_t AggOperator$MemAlloc$allocComplete(HandlePtr h, uint8_t success) #line 371 { AggOperator$GroupDataHandle dh = (AggOperator$GroupDataHandle )*h; AggOperator$GroupRecord *newGroup; if (h != (Handle *)AggOperator$mAlloced) { #line 375 return SUCCESS; } #line 376 AggOperator$mAlloced = (void *)0; { } #line 377 ; if (!success) { { } #line 379 ; AggOperator$signalError(err_OutOfMemory, 380); return FAIL; } { } #line 383 ; (*dh)->groupSize = AggOperator$groupSize(AggOperator$mCurExpr); (*dh)->numGroups = 0; newGroup = AggOperator$addGroup(dh, AggOperator$mCurGroup); AggOperator$initAggregateValue(newGroup, AggOperator$mCurExpr, TRUE); (*AggOperator$mCallback)(newGroup); return SUCCESS; } static # 491 "d:/tinyos-1.x/tos/lib/TinyAlloc.nc" result_t TinyAlloc$MemAlloc$reallocate(Handle hand, int16_t newSize) #line 491 { int16_t neededBytes = newSize + TinyAlloc$HEADER_SIZE; int8_t *p = *hand; if (TinyAlloc$mAllocing) { #line 495 return FAIL; } #line 496 if (neededBytes > TinyAlloc$MAX_SIZE) { #line 496 return FAIL; } TinyAlloc$mOldHandle = hand; if (neededBytes == TinyAlloc$getSize(*hand)) { TOS_post(TinyAlloc$reallocDone); return SUCCESS; } if (neededBytes < TinyAlloc$getSize(*hand)) { int16_t oldSize = TinyAlloc$getSize(*hand); ( (int16_t *)(p - TinyAlloc$HEADER_SIZE))[0] = neededBytes & 0x7FFF; TinyAlloc$setFreeBits(TinyAlloc$start_offset(p) + neededBytes, TinyAlloc$start_offset(p) + oldSize, 0); TinyAlloc$mFreeBytes -= neededBytes; TinyAlloc$mFreeBytes += TinyAlloc$getSize(*hand); TOS_post(TinyAlloc$reallocDone); return SUCCESS; } else { #line 521 if (neededBytes > TinyAlloc$getSize(*hand) && !TinyAlloc$isLocked(*hand)) { TinyAlloc$mReallocing = 1; TinyAlloc$mFreeBytes += TinyAlloc$getSize(*hand); return TinyAlloc$MemAlloc$allocate(&TinyAlloc$mTmpHandle, newSize); } } #line 530 return FAIL; } static # 101 "d:/tinyos-1.x/tos/lib/TinyDB/ExprEvalC.nc" short ExprEvalC$evaluateSimpleExpr(short a, short op, short b) #line 101 { switch (op) { case FOP_NOOP: break; case FOP_TIMES: return a * b; case FOP_DIVIDE: return a / b; case FOP_ADD: return a + b; case FOP_SUBTRACT: return a - b; case FOP_MOD: return a % b; case FOP_RSHIFT: return a >> b; } return a; } static # 187 "d:/tinyos-1.x/tos/lib/TinyDB/Aggregates/Aggregates.h" void addValueToTemporalAggState(TemporalAlgebraicData *tad, short value) #line 187 { tad->value[tad->tail] = value; tad->tail = (tad->tail + 1) % tad->size; if (tad->nvals == tad->size) { tad->head = (tad->head + 1) % tad->size; } else { #line 193 tad->nvals++; } } static # 196 "d:/tinyos-1.x/tos/lib/TinyDB/TableM.nc" result_t TableM$MemAlloc$reallocComplete(Handle handle, result_t success) #line 196 { if (TableM$mQuery != (void *)0 && handle == (Handle )TableM$mQuery->tableInfo) { if (success == SUCCESS) { char *names = TableM$getAliases(TableM$mQuery); if (TableM$mIdx + 1 < TableM$mQuery->numFields) { nmemcpy(&names[TableM$nameOffset(names, TableM$mIdx + 1) + (strlen(TableM$mName) + 1) - TableM$nameSize(names, TableM$mIdx)], &names[TableM$nameOffset(names, TableM$mIdx + 1)], TableM$totalNameSize(TableM$mQuery) - TableM$nameOffset(names, TableM$mIdx + 1)); } TOS_post(TableM$addField); } else { TableM$mAllocing = FALSE; TableM$mQuery = (void *)0; TableM$Table$addNamedFieldDone(success); } } return SUCCESS; } static #line 178 uint8_t TableM$nameSize(char *names, uint8_t i) #line 178 { uint8_t size = 0; #line 179 uint8_t pos = 0; int len = i; #line 181 while (len-- >= 0) { size = 0; while (names[pos++] != 0) size++; size++; } return size; } static #line 141 void TableM$addField(void) #line 141 { char *names = TableM$getAliases(TableM$mQuery); #line 143 strcpy(&names[TableM$nameOffset(names, TableM$mIdx)], TableM$mName); TableM$getTypes(TableM$mQuery)[TableM$mIdx] = TableM$mType; TableM$mQuery = (void *)0; TableM$mAllocing = FALSE; TableM$Table$addNamedFieldDone(SUCCESS); } static # 3022 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$continueParsing(result_t success) #line 3022 { int i; ParsedQuery *pq = TupleRouterM$mTempPQ; Query *q = TupleRouterM$mCurQueryPtr; AttrDesc *attr; if (!success) { #line 3028 TupleRouterM$parsedQuery(FALSE); } if (pq->fromBuffer == kNO_QUERY) { while (TupleRouterM$mCurField < q->numFields) { Field *f = TupleRouterM$QueryIntf$getFieldPtr(q, TupleRouterM$mCurField); #line 3033 { } #line 3033 ; if ((pq->bufferType == kRAM || pq->bufferType == kEEPROM) && pq->buf.ram.create == 1) { pq->queryToSchemaFieldMap[TupleRouterM$mCurField] = TYPED_FIELD; TupleRouterM$Table$addNamedField(pq, TupleRouterM$mCurField++, f->name, f->type); return; } else #line 3040 { attr = TupleRouterM$AttrUse$getAttr(f->name); if (attr != (void *)0) { pq->queryToSchemaFieldMap[TupleRouterM$mCurField] = attr->idx; } else #line 3044 { pq->queryToSchemaFieldMap[TupleRouterM$mCurField] = NULL_QUERY_FIELD; } TupleRouterM$mCurField++; } } } for (i = 0; i < q->numExprs; i++) { Expr e = TupleRouterM$QueryIntf$getExpr(q, i); e.idx = i; { } #line 3056 ; TupleRouterM$ParsedQueryIntf$setExpr(pq, i, e); e = TupleRouterM$ParsedQueryIntf$getExpr(pq, i); { } #line 3060 ; } TupleRouterM$parsedQuery(TRUE); } static #line 1021 void TupleRouterM$parsedQuery(bool success) #line 1021 { TupleRouterM$QueryListHandle h = (TupleRouterM$QueryListHandle )TupleRouterM$mTmpHandle; int qid = (*TupleRouterM$mCurQuery)->qid; TinyDBError err = err_NoError; { } #line 1026 ; TupleRouterM$MemAlloc$unlock((Handle )h); TupleRouterM$MemAlloc$unlock((Handle )TupleRouterM$mCurQuery); TupleRouterM$MemAlloc$free((Handle )TupleRouterM$mCurQuery); if (success) { { } #line 1033 ; if (TupleRouterM$reallocQueryForTuple(&TupleRouterM$resizedCallback, (TupleRouterM$QueryListHandle )h) == FALSE) { err = err_OutOfMemory; goto fail; } } else #line 1038 { err = err_UnknownError; goto fail; } return; fail: if (err != err_UnknownError) { #line 1046 TupleRouterM$signalError(err, 1046); } (*h)->q.qid = qid; TupleRouterM$mQidToRemove = qid; TupleRouterM$mForceRemove = TRUE; TOS_post(TupleRouterM$removeQueryTask); TupleRouterM$UNSET_READING_QUERY(); TupleRouterM$UNSET_PARSING_QUERY(); } static # 1158 "d:/tinyos-1.x/tos/lib/TinyDB/DBBufferC.nc" TinyDBError DBBufferC$DBBuffer$getBufferIdFromName(char *name, uint8_t *bufferId) #line 1158 { int i; for (i = 1; i < DBBufferC$kNUM_BUFS; i++) { if (DBBufferC$mUsedBufs & (1 << i)) { char *testName = * DBBufferC$mBuffers[i].name; #line 1165 if (strcmp(testName, name) == 0) { *bufferId = i; return err_NoError; } } } return err_InvalidIndex; } static #line 1138 TinyDBError DBBufferC$DBBuffer$nextUnusedBuffer(uint8_t *bufferId) #line 1138 { int i; for (i = 0; i < DBBufferC$kNUM_BUFS; i++) { if (!(DBBufferC$mUsedBufs & (1 << i))) { *bufferId = i; return err_NoError; } } return err_OutOfMemory; } static #line 983 TinyDBError DBBufferC$DBBuffer$alloc(uint8_t bufferId, BufferType type, uint16_t size, BufferPolicy policy, ParsedQuery *schema, char *name, bool *pending, long data) #line 984 { DBBufferC$Buffer *buf; *pending = FALSE; if (DBBufferC$mState != DBBufferC$kIDLE) { #line 991 return err_ResultBufferBusy; } if (bufferId >= DBBufferC$kNUM_BUFS) { return err_InvalidIndex; } if (type == kRADIO) { return err_UnsupportedBuffer; } if (DBBufferC$mUsedBufs & (1 << bufferId)) { return err_ResultBufferInUse; } DBBufferC$mState = DBBufferC$kALLOC_SCHEMA; buf = &DBBufferC$mBuffers[bufferId]; buf->type = type; buf->policy = policy; buf->numRows = size; buf->nextFree = 0; buf->nextFull = 0; buf->u.bufdata = (void *)0; buf->qh = (void *)0; buf->data = data; if (name == (void *)0) { buf->name = (void *)0; } DBBufferC$mNamePtr = name; switch (type) { case kEEPROM: if (DBBufferC$mNamePtr == (void *)0) { DBBufferC$mState = DBBufferC$kIDLE; DBBufferC$cleanupBuffer(bufferId, 1025); return err_NoUnnamedEepromBuffers; } case kRAM: buf->rowSize = sizeof(Handle ); buf->len = buf->rowSize * buf->numRows; DBBufferC$mCurBuffer = bufferId; DBBufferC$mAllocSchema = schema; if (DBBufferC$MemAlloc$allocate((HandlePtr )& buf->qh, DBBufferC$ParsedQueryIntf$pqSize(schema)) == SUCCESS) { *pending = TRUE; return err_NoError; } else #line 1040 { DBBufferC$mState = DBBufferC$kIDLE; DBBufferC$cleanupBuffer(bufferId, 1042); return err_OutOfMemory; } break; case kCOMMAND: DBBufferC$mState = DBBufferC$kIDLE; DBBufferC$mUsedBufs |= 1 << bufferId; return err_NoError; break; default: break; } return err_NoError; } static # 85 "d:/tinyos-1.x/tos/lib/TinyDB/Query.nc" Expr Query$QueryIntf$getExpr(QueryPtr q, uint8_t idx) #line 85 { return * (Expr *)(char *)((char *)q + sizeof(Query ) + ( q->numFields - 1) * sizeof(Field ) + idx * sizeof(Expr )); } static # 3141 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" result_t TupleRouterM$MemAlloc$allocComplete(Handle *handle, result_t complete) #line 3141 { bool prevInt; { } #line 3144 ; if (TupleRouterM$mAllocState == TupleRouterM$STATE_NOT_ALLOCING) { #line 3145 return SUCCESS; } switch (TupleRouterM$mAllocState) { case TupleRouterM$STATE_ALLOC_PARSED_QUERY: TupleRouterM$mAllocState = TupleRouterM$STATE_NOT_ALLOCING; if (complete) { TupleRouterM$QueryListHandle qlh = (TupleRouterM$QueryListHandle )*handle; #line 3153 { } #line 3153 ; (*qlh)->next = (void *)0; (*qlh)->q.clocksPerSample = 0; prevInt = TupleRouterM$Interrupt$disable(); if (TupleRouterM$mTail == (void *)0) { TupleRouterM$mTail = qlh; TupleRouterM$mQs = qlh; } else #line 3161 { (*TupleRouterM$mTail)->next = (void **)qlh; TupleRouterM$mTail = qlh; } if (prevInt) { #line 3165 TupleRouterM$Interrupt$enable(); } TupleRouterM$mAllocCallback((Handle *)&TupleRouterM$mTail); } else { #line 3169 TupleRouterM$signalError(err_OutOfMemory, 3169); } #line 3170 break; case TupleRouterM$STATE_ALLOC_IN_FLIGHT_QUERY: TupleRouterM$mAllocState = TupleRouterM$STATE_NOT_ALLOCING; if (complete) { { } #line 3175 ; ( *TupleRouterM$mAllocCallback)(handle); } else { #line 3179 TupleRouterM$signalError(err_OutOfMemory, 3179); } #line 3180 break; default: TupleRouterM$signalError(err_UnknownAllocationState, 3182); break; } return SUCCESS; } static # 152 "d:/tinyos-1.x/tos/lib/TinyDB/TableM.nc" result_t TableM$MemAlloc$allocComplete(HandlePtr handle, result_t success) #line 152 { if (TableM$mQuery != (void *)0 && handle == (HandlePtr )& TableM$mQuery->tableInfo) { if (success == SUCCESS) { nmemset(TableM$getAliases(TableM$mQuery), (char )0, TableM$mQuery->numFields); TOS_post(TableM$addField); } else { TableM$mAllocing = FALSE; TableM$mQuery = (void *)0; TableM$Table$addNamedFieldDone(success); } } return SUCCESS; } static # 337 "d:/tinyos-1.x/tos/lib/TinyAlloc.nc" void TinyAlloc$compactTask(void) #line 337 { int16_t i; uint8_t c; int8_t *p; int8_t endFree = 0; if (TinyAlloc$mCompacting == 0) { TinyAlloc$mContig = 0; TinyAlloc$mLast = 0; TinyAlloc$mCompacting = 1; TinyAlloc$mStartByte = 0; } c = TinyAlloc$mFree[TinyAlloc$mLast++]; if (c == 0) { TinyAlloc$mContig += 8; } else { if (c != 0xFF) { for (i = 0; i < 8; i++) { if ((c & (1 << i)) == 0) { TinyAlloc$mContig++; endFree = 1; } else { #line 364 if (TinyAlloc$mContig == 0) { TinyAlloc$mStartByte++; endFree = 0; } else { endFree = 0; break; } } } } if (TinyAlloc$mContig > 0 && !endFree) { p = (int8_t *)&TinyAlloc$mFrame[TinyAlloc$mStartByte + TinyAlloc$mContig + TinyAlloc$HEADER_SIZE]; if (!TinyAlloc$isLocked(p)) { { } #line 378 ; TinyAlloc$shiftUp(TinyAlloc$getH(p), TinyAlloc$mContig); TinyAlloc$mStartByte += (TinyAlloc$getSize(p) >> 3) << 3; } else #line 381 { TinyAlloc$mStartByte += ((TinyAlloc$getSize(p) + TinyAlloc$mContig) >> 3) << 3; if (TinyAlloc$mStartByte >> 3 == TinyAlloc$mLast - 1) { TinyAlloc$mStartByte += 8; } } TinyAlloc$mLast = TinyAlloc$mStartByte >> 3; TinyAlloc$mStartByte = TinyAlloc$mLast << 3; TinyAlloc$mContig = 0; } else { #line 399 if (!endFree) { TinyAlloc$mStartByte += 8; TinyAlloc$mContig = 0; } } } if (TinyAlloc$mLast == TinyAlloc$FREE_SIZE) { TinyAlloc$mCompacting = 0; TinyAlloc$mLast = 0; TinyAlloc$mContig = 0; TinyAlloc$mNeedFree = 0; TinyAlloc$mStartByte = 0; if (TinyAlloc$mAllocing) { TOS_post(TinyAlloc$allocTask); } else { TinyAlloc$MemAlloc$compactComplete(); } } else { TOS_post(TinyAlloc$compactTask); } } static #line 309 void TinyAlloc$doAlloc(int16_t startByte, int16_t endByte) #line 309 { int16_t newIdx = TinyAlloc$getNewHandleIdx(); #line 311 if (newIdx == -1) { TinyAlloc$mAllocing = 0; TinyAlloc$MemAlloc$allocComplete(TinyAlloc$mHandle, FAIL); return; } * (int16_t *)&TinyAlloc$mFrame[startByte] = (endByte - startByte) & 0x7FFF; TinyAlloc$mHandles[newIdx] = (int8_t *)(&TinyAlloc$mFrame[startByte] + TinyAlloc$HEADER_SIZE); *TinyAlloc$mHandle = &TinyAlloc$mHandles[newIdx]; TinyAlloc$setFreeBits(startByte, endByte, 1); TinyAlloc$mAllocing = 0; if (TinyAlloc$mReallocing) { TinyAlloc$finish_realloc(TinyAlloc$mHandle, 1); } else { TinyAlloc$MemAlloc$allocComplete(TinyAlloc$mHandle, SUCCESS); } } static # 250 "d:/tinyos-1.x/tos/lib/TinyDB/QueryResult.nc" uint16_t QueryResult$QueryResultIntf$resultSize(QueryResultPtr qr, ParsedQueryPtr q) #line 250 { uint16_t size; switch (qr->qrType) { case kIS_AGG: size = sizeof(QueryResult ) - sizeof qr->d; size += (sizeof(uint16_t ) + QueryResult$BUF_SIZE) * qr->result_idx; break; case kAGG_SINGLE_FIELD: size = sizeof(QueryResult ); break; case kNOT_AGG: size = sizeof(QueryResult ) - sizeof qr->d + QueryResult$TupleIntf$tupleSize(q); break; default: size = 0; } return size; } static # 176 "d:/tinyos-1.x/tos/lib/Command.nc" result_t Command$CommandUse$invokeMsg(TOS_MsgPtr msg, char *resultBuf, SchemaErrorNo *errorNo) { uint16_t nodeid; static TOS_Msg msgCopy; struct CommandMsg *cmsg; msgCopy = *msg; cmsg = (struct CommandMsg *)msgCopy.data; nodeid = cmsg->nodeid; if (nodeid == TOS_BCAST_ADDR || nodeid == TOS_LOCAL_ADDRESS) { return Command$CommandUse$invokeBuffer(cmsg->data, resultBuf, errorNo); } return SUCCESS; } static # 172 "d:/tinyos-1.x/tos/platform/mica/HPLClock.nc" result_t HPLClock$Clock$setRate(char interval, char scale) #line 172 { scale &= 0x7; scale |= 0x8; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 175 { * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x37 + 0x20) &= ~(1 << 0); * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x37 + 0x20) &= ~(1 << 1); * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x30 + 0x20) |= 1 << 3; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x33 + 0x20) = scale; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x32 + 0x20) = 0; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x31 + 0x20) = interval; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x37 + 0x20) |= 1 << 1; } #line 185 __nesc_atomic_end(__nesc_atomic); } return SUCCESS; } # 253 "d:/tinyos-1.x/tos/system/AMStandard.nc" TOS_MsgPtr received(TOS_MsgPtr packet) #line 253 { uint16_t addr = TOS_LOCAL_ADDRESS; #line 255 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 255 { AMStandard$counter++; } #line 257 __nesc_atomic_end(__nesc_atomic); } { } #line 258 ; if (packet->group == TOS_AM_GROUP && ( packet->addr == TOS_BCAST_ADDR || packet->addr == addr)) { uint8_t type = packet->type; TOS_MsgPtr tmp; { } #line 269 ; AMStandard$dbgPacket(packet); { } #line 271 ; tmp = AMStandard$ReceiveMsg$receive(type, packet); if (tmp) { packet = tmp; } } #line 278 return packet; } static # 595 "d:/tinyos-1.x/tos/lib/TinyDB/NetworkM.nc" bool NetworkM$filterMessage(TOS_MsgPtr msg, bool checkRecent) #line 595 { if (msg->crc == 0) { NetworkM$NetworkMonitor$updateContention(TRUE, CRC_FAILURE); return TRUE; } else { #line 600 NetworkM$NetworkMonitor$updateContention(FALSE, 0); } if (checkRecent) { NetworkMessage *nw = (NetworkMessage *)msg->data; long id = ((long )nw->hdr.senderid << 16) + nw->hdr.idx; short i; if (nw->hdr.senderid == TOS_UART_ADDR) { #line 607 return FALSE; } for (i = 0; i < NetworkM$NUM_RECENT_MSGS; i++) { if (NetworkM$mRecentMsgs[i] == id) { return TRUE; } } NetworkM$mRecentMsgs[NetworkM$mNextMsg++] = id; if (NetworkM$mNextMsg == NetworkM$NUM_RECENT_MSGS) { #line 618 NetworkM$mNextMsg = 0; } } return FALSE; } static #line 1097 bool NetworkM$processHeader(DbMsgHdr header, NetworkM$MsgType type, uint8_t rootId) { bool wasParent = FALSE; if (((( #line 1101 !NetworkM$mForceTopology || header.senderid == NetworkM$mParentCand1) || header.senderid == NetworkM$mParentCand2) || header.senderid == NetworkM$mParentCand3) && NetworkM$mRoots[rootId] != TOS_LOCAL_ADDRESS) { short clockCnt = 0; short match; if (header.senderid == TOS_LOCAL_ADDRESS) { return FALSE; } if (NetworkM$mRelatives[NetworkM$mParentIx[rootId]] == header.senderid) { if (header.level > NetworkM$mRelLevel[rootId][NetworkM$mParentIx[rootId]]) { NetworkM$mSendCount += NetworkM$PARENT_LOST_INTERVAL + 1; } else { #line 1119 NetworkM$mLastHeard = NetworkM$mSendCount; } } if (header.parentid == TOS_LOCAL_ADDRESS && header.senderid == NetworkM$mRelatives[NetworkM$mParentIx[rootId]]) { NetworkM$mSendCount += NetworkM$PARENT_LOST_INTERVAL + 1; } if (NetworkM$mSendCount - NetworkM$mLastHeard < 0) { NetworkM$mLastHeard = NetworkM$mSendCount; } if (NetworkM$mSendCount - NetworkM$mLastHeard > NetworkM$PARENT_LOST_INTERVAL) { short parent = NetworkM$mParentIx[rootId]; #line 1135 NetworkM$mCommProb[NetworkM$mParentIx[rootId]] = 0; NetworkM$tinydbChooseParent(header, clockCnt, rootId, FALSE); if (parent != NetworkM$mParentIx[rootId]) { #line 1137 NetworkM$mLastHeard = NetworkM$mSendCount; } } clockCnt = 0; if (NetworkM$mParentIx[rootId] == NetworkM$PARENT_UNKNOWN) { NetworkM$tinydbParentInit(header, clockCnt, rootId); wasParent = TRUE; NetworkM$mLastHeard = NetworkM$mSendCount; } else { match = NetworkM$tinydbUpdateSenderStats(header, clockCnt, rootId); if (match != NetworkM$BAD_IX && match == NetworkM$mParentIx[rootId]) { wasParent = TRUE; } else { #line 1164 if (match == NetworkM$BAD_IX) { NetworkM$tinydbRelativeReplace(header, clockCnt, rootId); } } if (NetworkM$mSendCount - NetworkM$mLastCheck > NetworkM$PARENT_RESELECT_INTERVAL) { NetworkM$tinydbChooseParent(header, clockCnt, rootId, TRUE); NetworkM$mLastCheck = NetworkM$mSendCount; } } } if (type == NetworkM$DATA_TYPE && header.parentid == TOS_LOCAL_ADDRESS) { return TRUE; } else { #line 1181 if (type == NetworkM$QUERY_TYPE) { { } #line 1182 ; return TRUE; } else { return FALSE; } } } static #line 1013 void NetworkM$tinydbChooseParent(DbMsgHdr header, short clockCnt, uint8_t rootId, bool lastOk) { short i; #line 1015 short best; unsigned char prob; #line 1016 unsigned char tmpprob; short oldparent; short oldlevel; short any = -1; #line 1019 short anylevel = -1; { } #line 1021 ; for (i = 0; i < NetworkM$NUM_RELATIVES; i++) { if (NetworkM$mRelOccupiedBits & (0x1 << i)) { } #line 1025 ; } for (i = 0, best = -1, prob = 0; i < NetworkM$NUM_RELATIVES; i++) { if (NetworkM$mRelOccupiedBits & (0x1 << i) && NetworkM$mParentIx[rootId] != i) { if (any == -1 || NetworkM$mRelLevel[rootId][i] < anylevel) { any = i; { } #line 1034 ; anylevel = NetworkM$mRelLevel[rootId][i]; } } if ( #line 1043 NetworkM$mRelLevel[rootId][i] < NetworkM$myLevel(rootId) || (NetworkM$mRelLevel[rootId][i] == NetworkM$myLevel(rootId) && NetworkM$mRelatives[i] > TOS_LOCAL_ADDRESS)) { if (NetworkM$mRelOccupiedBits & (0x1 << i)) { tmpprob = NetworkM$mCommProb[i]; if (tmpprob > prob) { prob = tmpprob; best = i; } } } } if ((lastOk || any == -1) && best == -1) { #line 1054 return; } if (( #line 1061 NetworkM$mCommProb[best] - NetworkM$mCommProb[NetworkM$mParentIx[rootId]] > NetworkM$MAX_PROB_THRESH || NetworkM$mCommProb[NetworkM$mParentIx[rootId]] == 0) || NetworkM$mRelLevel[rootId][best] < NetworkM$mRelLevel[rootId][NetworkM$mParentIx[rootId]]) { oldlevel = NetworkM$myLevel(rootId); oldparent = NetworkM$mParentIx[rootId]; if (oldparent == best && !lastOk && any != -1) { NetworkM$mParentIx[rootId] = any; } else #line 1068 { NetworkM$mParentIx[rootId] = best; } { } #line 1072 ; } else { if (!lastOk && any != -1) { { } #line 1076 ; NetworkM$mParentIx[rootId] = any; } } } static # 1630 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$aggregateResult(ParsedQuery *q, QueryResult *qr, char exprId) #line 1630 { Expr *e; if (exprId >= q->numExprs) { TupleRouterM$UNSET_AGGREGATING_RESULT(); return; } e = TupleRouterM$ParsedQueryIntf$getExprPtr(q, exprId); if (e->opType != kSEL) { TupleRouterM$SET_AGGREGATING_RESULT(); if (TupleRouterM$AggOperator$processPartialResult(qr, q, e) != err_NoError) { TupleRouterM$UNSET_AGGREGATING_RESULT(); TupleRouterM$aggregateResult(q, qr, exprId + 1); } } else { #line 1647 TupleRouterM$aggregateResult(q, qr, exprId + 1); } } static #line 854 TinyDBError TupleRouterM$forwardQuery(QueryMessagePtr qmsg) #line 854 { TinyDBError err = err_NoError; #line 856 if (!TupleRouterM$IS_SENDING_MESSAGE()) { QueryMessagePtr qmsgCopy; #line 858 TupleRouterM$SET_SENDING_MESSAGE(); qmsgCopy = TupleRouterM$Network$getQueryPayLoad(&TupleRouterM$mMsg); *qmsgCopy = *qmsg; TupleRouterM$mMustTimestamp = TRUE; TupleRouterM$mTimestampMsg = &TupleRouterM$mMsg; if (TupleRouterM$Network$sendQueryMessage(&TupleRouterM$mMsg) != err_NoError) { TupleRouterM$mMustTimestamp = FALSE; TupleRouterM$UNSET_SENDING_MESSAGE(); err = err_MSF_ForwardKnownQuery; goto done; } } else { err = err_MSF_ForwardKnownQueryBusy; } done: if (err != err_NoError) { TupleRouterM$signalError(err, 876); } #line 877 return err; } static #line 932 bool TupleRouterM$addQueryField(QueryMessagePtr qmsg) #line 932 { bool knewAbout = FALSE; if (qmsg->type == kFIELD) { TupleRouterM$QueryIntf$setField(*TupleRouterM$mCurQuery, (short )qmsg->idx, qmsg->u.field); knewAbout = (*TupleRouterM$mCurQuery)->knownFields & (1 << qmsg->idx); (*TupleRouterM$mCurQuery)->knownFields |= 1 << qmsg->idx; { } #line 939 ; } else { #line 940 if (qmsg->type == kEXPR) { qmsg->u.expr.opState = (void *)0; TupleRouterM$QueryIntf$setExpr(*TupleRouterM$mCurQuery, qmsg->idx, qmsg->u.expr); { } #line 944 ; knewAbout = (*TupleRouterM$mCurQuery)->knownExprs & (1 << qmsg->idx); (*TupleRouterM$mCurQuery)->knownExprs |= 1 << qmsg->idx; } else { #line 947 if (qmsg->type == kBUF_MSG) { knewAbout = (*TupleRouterM$mCurQuery)->hasBuf; (*TupleRouterM$mCurQuery)->hasBuf = TRUE; (*TupleRouterM$mCurQuery)->buf = qmsg->u.buf; } else { #line 951 if (qmsg->type == kEVENT_MSG) { knewAbout = (*TupleRouterM$mCurQuery)->hasEvent; (*TupleRouterM$mCurQuery)->hasEvent = TRUE; strcpy((*TupleRouterM$mCurQuery)->eventName, qmsg->u.eventName); { } #line 957 ; } else { #line 958 if (qmsg->type == kN_EPOCHS_MSG) { knewAbout = (*TupleRouterM$mCurQuery)->hasForClause; (*TupleRouterM$mCurQuery)->hasForClause = TRUE; (*TupleRouterM$mCurQuery)->numEpochs = qmsg->u.numEpochs; { } #line 963 ; } } } } } #line 966 if (TupleRouterM$queryComplete(* *TupleRouterM$mCurQuery)) { TupleRouterM$SET_PARSING_QUERY(); { } #line 970 ; TupleRouterM$MemAlloc$lock((Handle )TupleRouterM$mCurQuery); TupleRouterM$allocQuery(&TupleRouterM$parsedCallback, *TupleRouterM$mCurQuery); } return knewAbout; } static # 1180 "d:/tinyos-1.x/tos/lib/TinyDB/DBBufferC.nc" TinyDBError DBBufferC$DBBuffer$qidFromBufferId(uint8_t bufId, uint8_t *qid) #line 1180 { if (bufId < DBBufferC$kNUM_BUFS && DBBufferC$mUsedBufs & (1 << bufId)) { *qid = (* DBBufferC$mBuffers[bufId].qh)->qid; return err_NoError; } else #line 1184 { return err_InvalidIndex; } } # 175 "d:/tinyos-1.x/tos/platform/mica2/HPLADCM.nc" void __attribute((interrupt)) __vector_21(void) #line 175 { uint16_t data = * (volatile unsigned int *)(unsigned int )& * (volatile unsigned char *)(0x04 + 0x20); #line 177 data &= 0x3ff; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x06 + 0x20) |= 1 << 4; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x06 + 0x20) &= ~(1 << 7); HPLADCM$ADC$dataReady(data); } static # 1913 "d:/tinyos-1.x/tos/lib/TinyDB/TupleRouterM.nc" void TupleRouterM$continueSetSampleRate(void) #line 1913 { uint32_t epochDur; uint16_t aggWinSize; uint16_t mvPerDay; #line 1917 TupleRouterM$computeRates(TupleRouterM$mLifetime, TupleRouterM$mVoltage, 0, 0, 1, 1, &epochDur, &aggWinSize, &mvPerDay); { } #line 1918 ; TupleRouterM$setRate(TupleRouterM$mCurSampleRateQuery, (short )(epochDur & 0x00007FFF)); TupleRouterM$UNSET_SETTING_SAMPLE_RATE(); } static # 95 "d:/tinyos-1.x/tos/lib/Attributes/AttrPhotoM.nc" result_t AttrPhotoM$ADC$dataReady(uint16_t data) { * (uint16_t *)AttrPhotoM$result = data; AttrPhotoM$AttrRegister$getAttrDone(AttrPhotoM$attrName, AttrPhotoM$result, SCHEMA_RESULT_READY); return SUCCESS; } static # 95 "d:/tinyos-1.x/tos/lib/Attributes/AttrTempM.nc" result_t AttrTempM$ADC$dataReady(uint16_t data) { * (uint16_t *)AttrTempM$result = data; AttrTempM$AttrRegister$getAttrDone(AttrTempM$attrName, AttrTempM$result, SCHEMA_RESULT_READY); return SUCCESS; } static # 472 "d:/tinyos-1.x/tos/platform/mica2/CC1000RadioIntM.nc" result_t CC1000RadioIntM$SpiByteFifo$dataReady(uint8_t data_in) #line 472 { if (CC1000RadioIntM$bInvertRxData) { data_in = ~data_in; } switch (CC1000RadioIntM$RadioState) { case CC1000RadioIntM$TX_STATE: { CC1000RadioIntM$SpiByteFifo$writeByte(CC1000RadioIntM$NextTxByte); CC1000RadioIntM$TxByteCnt++; switch (CC1000RadioIntM$RadioTxState) { case CC1000RadioIntM$TXSTATE_PREAMBLE: if (!(CC1000RadioIntM$TxByteCnt < CC1000RadioIntM$preamblelen)) { CC1000RadioIntM$NextTxByte = CC1000RadioIntM$SYNC_BYTE; CC1000RadioIntM$RadioTxState = CC1000RadioIntM$TXSTATE_SYNC; } break; case CC1000RadioIntM$TXSTATE_SYNC: CC1000RadioIntM$NextTxByte = CC1000RadioIntM$NSYNC_BYTE; CC1000RadioIntM$RadioTxState = CC1000RadioIntM$TXSTATE_DATA; CC1000RadioIntM$TxByteCnt = -1; CC1000RadioIntM$RadioSendCoordinator$startSymbol(); break; case CC1000RadioIntM$TXSTATE_DATA: if ((uint8_t )CC1000RadioIntM$TxByteCnt < CC1000RadioIntM$txlength) { CC1000RadioIntM$NextTxByte = ((uint8_t *)CC1000RadioIntM$txbufptr)[CC1000RadioIntM$TxByteCnt]; CC1000RadioIntM$usRunningCRC = crcByte(CC1000RadioIntM$usRunningCRC, CC1000RadioIntM$NextTxByte); CC1000RadioIntM$RadioSendCoordinator$byte(CC1000RadioIntM$txbufptr, (uint8_t )CC1000RadioIntM$TxByteCnt); } else { CC1000RadioIntM$NextTxByte = (uint8_t )CC1000RadioIntM$usRunningCRC; CC1000RadioIntM$RadioTxState = CC1000RadioIntM$TXSTATE_CRC; } break; case CC1000RadioIntM$TXSTATE_CRC: CC1000RadioIntM$NextTxByte = (uint8_t )(CC1000RadioIntM$usRunningCRC >> 8); CC1000RadioIntM$RadioTxState = CC1000RadioIntM$TXSTATE_FLUSH; CC1000RadioIntM$TxByteCnt = 0; break; case CC1000RadioIntM$TXSTATE_FLUSH: if (CC1000RadioIntM$TxByteCnt > 3) { CC1000RadioIntM$RadioTxState = CC1000RadioIntM$TXSTATE_DONE; } break; case CC1000RadioIntM$TXSTATE_DONE: default: CC1000RadioIntM$SpiByteFifo$rxMode(); CC1000RadioIntM$CC1000Control$RxMode(); CC1000RadioIntM$bTxPending = FALSE; if (TOS_post(CC1000RadioIntM$PacketSent)) { CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE; } break; } } break; case CC1000RadioIntM$DISABLED_STATE: break; case CC1000RadioIntM$IDLE_STATE: { if (data_in == 0xaa || data_in == 0x55) { CC1000RadioIntM$PreambleCount++; if (CC1000RadioIntM$PreambleCount > ({ #line 547 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_LPL_ValidPrecursor[CC1000RadioIntM$lplpower]; #line 547 unsigned char __result; #line 547 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } )) #line 547 { CC1000RadioIntM$PreambleCount = CC1000RadioIntM$SOFCount = 0; CC1000RadioIntM$RxBitOffset = CC1000RadioIntM$RxByteCnt = 0; CC1000RadioIntM$usRunningCRC = 0; CC1000RadioIntM$rxlength = MSG_DATA_SIZE - 2; CC1000RadioIntM$RadioState = CC1000RadioIntM$SYNC_STATE; } } else { #line 555 if (CC1000RadioIntM$bTxPending && --CC1000RadioIntM$sMacDelay <= 0) { CC1000RadioIntM$bRSSIValid = FALSE; CC1000RadioIntM$RSSIADC$getData(); CC1000RadioIntM$PreambleCount = 0; CC1000RadioIntM$RadioState = CC1000RadioIntM$PRETX_STATE; } } } break; case CC1000RadioIntM$PRETX_STATE: { if (data_in == 0xaa || data_in == 0x55) { CC1000RadioIntM$sMacDelay = ((CC1000RadioIntM$Random$rand() & 0xf) + 1) * MSG_DATA_SIZE; CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE; } else { #line 581 if (CC1000RadioIntM$bRSSIValid) { if (CC1000RadioIntM$usRSSIVal > ({ #line 582 unsigned short __addr16 = (unsigned short )(unsigned short )&CC1K_LPL_SquelchInit[CC1000RadioIntM$lplpower]; #line 582 unsigned char __result; #line 582 __asm ("lpm %0, Z" : "=r"(__result) : "z"(__addr16));__result; } )) #line 582 { CC1000RadioIntM$CC1000Control$TxMode(); CC1000RadioIntM$SpiByteFifo$txMode(); CC1000RadioIntM$TxByteCnt = 0; CC1000RadioIntM$usRunningCRC = 0; CC1000RadioIntM$RadioState = CC1000RadioIntM$TX_STATE; CC1000RadioIntM$RadioTxState = CC1000RadioIntM$TXSTATE_PREAMBLE; CC1000RadioIntM$NextTxByte = 0xaa; CC1000RadioIntM$SpiByteFifo$writeByte(0xaa); } else { CC1000RadioIntM$sMacDelay = ((CC1000RadioIntM$Random$rand() & 0xf) + 1) * MSG_DATA_SIZE; CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE; } } } } #line 600 break; case CC1000RadioIntM$SYNC_STATE: { uint8_t i; if (data_in == 0xaa || data_in == 0x55) { CC1000RadioIntM$RxShiftBuf.MSB = data_in; } else { uint16_t usTmp; #line 623 switch (CC1000RadioIntM$SOFCount) { case 0: CC1000RadioIntM$RxShiftBuf.LSB = data_in; break; case 1: case 2: usTmp = CC1000RadioIntM$RxShiftBuf.W; CC1000RadioIntM$RxShiftBuf.W <<= 8; CC1000RadioIntM$RxShiftBuf.LSB = data_in; for (i = 0; i < 8; i++) { usTmp <<= 1; if (data_in & 0x80) { usTmp |= 0x1; } #line 639 data_in <<= 1; if (usTmp == CC1000RadioIntM$SYNC_WORD) { CC1000RadioIntM$RadioState = CC1000RadioIntM$RX_STATE; CC1000RadioIntM$RSSIADC$getData(); CC1000RadioIntM$RxBitOffset = 7 - i; CC1000RadioIntM$RadioReceiveCoordinator$startSymbol(); break; } } break; default: CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE; break; } CC1000RadioIntM$SOFCount++; } } break; case CC1000RadioIntM$RX_STATE: { char Byte; CC1000RadioIntM$RxShiftBuf.W <<= 8; CC1000RadioIntM$RxShiftBuf.LSB = data_in; Byte = CC1000RadioIntM$RxShiftBuf.W >> CC1000RadioIntM$RxBitOffset; ((char *)CC1000RadioIntM$rxbufptr)[(int )CC1000RadioIntM$RxByteCnt] = Byte; CC1000RadioIntM$RxByteCnt++; CC1000RadioIntM$RadioReceiveCoordinator$byte(CC1000RadioIntM$rxbufptr, (uint8_t )CC1000RadioIntM$RxByteCnt); if (CC1000RadioIntM$RxByteCnt < CC1000RadioIntM$rxlength) { CC1000RadioIntM$usRunningCRC = crcByte(CC1000RadioIntM$usRunningCRC, Byte); if (CC1000RadioIntM$RxByteCnt == (size_t )& ((struct TOS_Msg *)0)->length + sizeof ((struct TOS_Msg *)0)->length) { CC1000RadioIntM$rxlength = CC1000RadioIntM$rxbufptr->length; if (CC1000RadioIntM$rxlength > 40) { CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE; return SUCCESS; } CC1000RadioIntM$rxlength += (size_t )& ((struct TOS_Msg *)0)->data; } } else { #line 703 if (CC1000RadioIntM$RxByteCnt == CC1000RadioIntM$rxlength) { CC1000RadioIntM$usRunningCRC = crcByte(CC1000RadioIntM$usRunningCRC, Byte); CC1000RadioIntM$RxByteCnt = (size_t )& ((struct TOS_Msg *)0)->crc; } else { #line 708 if (CC1000RadioIntM$RxByteCnt >= MSG_DATA_SIZE) { if (CC1000RadioIntM$rxbufptr->crc == CC1000RadioIntM$usRunningCRC) { CC1000RadioIntM$rxbufptr->crc = 1; } else { CC1000RadioIntM$rxbufptr->crc = 0; } CC1000RadioIntM$SpiByteFifo$disableIntr(); CC1000RadioIntM$RadioState = CC1000RadioIntM$DISABLED_STATE; CC1000RadioIntM$rxbufptr->strength = CC1000RadioIntM$usRSSIVal; if (!TOS_post(CC1000RadioIntM$PacketRcvd)) { CC1000RadioIntM$RadioState = CC1000RadioIntM$IDLE_STATE; CC1000RadioIntM$SpiByteFifo$enableIntr(); } } } } } break; default: break; } #line 754 return SUCCESS; } # 190 "d:/tinyos-1.x/tos/platform/mica/HPLClock.nc" void __attribute((interrupt)) __vector_15(void) #line 190 { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 191 { if (HPLClock$set_flag) { HPLClock$mscale = HPLClock$nextScale; HPLClock$nextScale |= 0x8; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x33 + 0x20) = HPLClock$nextScale; * (volatile unsigned char *)(unsigned int )& * (volatile unsigned char *)(0x31 + 0x20) = HPLClock$minterval; HPLClock$set_flag = 0; } } #line 200 __nesc_atomic_end(__nesc_atomic); } HPLClock$Clock$fire(); } static # 357 "d:/tinyos-1.x/tos/system/NoCRCPacket.nc" result_t NoCRCPacket$ByteComm$rxByteReady(uint8_t data, bool error, uint16_t strength) #line 358 { bool rxDone; { } #line 361 ; if (error) { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 364 { NoCRCPacket$rxCount = 0; } #line 366 __nesc_atomic_end(__nesc_atomic); } return FAIL; } { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 369 { if (NoCRCPacket$rxCount == 0) { ((TOS_MsgPtr )NoCRCPacket$recPtr)->strength = strength; } if (NoCRCPacket$rxCount == (size_t )& ((TOS_Msg *)0)->type) { NoCRCPacket$rxLength = TOS_MsgLength(data); } NoCRCPacket$recPtr[NoCRCPacket$rxCount++] = data; rxDone = NoCRCPacket$rxCount == NoCRCPacket$rxLength; } #line 379 __nesc_atomic_end(__nesc_atomic); } if (rxDone) { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 383 { NoCRCPacket$bufferIndex = NoCRCPacket$bufferIndex ^ 1; NoCRCPacket$recPtr = (uint8_t *)NoCRCPacket$bufferPtrs[NoCRCPacket$bufferIndex]; { } #line 386 ; NoCRCPacket$rxCount = 0; } #line 388 __nesc_atomic_end(__nesc_atomic); } TOS_post(NoCRCPacket$receiveTask); return FAIL; } return SUCCESS; } static # 110 "d:/tinyos-1.x/tos/system/UARTM.nc" result_t UARTM$HPLUART$putDone(void) #line 110 { bool oldState; #line 112 { } #line 112 ; { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 114 { oldState = UARTM$state; UARTM$state = FALSE; } #line 117 __nesc_atomic_end(__nesc_atomic); } if (oldState) { UARTM$ByteComm$txDone(); UARTM$ByteComm$txByteReady(SUCCESS); } return SUCCESS; } static # 252 "d:/tinyos-1.x/tos/system/NoCRCPacket.nc" void NoCRCPacket$sendComplete(result_t success) #line 252 { uint8_t stateCopy; #line 254 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 254 { stateCopy = NoCRCPacket$state; } #line 256 __nesc_atomic_end(__nesc_atomic); } if (stateCopy == NoCRCPacket$PACKET) { if (success) { TOS_MsgPtr msg; #line 266 { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 266 { msg = (TOS_MsgPtr )NoCRCPacket$sendPtr; msg->ack = TRUE; } #line 269 __nesc_atomic_end(__nesc_atomic); } TOS_post(NoCRCPacket$sendDoneSuccessTask); } else { TOS_post(NoCRCPacket$sendDoneFailTask); } } else { #line 276 if (stateCopy == NoCRCPacket$BYTES) { if (success) { TOS_post(NoCRCPacket$sendVarLenSuccessTask); } else { TOS_post(NoCRCPacket$sendVarLenFailTask); } } else { { __nesc_atomic_t __nesc_atomic = __nesc_atomic_start(); #line 285 { NoCRCPacket$txCount = 0; NoCRCPacket$state = NoCRCPacket$IDLE; } #line 288 __nesc_atomic_end(__nesc_atomic); } } } } # 159 "d:/tinyos-1.x/tos/sensorboards/micasb/MicM.nc" void __attribute((signal)) __vector_4(void) #line 159 { MicM$MicInterrupt$disable(); TOSH_interrupt_enable(); MicM$MicInterrupt$toneDetected(); }