summaryrefslogtreecommitdiffstats
path: root/nuttx
diff options
context:
space:
mode:
authorpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-05-17 19:32:48 +0000
committerpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-05-17 19:32:48 +0000
commitac2c06a9b1477ca353bae82e4801ff7bdea5a2e8 (patch)
tree8c587dcf2a7a151343d5b046915c59e3819d0222 /nuttx
parentfd35ad483e4fef69ce1b82352d26ddaeb2f9f2da (diff)
Re-factor NX messaging logic in preparation for a new message control feature
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4744 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx')
-rw-r--r--nuttx/ChangeLog3
-rw-r--r--nuttx/graphics/nxmu/Make.defs4
-rw-r--r--nuttx/graphics/nxmu/nx_bitmap.c14
-rw-r--r--nuttx/graphics/nxmu/nx_closewindow.c15
-rw-r--r--nuttx/graphics/nxmu/nx_connect.c14
-rw-r--r--nuttx/graphics/nxmu/nx_disconnect.c19
-rw-r--r--nuttx/graphics/nxmu/nx_fill.c14
-rw-r--r--nuttx/graphics/nxmu/nx_filltrapezoid.c13
-rw-r--r--nuttx/graphics/nxmu/nx_getposition.c16
-rw-r--r--nuttx/graphics/nxmu/nx_getrectangle.c10
-rw-r--r--nuttx/graphics/nxmu/nx_kbdchin.c14
-rw-r--r--nuttx/graphics/nxmu/nx_kbdin.c12
-rw-r--r--nuttx/graphics/nxmu/nx_lower.c14
-rw-r--r--nuttx/graphics/nxmu/nx_mousein.c12
-rw-r--r--nuttx/graphics/nxmu/nx_move.c12
-rw-r--r--nuttx/graphics/nxmu/nx_raise.c12
-rw-r--r--nuttx/graphics/nxmu/nx_releasebkgd.c9
-rw-r--r--nuttx/graphics/nxmu/nx_requestbkgd.c13
-rw-r--r--nuttx/graphics/nxmu/nx_setbgcolor.c12
-rw-r--r--nuttx/graphics/nxmu/nx_setpixel.c12
-rw-r--r--nuttx/graphics/nxmu/nx_setposition.c16
-rw-r--r--nuttx/graphics/nxmu/nx_setsize.c16
-rw-r--r--nuttx/graphics/nxmu/nxfe.h60
-rw-r--r--nuttx/graphics/nxmu/nxmu_constructwindow.c15
-rw-r--r--nuttx/graphics/nxmu/nxmu_kbdin.c11
-rw-r--r--nuttx/graphics/nxmu/nxmu_mouse.c9
-rw-r--r--nuttx/graphics/nxmu/nxmu_redrawreq.c11
-rw-r--r--nuttx/graphics/nxmu/nxmu_reportposition.c8
-rw-r--r--nuttx/graphics/nxmu/nxmu_server.c9
29 files changed, 156 insertions, 243 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog
index efa09c0be5..944fd5718d 100644
--- a/nuttx/ChangeLog
+++ b/nuttx/ChangeLog
@@ -2772,4 +2772,7 @@
* configs/stm3240g-eval/nxwm/defconfig: The default NxWM not uses the STMPE11
touchscreen.
* include/cxx/csched: Added
+ * graphic/nxmu/nxmu_sendserver.c, nxmu_sendwindow.c, and nxmu_sendclient.c:
+ Refactor NX messaging logic in preparation for a new message control
+ feature.
diff --git a/nuttx/graphics/nxmu/Make.defs b/nuttx/graphics/nxmu/Make.defs
index 6b4295290a..b1370640c2 100644
--- a/nuttx/graphics/nxmu/Make.defs
+++ b/nuttx/graphics/nxmu/Make.defs
@@ -43,6 +43,6 @@ NXAPI_CSRCS = nx_bitmap.c nx_closewindow.c nx_connect.c nx_disconnect.c \
nx_fillcircle.c
NXMU_CSRCS = nxmu_constructwindow.c nxmu_kbdin.c nxmu_mouse.c \
nxmu_openwindow.c nxmu_redrawreq.c nxmu_releasebkgd.c \
- nxmu_requestbkgd.c nxmu_reportposition.c nxmu_semtake.c \
- nxmu_server.c
+ nxmu_requestbkgd.c nxmu_reportposition.c nxmu_sendclient.c \
+ nxmu_sendserver.c nxmu_sendwindow.c nxmu_semtake.c nxmu_server.c
NX_CSRCS = $(NXAPI_CSRCS) $(NXMU_CSRCS)
diff --git a/nuttx/graphics/nxmu/nx_bitmap.c b/nuttx/graphics/nxmu/nx_bitmap.c
index 6e16b2c34b..a86eda96ac 100644
--- a/nuttx/graphics/nxmu/nx_bitmap.c
+++ b/nuttx/graphics/nxmu/nx_bitmap.c
@@ -1,8 +1,8 @@
/****************************************************************************
* graphics/nxmu/nx_bitmap.c
*
- * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -99,11 +99,10 @@ int nx_bitmap(NXWINDOW hwnd, FAR const struct nxgl_rect_s *dest,
{
FAR struct nxbe_window_s *wnd = (FAR struct nxbe_window_s *)hwnd;
struct nxsvrmsg_bitmap_s outmsg;
- int ret;
int i;
#ifdef CONFIG_DEBUG
- if (!wnd || !wnd->conn || !dest || !src || !origin)
+ if (!wnd || !dest || !src || !origin)
{
errno = EINVAL;
return ERROR;
@@ -127,10 +126,5 @@ int nx_bitmap(NXWINDOW hwnd, FAR const struct nxgl_rect_s *dest,
/* Forward the fill command to the server */
- ret = mq_send(wnd->conn->cwrmq, &outmsg, sizeof(struct nxsvrmsg_bitmap_s), NX_SVRMSG_PRIO);
- if (ret < 0)
- {
- gdbg("mq_send failed: %d\n", errno);
- }
- return ret;
+ return nxmu_sendwindow(wnd, &outmsg, sizeof(struct nxsvrmsg_bitmap_s));
}
diff --git a/nuttx/graphics/nxmu/nx_closewindow.c b/nuttx/graphics/nxmu/nx_closewindow.c
index 22583f41b6..f9722fcd2a 100644
--- a/nuttx/graphics/nxmu/nx_closewindow.c
+++ b/nuttx/graphics/nxmu/nx_closewindow.c
@@ -1,8 +1,8 @@
/****************************************************************************
* graphics/nxmu/nx_closewindow.c
*
- * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -88,20 +88,13 @@
int nx_closewindow(NXWINDOW hwnd)
{
FAR struct nxbe_window_s *wnd = (FAR struct nxbe_window_s *)hwnd;
- FAR struct nxfe_conn_s *conn = wnd->conn;
struct nxsvrmsg_closewindow_s outmsg;
- int ret;
- /* Request destruction of the window by the serer */
+ /* Request destruction of the window by the server */
outmsg.msgid = NX_SVRMSG_CLOSEWINDOW;
outmsg.wnd = wnd;
- ret = mq_send(conn->cwrmq, &outmsg, sizeof(struct nxsvrmsg_closewindow_s), NX_SVRMSG_PRIO);
- if (ret < 0)
- {
- gdbg("mq_send failed: %d\n", errno);
- }
- return ret;
+ return nxmu_sendserver(wnd->conn, &outmsg, sizeof(struct nxsvrmsg_closewindow_s));
}
diff --git a/nuttx/graphics/nxmu/nx_connect.c b/nuttx/graphics/nxmu/nx_connect.c
index e872f35058..4d91b54d5b 100644
--- a/nuttx/graphics/nxmu/nx_connect.c
+++ b/nuttx/graphics/nxmu/nx_connect.c
@@ -1,8 +1,8 @@
/****************************************************************************
* graphics/nxmu/nx_connect.c
*
- * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -113,7 +113,7 @@ static uint32_t g_nxcid = 1;
NXHANDLE nx_connectinstance(FAR const char *svrmqname)
{
FAR struct nxfe_conn_s *conn;
- struct nxsvrmsg_s msg;
+ struct nxsvrmsg_s outmsg;
char climqname[NX_CLIENT_MXNAMELEN];
struct mq_attr attr;
int ret;
@@ -177,13 +177,13 @@ NXHANDLE nx_connectinstance(FAR const char *svrmqname)
/* Inform the server that this client exists */
- msg.msgid = NX_SVRMSG_CONNECT;
- msg.conn = conn;
+ outmsg.msgid = NX_SVRMSG_CONNECT;
+ outmsg.conn = conn;
- ret = mq_send(conn->cwrmq, &msg, sizeof(struct nxsvrmsg_s), NX_SVRMSG_PRIO);
+ ret = nxmu_sendserver(conn, &outmsg, sizeof(struct nxsvrmsg_s));
if (ret < 0)
{
- gdbg("mq_send failed: %d\n", errno);
+ gdbg("nxmu_sendserver failed: %d\n", errno);
goto errout_with_wmq;
}
diff --git a/nuttx/graphics/nxmu/nx_disconnect.c b/nuttx/graphics/nxmu/nx_disconnect.c
index f4711b0053..bbbf05251b 100644
--- a/nuttx/graphics/nxmu/nx_disconnect.c
+++ b/nuttx/graphics/nxmu/nx_disconnect.c
@@ -1,8 +1,8 @@
/****************************************************************************
* graphics/nxmu/nx_disconnect.c
*
- * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -89,20 +89,15 @@
void nx_disconnect(NXHANDLE handle)
{
FAR struct nxfe_conn_s *conn = (FAR struct nxfe_conn_s *)handle;
- struct nxsvrmsg_s msg;
- int ret;
+ struct nxsvrmsg_s outmsg;
/* Inform the server that this client no longer exists */
- msg.msgid = NX_SVRMSG_DISCONNECT;
- msg.conn = conn;
-
- ret = mq_send(conn->cwrmq, &msg, sizeof(struct nxsvrmsg_s), NX_SVRMSG_PRIO);
- if (ret < 0)
- {
- gdbg("mq_send failed: %d\n", errno);
- }
+ outmsg.msgid = NX_SVRMSG_DISCONNECT;
+ outmsg.conn = conn;
/* We will finish the teardown upon receipt of the DISCONNECTED message */
+
+ return nxmu_sendserver(conn, &outmsg, sizeof(struct nxsvrmsg_s));
}
diff --git a/nuttx/graphics/nxmu/nx_fill.c b/nuttx/graphics/nxmu/nx_fill.c
index 1b75cd9748..969acdace0 100644
--- a/nuttx/graphics/nxmu/nx_fill.c
+++ b/nuttx/graphics/nxmu/nx_fill.c
@@ -1,8 +1,8 @@
/****************************************************************************
* graphics/nxmu/nx_fill.c
*
- * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -93,10 +93,9 @@ int nx_fill(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
{
FAR struct nxbe_window_s *wnd = (FAR struct nxbe_window_s *)hwnd;
struct nxsvrmsg_fill_s outmsg;
- int ret;
#ifdef CONFIG_DEBUG
- if (!wnd || !wnd->conn || !rect || !color)
+ if (!wnd || !rect || !color)
{
errno = EINVAL;
return ERROR;
@@ -113,10 +112,5 @@ int nx_fill(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
/* Forward the fill command to the server */
- ret = mq_send(wnd->conn->cwrmq, &outmsg, sizeof(struct nxsvrmsg_fill_s), NX_SVRMSG_PRIO);
- if (ret < 0)
- {
- gdbg("mq_send failed: %d\n", errno);
- }
- return ret;
+ return nxmu_sendwindow(wnd, &outmsg, sizeof(struct nxsvrmsg_fill_s));
}
diff --git a/nuttx/graphics/nxmu/nx_filltrapezoid.c b/nuttx/graphics/nxmu/nx_filltrapezoid.c
index f0a55fc622..bf289179e0 100644
--- a/nuttx/graphics/nxmu/nx_filltrapezoid.c
+++ b/nuttx/graphics/nxmu/nx_filltrapezoid.c
@@ -94,14 +94,13 @@ int nx_filltrapezoid(NXWINDOW hwnd, FAR const struct nxgl_rect_s *clip,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES])
{
FAR struct nxbe_window_s *wnd = (FAR struct nxbe_window_s *)hwnd;
- struct nxsvrmsg_filltrapezoid_s outmsg;
- int ret;
+ struct nxsvrmsg_filltrapezoid_s outmsg;
int i;
/* Some debug-only sanity checks */
#ifdef CONFIG_DEBUG
- if (!wnd || !wnd->conn || !trap || !color)
+ if (!wnd || !trap || !color)
{
errno = EINVAL;
return ERROR;
@@ -139,11 +138,5 @@ int nx_filltrapezoid(NXWINDOW hwnd, FAR const struct nxgl_rect_s *clip,
/* Forward the trapezoid fill command to the server */
- ret = mq_send(wnd->conn->cwrmq, &outmsg,
- sizeof(struct nxsvrmsg_filltrapezoid_s), NX_SVRMSG_PRIO);
- if (ret < 0)
- {
- gdbg("mq_send failed: %d\n", errno);
- }
- return ret;
+ return nxmu_sendwindow(wnd, &outmsg, sizeof(struct nxsvrmsg_filltrapezoid_s));
}
diff --git a/nuttx/graphics/nxmu/nx_getposition.c b/nuttx/graphics/nxmu/nx_getposition.c
index d53ddf14b6..06ad2c6aa0 100644
--- a/nuttx/graphics/nxmu/nx_getposition.c
+++ b/nuttx/graphics/nxmu/nx_getposition.c
@@ -1,8 +1,8 @@
/****************************************************************************
* graphics/nxmu/nx_getposition.c
*
- * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -87,9 +87,8 @@
int nx_getposition(NXWINDOW hwnd)
{
- FAR struct nxbe_window_s *wnd = (FAR struct nxbe_window_s *)hwnd;
+ FAR struct nxbe_window_s *wnd = (FAR struct nxbe_window_s *)hwnd;
struct nxsvrmsg_getposition_s outmsg;
- int ret;
#ifdef CONFIG_DEBUG
if (!wnd)
@@ -111,12 +110,5 @@ int nx_getposition(NXWINDOW hwnd)
outmsg.msgid = NX_SVRMSG_GETPOSITION;
outmsg.wnd = wnd;
- ret = mq_send(wnd->conn->cwrmq, &outmsg, sizeof(struct nxsvrmsg_getposition_s), NX_SVRMSG_PRIO);
- if (ret < 0)
- {
- gdbg("mq_send failed: %d\n", errno);
- return ERROR;
- }
-
- return OK;
+ return nxmu_sendwindow(wnd, &outmsg, sizeof(struct nxsvrmsg_getposition_s));
}
diff --git a/nuttx/graphics/nxmu/nx_getrectangle.c b/nuttx/graphics/nxmu/nx_getrectangle.c
index 85393f7d26..f32065129c 100644
--- a/nuttx/graphics/nxmu/nx_getrectangle.c
+++ b/nuttx/graphics/nxmu/nx_getrectangle.c
@@ -1,7 +1,7 @@
/****************************************************************************
* graphics/nxmu/nx_getrectangle.c
*
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -98,7 +98,6 @@ int nx_getrectangle(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
{
FAR struct nxbe_window_s *wnd = (FAR struct nxbe_window_s *)hwnd;
struct nxsvrmsg_getrectangle_s outmsg;
- int ret;
#ifdef CONFIG_DEBUG
if (!hwnd || !rect || !dest)
@@ -121,10 +120,5 @@ int nx_getrectangle(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
/* Forward the fill command to the server */
- ret = mq_send(wnd->conn->cwrmq, &outmsg, sizeof(struct nxsvrmsg_getrectangle_s), NX_SVRMSG_PRIO);
- if (ret < 0)
- {
- gdbg("mq_send failed: %d\n", errno);
- }
- return ret;
+ return nxmu_sendwindow(wnd, &outmsg, sizeof(struct nxsvrmsg_getrectangle_s));
}
diff --git a/nuttx/graphics/nxmu/nx_kbdchin.c b/nuttx/graphics/nxmu/nx_kbdchin.c
index 9393e12539..6c7019f513 100644
--- a/nuttx/graphics/nxmu/nx_kbdchin.c
+++ b/nuttx/graphics/nxmu/nx_kbdchin.c
@@ -1,8 +1,8 @@
/****************************************************************************
* graphics/nxmu/nx_kbdchin.c
*
- * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -85,8 +85,7 @@
int nx_kbdchin(NXHANDLE handle, uint8_t ch)
{
FAR struct nxfe_conn_s *conn = (FAR struct nxfe_conn_s *)handle;
- struct nxsvrmsg_kbdin_s outmsg;
- int ret;
+ struct nxsvrmsg_kbdin_s outmsg;
/* Inform the server of the new keypad data */
@@ -94,12 +93,7 @@ int nx_kbdchin(NXHANDLE handle, uint8_t ch)
outmsg.nch = 1;
outmsg.ch[0] = ch;
- ret = mq_send(conn->cwrmq, &outmsg, sizeof(struct nxsvrmsg_kbdin_s), NX_SVRMSG_PRIO);
- if (ret < 0)
- {
- gdbg("mq_send failed: %d\n", errno);
- }
- return ret;
+ return nxmu_sendserver(conn, &outmsg, sizeof(struct nxsvrmsg_kbdin_s));
}
#endif /* CONFIG_NX_KBD */
diff --git a/nuttx/graphics/nxmu/nx_kbdin.c b/nuttx/graphics/nxmu/nx_kbdin.c
index c265f86c19..ac044bec70 100644
--- a/nuttx/graphics/nxmu/nx_kbdin.c
+++ b/nuttx/graphics/nxmu/nx_kbdin.c
@@ -1,8 +1,8 @@
/****************************************************************************
* graphics/nxmu/nx_kbdin.c
*
- * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -85,7 +85,7 @@
int nx_kbdin(NXHANDLE handle, uint8_t nch, FAR const uint8_t *ch)
{
- FAR struct nxfe_conn_s *conn = (FAR struct nxfe_conn_s *)handle;
+ FAR struct nxfe_conn_s *conn = (FAR struct nxfe_conn_s *)handle;
FAR struct nxsvrmsg_kbdin_s *outmsg;
int size;
int ret;
@@ -113,11 +113,7 @@ int nx_kbdin(NXHANDLE handle, uint8_t nch, FAR const uint8_t *ch)
outmsg->ch[i] = ch[i];
}
- ret = mq_send(conn->cwrmq, outmsg, size, NX_SVRMSG_PRIO);
- if (ret < 0)
- {
- gdbg("mq_send failed: %d\n", errno);
- }
+ ret = nxmu_sendserver(conn, &outmsg, size);
free(outmsg);
return ret;
diff --git a/nuttx/graphics/nxmu/nx_lower.c b/nuttx/graphics/nxmu/nx_lower.c
index 6ff57c7820..c9505ca49a 100644
--- a/nuttx/graphics/nxmu/nx_lower.c
+++ b/nuttx/graphics/nxmu/nx_lower.c
@@ -1,8 +1,8 @@
/****************************************************************************
* graphics/nxmu/nx_lower.c
*
- * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -86,19 +86,13 @@
int nx_lower(NXWINDOW hwnd)
{
FAR struct nxbe_window_s *wnd = (FAR struct nxbe_window_s *)hwnd;
- struct nxsvrmsg_lower_s outmsg;
- int ret;
+ struct nxsvrmsg_lower_s outmsg;
/* Send the RAISE message */
outmsg.msgid = NX_SVRMSG_LOWER;
outmsg.wnd = wnd;
- ret = mq_send(wnd->conn->cwrmq, &outmsg, sizeof(struct nxsvrmsg_lower_s), NX_SVRMSG_PRIO);
- if (ret < 0)
- {
- gdbg("mq_send failed: %d\n", errno);
- }
- return ret;
+ return nxmu_sendwindow(wnd, &outmsg, sizeof(struct nxsvrmsg_lower_s));
}
diff --git a/nuttx/graphics/nxmu/nx_mousein.c b/nuttx/graphics/nxmu/nx_mousein.c
index 10d32afbb3..e84278539c 100644
--- a/nuttx/graphics/nxmu/nx_mousein.c
+++ b/nuttx/graphics/nxmu/nx_mousein.c
@@ -1,8 +1,8 @@
/****************************************************************************
* graphics/nxmu/nx_mousein.c
*
- * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -86,7 +86,6 @@ int nx_mousein(NXHANDLE handle, nxgl_coord_t x, nxgl_coord_t y, uint8_t buttons)
{
FAR struct nxfe_conn_s *conn = (FAR struct nxfe_conn_s *)handle;
struct nxsvrmsg_mousein_s outmsg;
- int ret;
/* Inform the server that this client no longer exists */
@@ -95,12 +94,7 @@ int nx_mousein(NXHANDLE handle, nxgl_coord_t x, nxgl_coord_t y, uint8_t buttons)
outmsg.pt.y = y;
outmsg.buttons = buttons;
- ret = mq_send(conn->cwrmq, &outmsg, sizeof(struct nxsvrmsg_mousein_s), NX_SVRMSG_PRIO);
- if (ret < 0)
- {
- gdbg("mq_send failed: %d\n", errno);
- }
- return ret;
+ return nxmu_sendserver(conn, &outmsg, sizeof(struct nxsvrmsg_mousein_s));
}
#endif /* CONFIG_NX_MOUSE */
diff --git a/nuttx/graphics/nxmu/nx_move.c b/nuttx/graphics/nxmu/nx_move.c
index 3f4a00e2ff..c8d4d3dfde 100644
--- a/nuttx/graphics/nxmu/nx_move.c
+++ b/nuttx/graphics/nxmu/nx_move.c
@@ -89,11 +89,10 @@ int nx_move(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
FAR const struct nxgl_point_s *offset)
{
FAR struct nxbe_window_s *wnd = (FAR struct nxbe_window_s *)hwnd;
- struct nxsvrmsg_move_s outmsg;
- int ret;
+ struct nxsvrmsg_move_s outmsg;
#ifdef CONFIG_DEBUG
- if (!wnd || !wnd->conn)
+ if (!wnd)
{
errno = EINVAL;
return ERROR;
@@ -111,10 +110,5 @@ int nx_move(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
/* Forward the fill command to the server */
- ret = mq_send(wnd->conn->cwrmq, &outmsg, sizeof(struct nxsvrmsg_move_s), NX_SVRMSG_PRIO);
- if (ret < 0)
- {
- gdbg("mq_send failed: %d\n", errno);
- }
- return ret;
+ return nxmu_sendwindow(wnd, &outmsg, sizeof(struct nxsvrmsg_move_s));
}
diff --git a/nuttx/graphics/nxmu/nx_raise.c b/nuttx/graphics/nxmu/nx_raise.c
index 78508d7497..4f51810f19 100644
--- a/nuttx/graphics/nxmu/nx_raise.c
+++ b/nuttx/graphics/nxmu/nx_raise.c
@@ -1,8 +1,8 @@
/****************************************************************************
* graphics/nxmu/nx_raise.c
*
- * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -87,18 +87,12 @@ int nx_raise(NXWINDOW hwnd)
{
FAR struct nxbe_window_s *wnd = (FAR struct nxbe_window_s *)hwnd;
struct nxsvrmsg_raise_s outmsg;
- int ret;
/* Send the RAISE message */
outmsg.msgid = NX_SVRMSG_RAISE;
outmsg.wnd = wnd;
- ret = mq_send(wnd->conn->cwrmq, &outmsg, sizeof(struct nxsvrmsg_raise_s), NX_SVRMSG_PRIO);
- if (ret < 0)
- {
- gdbg("mq_send failed: %d\n", errno);
- }
- return ret;
+ return nxmu_sendwindow(wnd, &outmsg, sizeof(struct nxsvrmsg_raise_s));
}
diff --git a/nuttx/graphics/nxmu/nx_releasebkgd.c b/nuttx/graphics/nxmu/nx_releasebkgd.c
index 99815b1e71..9725856633 100644
--- a/nuttx/graphics/nxmu/nx_releasebkgd.c
+++ b/nuttx/graphics/nxmu/nx_releasebkgd.c
@@ -88,7 +88,6 @@ int nx_releasebkgd(NXWINDOW hwnd)
{
FAR struct nxbe_window_s *wnd = (FAR struct nxbe_window_s *)hwnd;
struct nxsvrmsg_releasebkgd_s outmsg;
- int ret;
#ifdef CONFIG_DEBUG
if (!wnd)
@@ -101,12 +100,6 @@ int nx_releasebkgd(NXWINDOW hwnd)
/* Request access to the background window from the server */
outmsg.msgid = NX_SVRMSG_RELEASEBKGD;
- ret = mq_send(wnd->conn->cwrmq, &outmsg, sizeof(struct nxsvrmsg_releasebkgd_s), NX_SVRMSG_PRIO);
- if (ret < 0)
- {
- gdbg("mq_send failed: %d\n", errno);
- return ERROR;
- }
- return OK;
+ return nxmu_sendserver(wnd->conn, &outmsg, sizeof(struct nxsvrmsg_releasebkgd_s));
}
diff --git a/nuttx/graphics/nxmu/nx_requestbkgd.c b/nuttx/graphics/nxmu/nx_requestbkgd.c
index e6367a4f76..c8f71ab2a6 100644
--- a/nuttx/graphics/nxmu/nx_requestbkgd.c
+++ b/nuttx/graphics/nxmu/nx_requestbkgd.c
@@ -1,8 +1,8 @@
/****************************************************************************
* graphics/nxmu/nx_requestbkgd.c
*
- * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -115,7 +115,6 @@ int nx_requestbkgd(NXHANDLE handle, FAR const struct nx_callback_s *cb,
{
FAR struct nxfe_conn_s *conn = (FAR struct nxfe_conn_s *)handle;
struct nxsvrmsg_requestbkgd_s outmsg;
- int ret;
#ifdef CONFIG_DEBUG
if (!conn || !cb)
@@ -132,12 +131,6 @@ int nx_requestbkgd(NXHANDLE handle, FAR const struct nx_callback_s *cb,
outmsg.cb = cb;
outmsg.arg = arg;
- ret = mq_send(conn->cwrmq, &outmsg, sizeof(struct nxsvrmsg_requestbkgd_s), NX_SVRMSG_PRIO);
- if (ret < 0)
- {
- gdbg("mq_send failed: %d\n", errno);
- return ERROR;
- }
- return OK;
+ return nxmu_sendserver(conn, &outmsg, sizeof(struct nxsvrmsg_requestbkgd_s));
}
diff --git a/nuttx/graphics/nxmu/nx_setbgcolor.c b/nuttx/graphics/nxmu/nx_setbgcolor.c
index c2346fb390..63fca5f552 100644
--- a/nuttx/graphics/nxmu/nx_setbgcolor.c
+++ b/nuttx/graphics/nxmu/nx_setbgcolor.c
@@ -1,8 +1,8 @@
/****************************************************************************
* graphics/nxmu/nx_setbgcolor.c
*
- * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -89,7 +89,6 @@ int nx_setbgcolor(NXHANDLE handle,
{
FAR struct nxfe_conn_s *conn = (FAR struct nxfe_conn_s *)handle;
struct nxsvrmsg_setbgcolor_s outmsg;
- int ret;
#ifdef CONFIG_DEBUG
if (!conn)
@@ -106,10 +105,5 @@ int nx_setbgcolor(NXHANDLE handle,
/* Forward the fill command to the server */
- ret = mq_send(conn->cwrmq, &outmsg, sizeof(struct nxsvrmsg_setbgcolor_s), NX_SVRMSG_PRIO);
- if (ret < 0)
- {
- gdbg("mq_send failed: %d\n", errno);
- }
- return ret;
+ return nxmu_sendserver(conn, &outmsg, sizeof(struct nxsvrmsg_setbgcolor_s));
}
diff --git a/nuttx/graphics/nxmu/nx_setpixel.c b/nuttx/graphics/nxmu/nx_setpixel.c
index 35617646e2..57fc12cc6f 100644
--- a/nuttx/graphics/nxmu/nx_setpixel.c
+++ b/nuttx/graphics/nxmu/nx_setpixel.c
@@ -1,7 +1,7 @@
/****************************************************************************
* graphics/nxmu/nx_setpixel.c
*
- * Copyright (C) 2011 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -94,10 +94,9 @@ int nx_setpixel(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos,
{
FAR struct nxbe_window_s *wnd = (FAR struct nxbe_window_s *)hwnd;
struct nxsvrmsg_setpixel_s outmsg;
- int ret;
#ifdef CONFIG_DEBUG
- if (!wnd || !wnd->conn || !pos || !color)
+ if (!wnd || !pos || !color)
{
set_errno(EINVAL);
return ERROR;
@@ -115,10 +114,5 @@ int nx_setpixel(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos,
/* Forward the fill command to the server */
- ret = mq_send(wnd->conn->cwrmq, &outmsg, sizeof(struct nxsvrmsg_setpixel_s), NX_SVRMSG_PRIO);
- if (ret < 0)
- {
- gdbg("mq_send failed: %d\n", errno);
- }
- return ret;
+ return nxmu_sendwindow(wnd, &outmsg, sizeof(struct nxsvrmsg_setpixel_s));
}
diff --git a/nuttx/graphics/nxmu/nx_setposition.c b/nuttx/graphics/nxmu/nx_setposition.c
index 1e59c10e27..75b33757a8 100644
--- a/nuttx/graphics/nxmu/nx_setposition.c
+++ b/nuttx/graphics/nxmu/nx_setposition.c
@@ -1,8 +1,8 @@
/****************************************************************************
* graphics/nxmu/nx_setposition.c
*
- * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -86,9 +86,8 @@
int nx_setposition(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos)
{
- FAR struct nxbe_window_s *wnd = (FAR struct nxbe_window_s *)hwnd;
+ FAR struct nxbe_window_s *wnd = (FAR struct nxbe_window_s *)hwnd;
struct nxsvrmsg_setposition_s outmsg;
- int ret;
#ifdef CONFIG_DEBUG
if (!wnd || !pos)
@@ -105,12 +104,5 @@ int nx_setposition(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos)
outmsg.pos.x = pos->x;
outmsg.pos.y = pos->y;
- ret = mq_send(wnd->conn->cwrmq, &outmsg, sizeof(struct nxsvrmsg_setposition_s), NX_SVRMSG_PRIO);
- if (ret < 0)
- {
- gdbg("mq_send failed: %d\n", errno);
- return ERROR;
- }
-
- return OK;
+ return nxmu_sendwindow(wnd, &outmsg, sizeof(struct nxsvrmsg_setposition_s));
}
diff --git a/nuttx/graphics/nxmu/nx_setsize.c b/nuttx/graphics/nxmu/nx_setsize.c
index 5655e61a29..5f538bccca 100644
--- a/nuttx/graphics/nxmu/nx_setsize.c
+++ b/nuttx/graphics/nxmu/nx_setsize.c
@@ -1,8 +1,8 @@
/****************************************************************************
* graphics/nxmu/nx_setsize.c
*
- * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -86,9 +86,8 @@
int nx_setsize(NXWINDOW hwnd, FAR const struct nxgl_size_s *size)
{
- FAR struct nxbe_window_s *wnd = (FAR struct nxbe_window_s *)hwnd;
+ FAR struct nxbe_window_s *wnd = (FAR struct nxbe_window_s *)hwnd;
struct nxsvrmsg_setsize_s outmsg;
- int ret;
#ifdef CONFIG_DEBUG
if (!wnd || !size)
@@ -105,12 +104,5 @@ int nx_setsize(NXWINDOW hwnd, FAR const struct nxgl_size_s *size)
outmsg.size.w = size->w;
outmsg.size.h = size->h;
- ret = mq_send(wnd->conn->cwrmq, &outmsg, sizeof(struct nxsvrmsg_setsize_s), NX_SVRMSG_PRIO);
- if (ret < 0)
- {
- gdbg("mq_send failed: %d\n", errno);
- return ERROR;
- }
-
- return OK;
+ return nxmu_sendwindow(wnd, &outmsg, sizeof(struct nxsvrmsg_setsize_s));
}
diff --git a/nuttx/graphics/nxmu/nxfe.h b/nuttx/graphics/nxmu/nxfe.h
index b2f906f166..2b87b2a406 100644
--- a/nuttx/graphics/nxmu/nxfe.h
+++ b/nuttx/graphics/nxmu/nxfe.h
@@ -1,7 +1,7 @@
/****************************************************************************
* graphics/nxmu/nxfe.h
*
- * Copyright (C) 2008-2011 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2008-2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -503,6 +503,64 @@ EXTERN int nxfe_constructwindow(NXHANDLE handle,
EXTERN void nxmu_semtake(sem_t *sem);
/****************************************************************************
+ * Name: nxmu_sendserver
+ *
+ * Description:
+ * Send a message to the server at NX_SVRMSG_PRIO priority
+ *
+ * Input Parameters:
+ * conn - A pointer to the server connection structure
+ * msg - A pointer to the message to send
+ * msglen - The length of the message in bytes.
+ *
+ * Return:
+ * OK on success; ERROR on failure with errno set appropriately
+ *
+ ****************************************************************************/
+
+EXTERN int nxmu_sendserver(FAR struct nxfe_conn_s *conn,
+ FAR const void *msg, size_t msglen);
+
+/****************************************************************************
+ * Name: nxmu_sendwindow
+ *
+ * Description:
+ * Send a message to the server detined for a specific window at
+ * NX_SVRMSG_PRIO priority
+ *
+ * Input Parameters:
+ * wnd - A pointer to the back-end window structure
+ * msg - A pointer to the message to send
+ * msglen - The length of the message in bytes.
+ *
+ * Return:
+ * OK on success; ERROR on failure with errno set appropriately
+ *
+ ****************************************************************************/
+
+EXTERN int nxmu_sendwindow(FAR struct nxbe_window_s *wnd, FAR const void *msg,
+ size_t msglen);
+
+/****************************************************************************
+ * Name: nxmu_sendclient
+ *
+ * Description:
+ * Send a message to the client at NX_CLIMSG_PRIO priority
+ *
+ * Input Parameters:
+ * conn - A pointer to the server connection structure
+ * msg - A pointer to the message to send
+ * msglen - The length of the message in bytes.
+ *
+ * Return:
+ * OK on success; ERROR on failure with errno set appropriately
+ *
+ ****************************************************************************/
+
+EXTERN int nxmu_sendclient(FAR struct nxfe_conn_s *conn,
+ FAR const void *msg, size_t msglen);
+
+/****************************************************************************
* Name: nxmu_openwindow
*
* Description:
diff --git a/nuttx/graphics/nxmu/nxmu_constructwindow.c b/nuttx/graphics/nxmu/nxmu_constructwindow.c
index 86df90e286..e5f6dcc9ab 100644
--- a/nuttx/graphics/nxmu/nxmu_constructwindow.c
+++ b/nuttx/graphics/nxmu/nxmu_constructwindow.c
@@ -1,8 +1,8 @@
/****************************************************************************
* graphics/nxmu/nx_openwindow.c
*
- * Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2008, 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -103,7 +103,6 @@ int nxfe_constructwindow(NXHANDLE handle, FAR struct nxbe_window_s *wnd,
{
FAR struct nxfe_conn_s *conn = (FAR struct nxfe_conn_s *)handle;
struct nxsvrmsg_openwindow_s outmsg;
- int ret;
#ifdef CONFIG_DEBUG
if (!wnd)
@@ -133,14 +132,6 @@ int nxfe_constructwindow(NXHANDLE handle, FAR struct nxbe_window_s *wnd,
outmsg.msgid = NX_SVRMSG_OPENWINDOW;
outmsg.wnd = wnd;
- ret = mq_send(conn->cwrmq, &outmsg, sizeof(struct nxsvrmsg_openwindow_s), NX_SVRMSG_PRIO);
- if (ret < 0)
- {
- gdbg("mq_send failed: %d\n", errno);
- free(wnd);
- return ERROR;
- }
-
- return OK;
+ return nxmu_sendserver(conn, &outmsg, sizeof(struct nxsvrmsg_openwindow_s));
}
diff --git a/nuttx/graphics/nxmu/nxmu_kbdin.c b/nuttx/graphics/nxmu/nxmu_kbdin.c
index 334d525c07..2c658009bc 100644
--- a/nuttx/graphics/nxmu/nxmu_kbdin.c
+++ b/nuttx/graphics/nxmu/nxmu_kbdin.c
@@ -1,8 +1,8 @@
/****************************************************************************
* graphics/nxmu/nxmu_kbdin.c
*
- * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -87,7 +87,6 @@ void nxmu_kbdin(FAR struct nxfe_state_s *fe, uint8_t nch, FAR uint8_t *ch)
{
FAR struct nxclimsg_kbdin_s *outmsg;
int size;
- int ret;
int i;
/* Allocate a bigger message to account for the variable amount of
@@ -109,11 +108,7 @@ void nxmu_kbdin(FAR struct nxfe_state_s *fe, uint8_t nch, FAR uint8_t *ch)
outmsg->ch[i] = ch[i];
}
- ret = mq_send(fe->be.topwnd->conn->swrmq, outmsg, size, NX_SVRMSG_PRIO);
- if (ret < 0)
- {
- gdbg("mq_send failed: %d\n", errno);
- }
+ (void)nxmu_sendclient(fe->be.topwnd->conn, outmsg, size);
free(outmsg);
}
}
diff --git a/nuttx/graphics/nxmu/nxmu_mouse.c b/nuttx/graphics/nxmu/nxmu_mouse.c
index 1ae31bec2b..3ebe062d29 100644
--- a/nuttx/graphics/nxmu/nxmu_mouse.c
+++ b/nuttx/graphics/nxmu/nxmu_mouse.c
@@ -111,7 +111,6 @@ void nxmu_mouseinit(int x, int y)
int nxmu_mousereport(struct nxbe_window_s *wnd)
{
struct nxclimsg_mousein_s outmsg;
- int ret;
/* Does this window support mouse callbacks? */
@@ -130,13 +129,7 @@ int nxmu_mousereport(struct nxbe_window_s *wnd)
outmsg.buttons = g_mbutton;
nxgl_vectsubtract(&outmsg.pos, &g_mpos, &wnd->bounds.pt1);
- ret = mq_send(wnd->conn->swrmq, &outmsg,
- sizeof(struct nxclimsg_mousein_s), NX_SVRMSG_PRIO);
- if (ret < 0)
- {
- gdbg("mq_send failed: %d\n", errno);
- }
- return ret;
+ return nxmu_sendclient(wnd->conn, &outmsg, sizeof(struct nxclimsg_mousein_s));
}
}
diff --git a/nuttx/graphics/nxmu/nxmu_redrawreq.c b/nuttx/graphics/nxmu/nxmu_redrawreq.c
index e4f0f7b9ef..32ca477a26 100644
--- a/nuttx/graphics/nxmu/nxmu_redrawreq.c
+++ b/nuttx/graphics/nxmu/nxmu_redrawreq.c
@@ -1,8 +1,8 @@
/****************************************************************************
* graphics/nxmu/nxmu_redrawreq.c
*
- * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -81,18 +81,13 @@
void nxfe_redrawreq(FAR struct nxbe_window_s *wnd, FAR const struct nxgl_rect_s *rect)
{
struct nxclimsg_redraw_s outmsg;
- int ret;
outmsg.msgid = NX_CLIMSG_REDRAW;
outmsg.wnd = wnd;
outmsg.more = false;
nxgl_rectoffset(&outmsg.rect, rect, -wnd->bounds.pt1.x, -wnd->bounds.pt1.y);
- ret = mq_send(wnd->conn->swrmq, &outmsg, sizeof(struct nxclimsg_redraw_s), NX_CLIMSG_PRIO);
- if (ret < 0)
- {
- gdbg("mq_send failed: %d\n", errno);
- }
+ (void)nxmu_sendclient(wnd->conn, &outmsg, sizeof(struct nxclimsg_redraw_s));
}
diff --git a/nuttx/graphics/nxmu/nxmu_reportposition.c b/nuttx/graphics/nxmu/nxmu_reportposition.c
index 904198b222..f9b5f9dafa 100644
--- a/nuttx/graphics/nxmu/nxmu_reportposition.c
+++ b/nuttx/graphics/nxmu/nxmu_reportposition.c
@@ -1,8 +1,8 @@
/****************************************************************************
* graphics/nxmu/nxmu_reportposition.c
*
- * Copyright (C) 2008-2009, 2011 Gregory Nutt. All rights reserved.
- * Author: Gregory Nutt <spudmonkey@racsa.co.cr>
+ * Copyright (C) 2008-2009, 2011-2012 Gregory Nutt. All rights reserved.
+ * Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -100,9 +100,9 @@ void nxfe_reportposition(FAR struct nxbe_window_s *wnd)
/* And provide this to the client */
- ret = mq_send(wnd->conn->swrmq, &outmsg, sizeof(struct nxclimsg_newposition_s), NX_SVRMSG_PRIO);
+ ret = nxmu_sendclient(wnd->conn, &outmsg, sizeof(struct nxclimsg_newposition_s));
if (ret < 0)
{
- gdbg("mq_send failed: %d\n", errno);
+ gdbg("nxmu_sendclient failed: %d\n", errno);
}
}
diff --git a/nuttx/graphics/nxmu/nxmu_server.c b/nuttx/graphics/nxmu/nxmu_server.c
index fbd03464fd..6b6009e807 100644
--- a/nuttx/graphics/nxmu/nxmu_server.c
+++ b/nuttx/graphics/nxmu/nxmu_server.c
@@ -84,10 +84,10 @@ static inline void nxmu_disconnect(FAR struct nxfe_conn_s *conn)
outmsg.msgid = NX_CLIMSG_DISCONNECTED;
- ret = mq_send(conn->swrmq, &outmsg, sizeof(struct nxclimsg_disconnected_s), NX_CLIMSG_PRIO);
+ ret = nxmu_sendclient(conn, &outmsg, sizeof(struct nxclimsg_disconnected_s));
if (ret < 0)
{
- gdbg("mq_send failed: %d\n", errno);
+ gdbg("nxmu_sendclient failed: %d\n", errno);
}
/* Close the outgoing client message queue */
@@ -121,11 +121,10 @@ static inline void nxmu_connect(FAR struct nxfe_conn_s *conn)
/* Send the handshake message back to the client */
outmsg.msgid = NX_CLIMSG_CONNECTED;
-
- ret = mq_send(conn->swrmq, &outmsg, sizeof(struct nxclimsg_connected_s), NX_CLIMSG_PRIO);
+ ret = nxmu_sendclient(conn, &outmsg, sizeof(struct nxclimsg_connected_s));
if (ret < 0)
{
- gdbg("mq_send failed: %d\n", errno);
+ gdbg("nxmu_sendclient failed: %d\n", errno);
}
}