Various graphics apps: If CONFIG_VNCSERVER=y, don't vnc_default_fbinitialize() directly. That is a violation of the portable POSIX interface. Instead, call boardctl(BOARDIOC_VNC_START);.
This commit is contained in:
parent
84922406f7
commit
61eb262142
@ -1,7 +1,8 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/nx/nx_main.c
|
* examples/nx/nx_main.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2011, 2015-2016 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2008-2011, 2015-2016, 2019 Gregory Nutt. All rights
|
||||||
|
* reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -56,10 +57,6 @@
|
|||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include <nuttx/board.h>
|
#include <nuttx/board.h>
|
||||||
|
|
||||||
#ifdef CONFIG_VNCSERVER
|
|
||||||
# include <nuttx/video/vnc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <nuttx/nx/nx.h>
|
#include <nuttx/nx/nx.h>
|
||||||
#include <nuttx/nx/nxtk.h>
|
#include <nuttx/nx/nxtk.h>
|
||||||
#include <nuttx/nx/nxfonts.h>
|
#include <nuttx/nx/nxfonts.h>
|
||||||
@ -458,15 +455,21 @@ static int nxeg_initialize(void)
|
|||||||
#ifdef CONFIG_VNCSERVER
|
#ifdef CONFIG_VNCSERVER
|
||||||
/* Setup the VNC server to support keyboard/mouse inputs */
|
/* Setup the VNC server to support keyboard/mouse inputs */
|
||||||
|
|
||||||
ret = vnc_default_fbinitialize(0, g_hnx);
|
struct boardioc_vncstart_s vnc =
|
||||||
if (ret < 0)
|
{
|
||||||
{
|
0, g_hnx
|
||||||
printf("vnc_default_fbinitialize failed: %d\n", ret);
|
};
|
||||||
nx_disconnect(g_hnx);
|
|
||||||
g_exitcode = NXEXIT_FBINITIALIZE;
|
ret = boardctl(BOARDIOC_VNC_START, (uintptr_t)&vnc);
|
||||||
return ERROR;
|
if (ret < 0)
|
||||||
}
|
{
|
||||||
|
printf("boardctl(BOARDIOC_VNC_START) failed: %d\n", ret);
|
||||||
|
nx_disconnect(g_hnx);
|
||||||
|
g_exitcode = NXEXIT_FBINITIALIZE;
|
||||||
|
return ERROR;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Start a separate thread to listen for server events. This is probably
|
/* Start a separate thread to listen for server events. This is probably
|
||||||
* the least efficient way to do this, but it makes this example flow more
|
* the least efficient way to do this, but it makes this example flow more
|
||||||
* smoothly.
|
* smoothly.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/nxdemo/nxdemo_main.c
|
* examples/nxdemo/nxdemo_main.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2018 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2018-2019 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
* Cherciu Mihail <m_cherciu@yahoo.com>
|
* Cherciu Mihail <m_cherciu@yahoo.com>
|
||||||
*
|
*
|
||||||
@ -61,9 +61,6 @@
|
|||||||
# include <nuttx/lcd/lcd.h>
|
# include <nuttx/lcd/lcd.h>
|
||||||
#else
|
#else
|
||||||
# include <nuttx/video/fb.h>
|
# include <nuttx/video/fb.h>
|
||||||
# ifdef CONFIG_VNCSERVER
|
|
||||||
# include <nuttx/video/vnc.h>
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <nuttx/nx/nx.h>
|
#include <nuttx/nx/nx.h>
|
||||||
@ -148,14 +145,20 @@ static inline int nxdemo_initialize(void)
|
|||||||
#ifdef CONFIG_VNCSERVER
|
#ifdef CONFIG_VNCSERVER
|
||||||
/* Setup the VNC server to support keyboard/mouse inputs */
|
/* Setup the VNC server to support keyboard/mouse inputs */
|
||||||
|
|
||||||
ret = vnc_default_fbinitialize(0, g_nxdemo.hnx);
|
struct boardioc_vncstart_s vnc =
|
||||||
if (ret < 0)
|
{
|
||||||
{
|
0, g_nxdemo.hnx
|
||||||
printf("vnc_default_fbinitialize failed: %d\n", ret);
|
};
|
||||||
nx_disconnect(g_nxdemo.hnx);
|
|
||||||
return ERROR;
|
ret = boardctl(BOARDIOC_VNC_START, (uintptr_t)&vnc);
|
||||||
}
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
printf("boardctl(BOARDIOC_VNC_START) failed: %d\n", ret);
|
||||||
|
nx_disconnect(g_nxdemo.hnx);
|
||||||
|
return ERROR;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Start a separate thread to listen for server events. This is probably
|
/* Start a separate thread to listen for server events. This is probably
|
||||||
* the least efficient way to do this, but it makes this example flow more
|
* the least efficient way to do this, but it makes this example flow more
|
||||||
* smoothly.
|
* smoothly.
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/nxhello/nxhello_main.c
|
* examples/nxhello/nxhello_main.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011, 2015-2017 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011, 2015-2017, 2019 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -56,10 +56,6 @@
|
|||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include <nuttx/board.h>
|
#include <nuttx/board.h>
|
||||||
|
|
||||||
#ifdef CONFIG_VNCSERVER
|
|
||||||
# include <nuttx/video/vnc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <nuttx/nx/nx.h>
|
#include <nuttx/nx/nx.h>
|
||||||
#include <nuttx/nx/nxglib.h>
|
#include <nuttx/nx/nxglib.h>
|
||||||
#include <nuttx/nx/nxfonts.h>
|
#include <nuttx/nx/nxfonts.h>
|
||||||
@ -126,14 +122,20 @@ static inline int nxhello_initialize(void)
|
|||||||
#ifdef CONFIG_VNCSERVER
|
#ifdef CONFIG_VNCSERVER
|
||||||
/* Setup the VNC server to support keyboard/mouse inputs */
|
/* Setup the VNC server to support keyboard/mouse inputs */
|
||||||
|
|
||||||
ret = vnc_default_fbinitialize(0, g_nxhello.hnx);
|
struct boardioc_vncstart_s vnc =
|
||||||
if (ret < 0)
|
{
|
||||||
{
|
0, g_nxhello.hnx
|
||||||
printf("vnc_default_fbinitialize failed: %d\n", ret);
|
};
|
||||||
nx_disconnect(g_nxhello.hnx);
|
|
||||||
return ERROR;
|
ret = boardctl(BOARDIOC_VNC_START, (uintptr_t)&vnc);
|
||||||
}
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
printf("boardctl(BOARDIOC_VNC_START) failed: %d\n", ret);
|
||||||
|
nx_disconnect(g_nxhello.hnx);
|
||||||
|
return ERROR;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Start a separate thread to listen for server events. This is probably
|
/* Start a separate thread to listen for server events. This is probably
|
||||||
* the least efficient way to do this, but it makes this example flow more
|
* the least efficient way to do this, but it makes this example flow more
|
||||||
* smoothly.
|
* smoothly.
|
||||||
|
@ -56,10 +56,6 @@
|
|||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include <nuttx/board.h>
|
#include <nuttx/board.h>
|
||||||
|
|
||||||
#ifdef CONFIG_VNCSERVER
|
|
||||||
# include <nuttx/video/vnc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <nuttx/nx/nx.h>
|
#include <nuttx/nx/nx.h>
|
||||||
#include <nuttx/nx/nxglib.h>
|
#include <nuttx/nx/nxglib.h>
|
||||||
#include <nuttx/nx/nxfonts.h>
|
#include <nuttx/nx/nxfonts.h>
|
||||||
@ -130,14 +126,20 @@ static inline int nximage_initialize(void)
|
|||||||
#ifdef CONFIG_VNCSERVER
|
#ifdef CONFIG_VNCSERVER
|
||||||
/* Setup the VNC server to support keyboard/mouse inputs */
|
/* Setup the VNC server to support keyboard/mouse inputs */
|
||||||
|
|
||||||
ret = vnc_default_fbinitialize(0, g_nximage.hnx);
|
struct boardioc_vncstart_s vnc =
|
||||||
if (ret < 0)
|
{
|
||||||
{
|
0, g_nximage.hnx
|
||||||
printf("vnc_default_fbinitialize failed: %d\n", ret);
|
};
|
||||||
nx_disconnect(g_nximage.hnx);
|
|
||||||
return ERROR;
|
ret = boardctl(BOARDIOC_VNC_START, (uintptr_t)&vnc);
|
||||||
}
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
printf("boardctl(BOARDIOC_VNC_START) failed: %d\n", ret);
|
||||||
|
nx_disconnect(g_nximage.hnx);
|
||||||
|
return ERROR;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Start a separate thread to listen for server events. This is probably
|
/* Start a separate thread to listen for server events. This is probably
|
||||||
* the least efficient way to do this, but it makes this example flow more
|
* the least efficient way to do this, but it makes this example flow more
|
||||||
* smoothly.
|
* smoothly.
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/nxlines/nxlines_main.c
|
* examples/nxlines/nxlines_main.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-2012, 2015-2017 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011-2012, 2015-2017, 2019 Gregory Nutt. All rights
|
||||||
|
* reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -54,10 +55,6 @@
|
|||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include <nuttx/board.h>
|
#include <nuttx/board.h>
|
||||||
|
|
||||||
#ifdef CONFIG_VNCSERVER
|
|
||||||
# include <nuttx/video/vnc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <nuttx/nx/nx.h>
|
#include <nuttx/nx/nx.h>
|
||||||
#include <nuttx/nx/nxglib.h>
|
#include <nuttx/nx/nxglib.h>
|
||||||
|
|
||||||
@ -151,14 +148,20 @@ static inline int nxlines_initialize(void)
|
|||||||
#ifdef CONFIG_VNCSERVER
|
#ifdef CONFIG_VNCSERVER
|
||||||
/* Setup the VNC server to support keyboard/mouse inputs */
|
/* Setup the VNC server to support keyboard/mouse inputs */
|
||||||
|
|
||||||
ret = vnc_default_fbinitialize(0, g_nxlines.hnx);
|
struct boardioc_vncstart_s vnc =
|
||||||
if (ret < 0)
|
{
|
||||||
{
|
0, g_nxlines.hnx
|
||||||
printf("vnc_default_fbinitialize failed: %d\n", ret);
|
};
|
||||||
nx_disconnect(g_nxlines.hnx);
|
|
||||||
return ERROR;
|
ret = boardctl(BOARDIOC_VNC_START, (uintptr_t)&vnc);
|
||||||
}
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
printf("boardctl(BOARDIOC_VNC_START) failed: %d\n", ret);
|
||||||
|
nx_disconnect(g_nxlines.hnx);
|
||||||
|
return ERROR;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Start a separate thread to listen for server events. This is probably
|
/* Start a separate thread to listen for server events. This is probably
|
||||||
* the least efficient way to do this, but it makes this example flow more
|
* the least efficient way to do this, but it makes this example flow more
|
||||||
* smoothly.
|
* smoothly.
|
||||||
|
@ -56,9 +56,6 @@
|
|||||||
# include <nuttx/lcd/lcd.h>
|
# include <nuttx/lcd/lcd.h>
|
||||||
#else
|
#else
|
||||||
# include <nuttx/video/fb.h>
|
# include <nuttx/video/fb.h>
|
||||||
# ifdef CONFIG_VNCSERVER
|
|
||||||
# include <nuttx/video/vnc.h>
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <nuttx/nx/nx.h>
|
#include <nuttx/nx/nx.h>
|
||||||
@ -142,15 +139,22 @@ static int nxterm_initialize(void)
|
|||||||
pthread_attr_t attr;
|
pthread_attr_t attr;
|
||||||
|
|
||||||
#ifdef CONFIG_VNCSERVER
|
#ifdef CONFIG_VNCSERVER
|
||||||
/* Setup the VNC server to support keyboard/mouse inputs */
|
/* Setup the VNC server to support keyboard/mouse inputs */
|
||||||
|
|
||||||
ret = vnc_default_fbinitialize(0, g_nxterm_vars.hnx);
|
struct boardioc_vncstart_s vnc =
|
||||||
if (ret < 0)
|
{
|
||||||
{
|
0, g_nxterm_vars.hnx
|
||||||
printf("vnc_default_fbinitialize failed: %d\n", ret);
|
};
|
||||||
return ERROR;
|
|
||||||
}
|
ret = boardctl(BOARDIOC_VNC_START, (uintptr_t)&vnc);
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
printf("boardctl(BOARDIOC_VNC_START) failed: %d\n", ret);
|
||||||
|
nx_disconnect(g_nxterm_vars.hnx);
|
||||||
|
return ERROR;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Start a separate thread to listen for server events. This is probably
|
/* Start a separate thread to listen for server events. This is probably
|
||||||
* the least efficient way to do this, but it makes this example flow more
|
* the least efficient way to do this, but it makes this example flow more
|
||||||
* smoothly.
|
* smoothly.
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/nxtext/nxtext_main.c
|
* examples/nxtext/nxtext_main.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-2012, 2015-2017 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011-2012, 2015-2017, 2019 Gregory Nutt. All rights
|
||||||
|
* reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -60,9 +61,6 @@
|
|||||||
# include <nuttx/lcd/lcd.h>
|
# include <nuttx/lcd/lcd.h>
|
||||||
#else
|
#else
|
||||||
# include <nuttx/video/fb.h>
|
# include <nuttx/video/fb.h>
|
||||||
# ifdef CONFIG_VNCSERVER
|
|
||||||
# include <nuttx/video/vnc.h>
|
|
||||||
# endif
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <nuttx/nx/nx.h>
|
#include <nuttx/nx/nx.h>
|
||||||
@ -204,15 +202,21 @@ static int nxtext_initialize(void)
|
|||||||
#ifdef CONFIG_VNCSERVER
|
#ifdef CONFIG_VNCSERVER
|
||||||
/* Setup the VNC server to support keyboard/mouse inputs */
|
/* Setup the VNC server to support keyboard/mouse inputs */
|
||||||
|
|
||||||
ret = vnc_default_fbinitialize(0, g_hnx);
|
struct boardioc_vncstart_s vnc =
|
||||||
if (ret < 0)
|
{
|
||||||
{
|
0, g_hnx
|
||||||
printf("vnc_default_fbinitialize failed: %d\n", ret);
|
};
|
||||||
|
|
||||||
g_exitcode = NXEXIT_FBINITIALIZE;
|
ret = boardctl(BOARDIOC_VNC_START, (uintptr_t)&vnc);
|
||||||
return ERROR;
|
if (ret < 0)
|
||||||
}
|
{
|
||||||
|
printf("boardctl(BOARDIOC_VNC_START) failed: %d\n", ret);
|
||||||
|
nx_disconnect(g_hnx);
|
||||||
|
g_exitcode = NXEXIT_FBINITIALIZE;
|
||||||
|
return ERROR;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Start a separate thread to listen for server events. This is probably
|
/* Start a separate thread to listen for server events. This is probably
|
||||||
* the least efficient way to do this, but it makes this example flow more
|
* the least efficient way to do this, but it makes this example flow more
|
||||||
* smoothly.
|
* smoothly.
|
||||||
|
@ -57,10 +57,6 @@
|
|||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include <nuttx/board.h>
|
#include <nuttx/board.h>
|
||||||
|
|
||||||
#ifdef CONFIG_VNCSERVER
|
|
||||||
# include <nuttx/video/vnc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <nuttx/nx/nx.h>
|
#include <nuttx/nx/nx.h>
|
||||||
#include <nuttx/nx/nxtk.h>
|
#include <nuttx/nx/nxtk.h>
|
||||||
#include <nuttx/nx/nxbe.h>
|
#include <nuttx/nx/nxbe.h>
|
||||||
@ -120,15 +116,22 @@ static bool pwfb_server_initialize(FAR struct pwfb_state_s *st)
|
|||||||
#ifdef CONFIG_VNCSERVER
|
#ifdef CONFIG_VNCSERVER
|
||||||
/* Setup the VNC server to support keyboard/mouse inputs */
|
/* Setup the VNC server to support keyboard/mouse inputs */
|
||||||
|
|
||||||
ret = vnc_default_fbinitialize(0, st->hnx);
|
struct boardioc_vncstart_s vnc =
|
||||||
if (ret < 0)
|
{
|
||||||
{
|
0, st->hnx
|
||||||
printf("pwfb_server_initialize: ERROR: "
|
};
|
||||||
"vnc_default_fbinitialize failed: %d\n",
|
|
||||||
ret);
|
ret = boardctl(BOARDIOC_VNC_START, (uintptr_t)&vnc);
|
||||||
nx_disconnect(st->hnx);
|
if (ret < 0)
|
||||||
return false;
|
{
|
||||||
}
|
printf("pwfb_server_initialize: ERROR: "
|
||||||
|
"boardctl(BOARDIOC_VNC_START) failed: %d\n",
|
||||||
|
ret);
|
||||||
|
|
||||||
|
nx_disconnect(st->hnx);
|
||||||
|
g_exitcode = NXEXIT_FBINITIALIZE;
|
||||||
|
return ERROR;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -57,10 +57,6 @@
|
|||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include <nuttx/board.h>
|
#include <nuttx/board.h>
|
||||||
|
|
||||||
#ifdef CONFIG_VNCSERVER
|
|
||||||
# include <nuttx/video/vnc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <nuttx/nx/nx.h>
|
#include <nuttx/nx/nx.h>
|
||||||
#include <nuttx/nx/nxtk.h>
|
#include <nuttx/nx/nxtk.h>
|
||||||
#include <nuttx/nx/nxbe.h>
|
#include <nuttx/nx/nxbe.h>
|
||||||
@ -111,15 +107,21 @@ static bool pwlines_server_initialize(FAR struct pwlines_state_s *st)
|
|||||||
#ifdef CONFIG_VNCSERVER
|
#ifdef CONFIG_VNCSERVER
|
||||||
/* Setup the VNC server to support keyboard/mouse inputs */
|
/* Setup the VNC server to support keyboard/mouse inputs */
|
||||||
|
|
||||||
ret = vnc_default_fbinitialize(0, st->hnx);
|
struct boardioc_vncstart_s vnc =
|
||||||
if (ret < 0)
|
{
|
||||||
{
|
0, st->hnx
|
||||||
printf("pwlines_server_initialize: ERROR: "
|
};
|
||||||
"vnc_default_fbinitialize failed: %d\n",
|
|
||||||
ret);
|
ret = boardctl(BOARDIOC_VNC_START, (uintptr_t)&vnc);
|
||||||
nx_disconnect(st->hnx);
|
if (ret < 0)
|
||||||
return false;
|
{
|
||||||
}
|
printf("pwlines_server_initialize: ERROR: "
|
||||||
|
"boardctl(BOARDIOC_VNC_START) failed: %d\n",
|
||||||
|
ret);
|
||||||
|
|
||||||
|
nx_disconnect(st->hnx);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/graphics/NxWidgets/nxwidgets/src/cnxserver.cxx
|
* apps/graphics/NxWidgets/nxwidgets/src/cnxserver.cxx
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012, 2013, 2015-2016 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2012, 2013, 2015-2016, 2019 Gregory Nutt. All rights
|
||||||
|
* reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -54,10 +55,6 @@
|
|||||||
|
|
||||||
#include <nuttx/board.h>
|
#include <nuttx/board.h>
|
||||||
|
|
||||||
#ifdef CONFIG_VNCSERVER
|
|
||||||
# include <nuttx/video/vnc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "graphics/nxwidgets/nxconfig.hxx"
|
#include "graphics/nxwidgets/nxconfig.hxx"
|
||||||
#include "graphics/nxwidgets/singletons.hxx"
|
#include "graphics/nxwidgets/singletons.hxx"
|
||||||
#include "graphics/nxwidgets/cnxserver.hxx"
|
#include "graphics/nxwidgets/cnxserver.hxx"
|
||||||
@ -161,14 +158,19 @@ bool CNxServer::connect(void)
|
|||||||
#ifdef CONFIG_VNCSERVER
|
#ifdef CONFIG_VNCSERVER
|
||||||
// Setup the VNC server to support keyboard/mouse inputs
|
// Setup the VNC server to support keyboard/mouse inputs
|
||||||
|
|
||||||
ret = vnc_default_fbinitialize(0, m_hNxServer);
|
struct boardioc_vncstart_s vnc =
|
||||||
if (ret < 0)
|
{
|
||||||
{
|
0, m_hNxServer
|
||||||
gerr("ERROR: CNxServer::connect: vnc_default_fbinitialize failed: %d\n", ret);
|
};
|
||||||
m_running = false;
|
|
||||||
disconnect();
|
ret = boardctl(BOARDIOC_VNC_START, (uintptr_t)&vnc);
|
||||||
return false;
|
if (ret < 0)
|
||||||
}
|
{
|
||||||
|
gerr("ERROR: boardctl(BOARDIOC_VNC_START) failed: %d\n", ret);
|
||||||
|
m_running = false;
|
||||||
|
disconnect();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Start a separate thread to listen for server events. This is probably
|
// Start a separate thread to listen for server events. This is probably
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* apps/examples/screenshot/screenshot_main.c
|
* apps/examples/screenshot/screenshot_main.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013, 2016 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2013, 2016, 2019 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
* Petteri Aimonen <jpa@kapsi.fi>
|
* Petteri Aimonen <jpa@kapsi.fi>
|
||||||
*
|
*
|
||||||
@ -40,6 +40,7 @@
|
|||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <sys/boardctl.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
@ -52,10 +53,6 @@
|
|||||||
|
|
||||||
#include <nuttx/nx/nx.h>
|
#include <nuttx/nx/nx.h>
|
||||||
|
|
||||||
#ifdef CONFIG_VNCSERVER
|
|
||||||
# include <nuttx/video/vnc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Pre-Processor Definitions
|
* Pre-Processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
@ -125,6 +122,9 @@ int save_screenshot(FAR const char *filename)
|
|||||||
struct tiff_info_s info;
|
struct tiff_info_s info;
|
||||||
struct nx_callback_s cb = {};
|
struct nx_callback_s cb = {};
|
||||||
struct nxgl_size_s size = {CONFIG_SCREENSHOT_WIDTH, CONFIG_SCREENSHOT_HEIGHT};
|
struct nxgl_size_s size = {CONFIG_SCREENSHOT_WIDTH, CONFIG_SCREENSHOT_HEIGHT};
|
||||||
|
#ifdef CONFIG_VNCSERVER
|
||||||
|
struct boardioc_vncstart_s vnc;
|
||||||
|
#endif
|
||||||
FAR uint8_t *strip;
|
FAR uint8_t *strip;
|
||||||
NXHANDLE server;
|
NXHANDLE server;
|
||||||
NXWINDOW window;
|
NXWINDOW window;
|
||||||
@ -146,15 +146,18 @@ int save_screenshot(FAR const char *filename)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_VNCSERVER
|
#ifdef CONFIG_VNCSERVER
|
||||||
/* Setup the VNC server to support keyboard/mouse inputs */
|
/* Setup the VNC server to support keyboard/mouse inputs */
|
||||||
|
|
||||||
ret = vnc_default_fbinitialize(0, server);
|
vnc.display = 0;
|
||||||
if (ret < 0)
|
vnc.handle = server;
|
||||||
{
|
|
||||||
printf("vnc_default_fbinitialize failed: %d\n", ret);
|
ret = boardctl(BOARDIOC_VNC_START, (uintptr_t)&vnc);
|
||||||
nx_disconnect(server);
|
if (ret < 0)
|
||||||
return 1;
|
{
|
||||||
}
|
printf("boardctl(BOARDIOC_VNC_START) failed: %d\n", ret);
|
||||||
|
nx_disconnect(server);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Wait for "connected" event */
|
/* Wait for "connected" event */
|
||||||
|
@ -58,9 +58,6 @@
|
|||||||
#ifdef CONFIG_GRAPHICS_TRAVELER_FB
|
#ifdef CONFIG_GRAPHICS_TRAVELER_FB
|
||||||
# include <nuttx/video/fb.h>
|
# include <nuttx/video/fb.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef CONFIG_VNCSERVER
|
|
||||||
# include <nuttx/video/vnc.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Data
|
* Public Data
|
||||||
@ -241,11 +238,16 @@ static inline int trv_nx_initialize(FAR struct trv_graphics_info_s *ginfo)
|
|||||||
#ifdef CONFIG_VNCSERVER
|
#ifdef CONFIG_VNCSERVER
|
||||||
/* Setup the VNC server to support keyboard/mouse inputs */
|
/* Setup the VNC server to support keyboard/mouse inputs */
|
||||||
|
|
||||||
ret = vnc_default_fbinitialize(0, ginfo->hnx);
|
struct boardioc_vncstart_s vnc =
|
||||||
if (ret < 0)
|
{
|
||||||
{
|
0, ginfo->hnx
|
||||||
trv_abort("vnc_default_fbinitialize failed: %d\n", ret);
|
};
|
||||||
}
|
|
||||||
|
ret = boardctl(BOARDIOC_VNC_START, (uintptr_t)&vnc);
|
||||||
|
if (ret < 0)
|
||||||
|
{
|
||||||
|
trv_abort("boardctl(BOARDIOC_VNC_START) failed: %d\n", ret);
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Start a separate thread to listen for server events. This is probably
|
/* Start a separate thread to listen for server events. This is probably
|
||||||
|
Loading…
x
Reference in New Issue
Block a user