00001 /** 00002 * \addtogroup etimer 00003 * @{ 00004 */ 00005 00006 /** 00007 * \file 00008 * Event timer library header file. 00009 * \author 00010 * Adam Dunkels <adam@sics.se> 00011 */ 00012 00013 /* 00014 * Copyright (c) 2004, Swedish Institute of Computer Science. 00015 * All rights reserved. 00016 * 00017 * Redistribution and use in source and binary forms, with or without 00018 * modification, are permitted provided that the following conditions 00019 * are met: 00020 * 1. Redistributions of source code must retain the above copyright 00021 * notice, this list of conditions and the following disclaimer. 00022 * 2. Redistributions in binary form must reproduce the above copyright 00023 * notice, this list of conditions and the following disclaimer in the 00024 * documentation and/or other materials provided with the distribution. 00025 * 3. Neither the name of the Institute nor the names of its contributors 00026 * may be used to endorse or promote products derived from this software 00027 * without specific prior written permission. 00028 * 00029 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND 00030 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00031 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00032 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE 00033 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00034 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 00035 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 00036 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 00037 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 00038 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 00039 * SUCH DAMAGE. 00040 * 00041 * This file is part of the Contiki operating system. 00042 * 00043 * Author: Adam Dunkels <adam@sics.se> 00044 * 00045 * $Id: etimer.h,v 1.4 2005/07/04 13:26:44 adam Exp $ 00046 */ 00047 #ifndef __ETIMER_H__ 00048 #define __ETIMER_H__ 00049 00050 #include "timer.h" 00051 #include "process.h" 00052 00053 /** 00054 * A timer. 00055 * 00056 * This structure is used for declaring a timer. The timer must be set 00057 * with etimer_set() before it can be used. 00058 * 00059 * \hideinitializer 00060 */ 00061 struct etimer { 00062 struct timer timer; 00063 struct etimer *next; 00064 /* ek_id_t pid; */ 00065 struct process *p; 00066 }; 00067 00068 void etimer_set(struct etimer *t, clock_time_t interval); 00069 void etimer_reset(struct etimer *t); 00070 void etimer_restart(struct etimer *t); 00071 int etimer_expired(struct etimer *t); 00072 00073 PROCESS_NAME(etimer_process); 00074 00075 void etimer_request_poll(void); 00076 00077 int etimer_pending(void); 00078 00079 #endif /* __ETIMER_H__ */
1.3.6