diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-11-29 18:14:06 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-11-29 18:14:06 +0000 |
commit | 7b092a8491920f2f99ab6813362a971caae6d174 (patch) | |
tree | 5868c5445702badc5dcf40a489e5de606f2c9a5a | |
parent | 398540bcd51792bdf838b5a57c9255d5e7c0c6ed (diff) | |
download | px4-nuttx-7b092a8491920f2f99ab6813362a971caae6d174.tar.gz px4-nuttx-7b092a8491920f2f99ab6813362a971caae6d174.tar.bz2 px4-nuttx-7b092a8491920f2f99ab6813362a971caae6d174.zip |
Fix message number
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1351 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r-- | nuttx/graphics/nxmu/nx_eventhandler.c | 27 |
1 files changed, 17 insertions, 10 deletions
diff --git a/nuttx/graphics/nxmu/nx_eventhandler.c b/nuttx/graphics/nxmu/nx_eventhandler.c index cd1a1a7a1..136ff9b5f 100644 --- a/nuttx/graphics/nxmu/nx_eventhandler.c +++ b/nuttx/graphics/nxmu/nx_eventhandler.c @@ -108,19 +108,25 @@ static inline void nx_disconnected(FAR struct nxfe_conn_s *conn) * * Description: * The client code must call this function periodically to process - * incoming messages from the server. + * incoming messages from the server. If CONFIG_NX_BLOCKING is defined, + * then this function not return until a server message is received. + * + * When CONFIG_NX_BLOCKING is not defined, the client must exercise + * caution in the looping to assure that it does not eat up all of + * the CPU bandwidth calling nx_eventhandler repeatedly. nx_eventnotify + * may be called to get a signal event whenever a new incoming server + * event is avaiable. * * Input Parameters: * handle - the handle returned by nx_connect * * Return: - * >0: The length of the message received in msgbuffer - * 0: No message was received - * <0: An error occurred and errno has been set appropriately - * - * Of particular interest, it will return errno == EHOSTDOWN when the - * server is disconnected. After that event, the handle can not longer - * be used. + * OK: No errors occurred. If CONFIG_NX_BLOCKING is defined, then + * one or more server message was processed. + * ERROR: An error occurred and errno has been set appropriately. Of + * particular interest, it will return errno == EHOSTDOWN when the + * server is disconnected. After that event, the handle can no + * longer be used. * ****************************************************************************/ @@ -168,13 +174,14 @@ int nx_eventhandler(NXHANDLE handle) /* Dispatch the message appropriately */ msg = (struct nxsvrmsg_s *)buffer; + gvdbg("Received msgid=%d\n", msg->msgid); switch (msg->msgid) { - case NX_SVRMSG_CONNECT: + case NX_CLIMSG_CONNECTED: nx_connected(conn); break; - case NX_SVRMSG_DISCONNECT: + case NX_CLIMSG_DISCONNECTED: nx_disconnected(conn); errno = EHOSTDOWN; return ERROR; |