[asterisk-addons-commits] mnicholson: branch mnicholson/chan-mobile-refactor r765 - /team/mnicholson/ch...

SVN commits to the Asterisk addons project asterisk-addons-commits at lists.digium.com
Fri Jan 30 10:35:41 CST 2009


Author: mnicholson
Date: Fri Jan 30 10:35:41 2009
New Revision: 765

URL: http://svn.digium.com/svn-view/asterisk-addons?view=rev&rev=765
Log:
Updated code documentation.

 * channels/chan_mobile.c (rfcomm_read): updated the documentation to be more
 specific

Modified:
    team/mnicholson/chan-mobile-refactor/channels/chan_mobile.c

Modified: team/mnicholson/chan-mobile-refactor/channels/chan_mobile.c
URL: http://svn.digium.com/svn-view/asterisk-addons/team/mnicholson/chan-mobile-refactor/channels/chan_mobile.c?view=diff&rev=765&r1=764&r2=765
==============================================================================
--- team/mnicholson/chan-mobile-refactor/channels/chan_mobile.c (original)
+++ team/mnicholson/chan-mobile-refactor/channels/chan_mobile.c Fri Jan 30 10:35:41 2009
@@ -1220,22 +1220,28 @@
 }
 
 /*
- * \brief Read one message from an rfcomm socket.
+ * \brief Read one Hayes AT message from an rfcomm socket.
  * \param rsock the rfcomm socket to read from
  * \param buf the buffer to store the result in
  * \param count the size of the buffer or the maximum number of characters to read
  *
- * Here we need to read complete '\r\n' terminated rfcomm result code from the
- * rfcomm socket, or a '\r' terminated AT command. Only the content of the
- * result code or command is returned, the '\r\n' and '\r' parts are discarded.
- * The rfcomm connection to the device is asynchronous, so there is no
+ * Here we need to read complete Hayes AT messages.  The AT message formats we
+ * support are listed below.
+ *
+ * \verbatim
+ * \r\n<result code>\r\n
+ * <at command>\r
+ * \r\n> 
+ * \endverbatim
+ *
+ * These formats corispond to AT result codes, AT commands, and the AT SMS
+ * prompt respectively.  When messages are read the leading and trailing '\r'
+ * and '\n' characters are discarded.  If the given buffer is not large enough
+ * to hold the response, what does not fit in the buffer will be dropped.
+ *
+ * \note The rfcomm connection to the device is asynchronous, so there is no
  * guarantee that responses will be returned in a single read() call. We handle
- * this by blocking until we can read an entire response.  If the given buffer
- * is not large enough to hold the response, what does not fit in the buffer
- * will be dropped.
- *
- * \note An exception is made for the special message '\r\n> ', which is used
- * to prompt for an SMS message
+ * this by blocking until we can read an entire response. *
  */
 static ssize_t rfcomm_read(int rsock, char *buf, size_t count)
 {




More information about the asterisk-addons-commits mailing list