summaryrefslogtreecommitdiff
path: root/nuttx/graphics/nxmu
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/graphics/nxmu')
-rw-r--r--nuttx/graphics/nxmu/nx_kbdchin.c2
-rw-r--r--nuttx/graphics/nxmu/nx_kbdin.c11
-rw-r--r--nuttx/graphics/nxmu/nxfe.h8
-rw-r--r--nuttx/graphics/nxmu/nxmu_kbdin.c20
4 files changed, 21 insertions, 20 deletions
diff --git a/nuttx/graphics/nxmu/nx_kbdchin.c b/nuttx/graphics/nxmu/nx_kbdchin.c
index 4f16c1d28..e83c9a0a2 100644
--- a/nuttx/graphics/nxmu/nx_kbdchin.c
+++ b/nuttx/graphics/nxmu/nx_kbdchin.c
@@ -94,7 +94,7 @@ int nx_kbdchin(NXHANDLE handle, ubyte ch)
outmsg.nch = 1;
outmsg.ch[0] = ch;
- ret = mq_send(conn->c_cwrmq, &outmsg, sizeof(struct nxsvrmsg_kbdin_s), NX_SVRMSG_PRIO);
+ ret = mq_send(conn->cwrmq, &outmsg, sizeof(struct nxsvrmsg_kbdin_s), NX_SVRMSG_PRIO);
if (ret < 0)
{
gdbg("mq_send failed: %d\n", errno);
diff --git a/nuttx/graphics/nxmu/nx_kbdin.c b/nuttx/graphics/nxmu/nx_kbdin.c
index 46229a94e..e9665e89b 100644
--- a/nuttx/graphics/nxmu/nx_kbdin.c
+++ b/nuttx/graphics/nxmu/nx_kbdin.c
@@ -40,6 +40,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
+#include <stdlib.h>
#include <errno.h>
#include <debug.h>
@@ -82,7 +83,7 @@
*
****************************************************************************/
-int int nx_kbdin(NXHANDLE handle, ubyte nch const char *ch)
+int nx_kbdin(NXHANDLE handle, ubyte nch, FAR const ubyte *ch)
{
FAR struct nxfe_conn_s *conn = (FAR struct nxfe_conn_s *)handle;
FAR struct nxsvrmsg_kbdin_s *outmsg;
@@ -104,15 +105,15 @@ int int nx_kbdin(NXHANDLE handle, ubyte nch const char *ch)
/* Inform the server of the new keypad data */
- outsg->msgid = NX_SVRMSG_KBDIN;
- outmsg->nch = nch;
+ outmsg->msgid = NX_SVRMSG_KBDIN;
+ outmsg->nch = nch;
- for (i = 0; i < nch; i+)
+ for (i = 0; i < nch; i++)
{
outmsg->ch[i] = ch[i];
}
- ret = mq_send(conn->c_cwrmq, outmsg, size, NX_SVRMSG_PRIO);
+ ret = mq_send(conn->cwrmq, outmsg, size, NX_SVRMSG_PRIO);
if (ret < 0)
{
gdbg("mq_send failed: %d\n", errno);
diff --git a/nuttx/graphics/nxmu/nxfe.h b/nuttx/graphics/nxmu/nxfe.h
index e036bf675..47a804c49 100644
--- a/nuttx/graphics/nxmu/nxfe.h
+++ b/nuttx/graphics/nxmu/nxfe.h
@@ -237,11 +237,11 @@ struct nxclimsg_mousein_s
/* This message reports a new keypad event to a particular window */
#ifdef CONFIG_NX_KBD
-struct nxclimsg_key
+struct nxclimsg_kbdin_s
{
uint32 msgid; /* NX_CLIMSG_KBDIN */
FAR struct nxbe_window_s *wnd; /* The handle of window receiving keypad input */
- ubyte nch /* Number of characters received */
+ ubyte nch; /* Number of characters received */
ubyte ch[1]; /* Array of received characters */
};
#endif
@@ -408,7 +408,7 @@ struct nxsvrmsg_mousein_s
struct nxsvrmsg_kbdin_s
{
uint32 msgid; /* NX_SVRMSG_KBDIN */
- ubyte nch /* Number of characters received */
+ ubyte nch ; /* Number of characters received */
ubyte ch[1]; /* Array of received characters */
};
#endif
@@ -613,7 +613,7 @@ EXTERN int nxmu_mousein(FAR struct nxfe_state_s *fe,
****************************************************************************/
#ifdef CONFIG_NX_KBD
-EXTERN void nxmu_kbdin(FAR struct nxfe_state_s *fe, ubyte nch, ubyte *ch);
+EXTERN void nxmu_kbdin(FAR struct nxfe_state_s *fe, ubyte nch, FAR ubyte *ch);
#endif
#undef EXTERN
diff --git a/nuttx/graphics/nxmu/nxmu_kbdin.c b/nuttx/graphics/nxmu/nxmu_kbdin.c
index 35af516ae..903533357 100644
--- a/nuttx/graphics/nxmu/nxmu_kbdin.c
+++ b/nuttx/graphics/nxmu/nxmu_kbdin.c
@@ -40,6 +40,7 @@
#include <nuttx/config.h>
#include <sys/types.h>
+#include <stdlib.h>
#include <errno.h>
#include <debug.h>
@@ -82,10 +83,9 @@
*
****************************************************************************/
-void nxmu_kbdin(FAR struct nxs_server_s *svr, ubyte nch, ubyte *ch)
+void nxmu_kbdin(FAR struct nxfe_state_s *fe, ubyte nch, FAR ubyte *ch)
{
- struct nxbe_window_s *wnd;
- FAR struct nxclimgs_kbdin_s *outmsg;
+ FAR struct nxclimsg_kbdin_s *outmsg;
int size;
int ret;
int i;
@@ -94,22 +94,22 @@ void nxmu_kbdin(FAR struct nxs_server_s *svr, ubyte nch, ubyte *ch)
* character data.
*/
- size = sizeof(struct nxclimgs_kbdin_s) + nch - 1;
- outmsg = (FAR struct nxclimgs_kbdin_s *)malloc(size);
+ size = sizeof(struct nxclimsg_kbdin_s) + nch - 1;
+ outmsg = (FAR struct nxclimsg_kbdin_s *)malloc(size);
if (outmsg)
{
/* Give the keypad input only to the top child */
- outsg->msgid = NX_SVRMSG_KBDIN;
- outmsg->wnd = svr->topwnd;
- outmsg->nch = nch;
+ outmsg->msgid = NX_CLIMSG_KBDIN;
+ outmsg->wnd = fe->be.topwnd;
+ outmsg->nch = nch;
- for (i = 0; i < nch; i+)
+ for (i = 0; i < nch; i++)
{
outmsg->ch[i] = ch[i];
}
- ret = mq_send(svr->topwnd->conn->swrmq, outmsg, size, NX_SVRMSG_PRIO);
+ ret = mq_send(fe->be.topwnd->conn->swrmq, outmsg, size, NX_SVRMSG_PRIO);
if (ret < 0)
{
gdbg("mq_send failed: %d\n", errno);