[asterisk-commits] russell: branch group/timing r122367 - in /team/group/timing: include/asteris...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jun 12 15:24:19 CDT 2008


Author: russell
Date: Thu Jun 12 15:24:19 2008
New Revision: 122367

URL: http://svn.digium.com/view/asterisk?view=rev&rev=122367
Log:
implement timer_enable and disable_continuous, and document the API calls

Modified:
    team/group/timing/include/asterisk/timing.h
    team/group/timing/res/res_timing_dahdi.c

Modified: team/group/timing/include/asterisk/timing.h
URL: http://svn.digium.com/view/asterisk/team/group/timing/include/asterisk/timing.h?view=diff&rev=122367&r1=122366&r2=122367
==============================================================================
--- team/group/timing/include/asterisk/timing.h (original)
+++ team/group/timing/include/asterisk/timing.h Thu Jun 12 15:24:19 2008
@@ -93,8 +93,27 @@
 	 */
 	void (*timer_ack)(int handle, unsigned int quantity);
 
+	/*!
+	 * \brief Enable continuous mode
+	 *
+	 * \arg handle timing fd returned from timer_open()
+	 *
+	 * Continuous mode causes poll() on the timing fd to immediately return
+	 * always until continuous mode is disabled.
+	 *
+	 * \retval -1 failure, with errno set
+	 * \retval 0 success
+	 */
 	int (*timer_enable_continuous)(int handle);
 
+	/*!
+	 * \brief Disable continuous mode
+	 *
+	 * \arg handle timing fd returned from timer_close()
+	 *
+	 * \retval -1 failure, with errno set
+	 * \retval 0 success
+	 */
 	int (*timer_disable_continuous)(int handle);
 
 	enum ast_timing_event (*timer_get_event)(int handle);

Modified: team/group/timing/res/res_timing_dahdi.c
URL: http://svn.digium.com/view/asterisk/team/group/timing/res/res_timing_dahdi.c?view=diff&rev=122367&r1=122366&r2=122367
==============================================================================
--- team/group/timing/res/res_timing_dahdi.c (original)
+++ team/group/timing/res/res_timing_dahdi.c Thu Jun 12 15:24:19 2008
@@ -100,12 +100,16 @@
 
 static int dahdi_timer_enable_continuous(int handle)
 {
-	return 0;
+	int flags = 1;
+
+	return ioctl(handle, DAHDI_TIMERPONG, &flags) ? -1 : 0;
 }
 
 static int dahdi_timer_disable_continuous(int handle)
 {
-	return 0;
+	int flags = -1;
+
+	return ioctl(handle, DAHDI_TIMERPONG, &flags) ? -1 : 0;
 }
 
 static enum ast_timing_event dahdi_timer_get_event(int handle)




More information about the asterisk-commits mailing list