mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 01:21:26 +08:00
configs/boardctl.c, include/sys/boardctl.h: Add a command to start the VNC server.
This commit is contained in:
+34
-2
@@ -53,6 +53,10 @@
|
|||||||
# include <nuttx/nx/nxmu.h>
|
# include <nuttx/nx/nxmu.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_VNCSERVER
|
||||||
|
# include <nuttx/video/vnc.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_BOARDCTL_USBDEVCTRL
|
#ifdef CONFIG_BOARDCTL_USBDEVCTRL
|
||||||
# include <nuttx/usb/cdcacm.h>
|
# include <nuttx/usb/cdcacm.h>
|
||||||
# include <nuttx/usb/pl2303.h>
|
# include <nuttx/usb/pl2303.h>
|
||||||
@@ -411,9 +415,9 @@ int boardctl(unsigned int cmd, uintptr_t arg)
|
|||||||
|
|
||||||
#ifdef CONFIG_NX
|
#ifdef CONFIG_NX
|
||||||
/* CMD: BOARDIOC_NX_START
|
/* CMD: BOARDIOC_NX_START
|
||||||
* DESCRIPTION: Start the NX servier
|
* DESCRIPTION: Start the NX server
|
||||||
* ARG: Integer display number to be served by this NXMU
|
* ARG: Integer display number to be served by this NXMU
|
||||||
( instance.
|
* instance.
|
||||||
* CONFIGURATION: CONFIG_NX
|
* CONFIGURATION: CONFIG_NX
|
||||||
* DEPENDENCIES: Base graphics logic provides nxmu_start()
|
* DEPENDENCIES: Base graphics logic provides nxmu_start()
|
||||||
*/
|
*/
|
||||||
@@ -430,6 +434,34 @@ int boardctl(unsigned int cmd, uintptr_t arg)
|
|||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_VNCSERVER
|
||||||
|
/* CMD: BOARDIOC_VNC_START
|
||||||
|
* DESCRIPTION: Start the NX server and framebuffer driver.
|
||||||
|
* ARG: A reference readable instance of struct
|
||||||
|
* boardioc_vncstart_s
|
||||||
|
* CONFIGURATION: CONFIG_VNCSERVER
|
||||||
|
* DEPENDENCIES: VNC server provides vnc_default_fbinitialize()
|
||||||
|
*/
|
||||||
|
|
||||||
|
case BOARDIOC_VNC_START:
|
||||||
|
{
|
||||||
|
FAR struct boardioc_vncstart_s *vnc =
|
||||||
|
(FAR struct boardioc_vncstart_s *)arg;
|
||||||
|
|
||||||
|
if (vnc == NULL)
|
||||||
|
{
|
||||||
|
ret = -EINVAL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* Setup the VNC server to support keyboard/mouse inputs */
|
||||||
|
|
||||||
|
ret = vnc_default_fbinitialize(vnc->display, vnc->handle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_NXTERM
|
#ifdef CONFIG_NXTERM
|
||||||
/* CMD: BOARDIOC_NXTERM
|
/* CMD: BOARDIOC_NXTERM
|
||||||
* DESCRIPTION: Create an NX terminal device
|
* DESCRIPTION: Create an NX terminal device
|
||||||
|
|||||||
+34
-25
@@ -45,6 +45,10 @@
|
|||||||
|
|
||||||
#include <nuttx/fs/ioctl.h>
|
#include <nuttx/fs/ioctl.h>
|
||||||
|
|
||||||
|
#ifdef CONFIG_VNCSERVER
|
||||||
|
# include <nuttx/nx/nx.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_NXTERM
|
#ifdef CONFIG_NXTERM
|
||||||
# include <nuttx/nx/nxterm.h>
|
# include <nuttx/nx/nxterm.h>
|
||||||
#endif
|
#endif
|
||||||
@@ -119,6 +123,13 @@
|
|||||||
* CONFIGURATION: CONFIG_NX
|
* CONFIGURATION: CONFIG_NX
|
||||||
* DEPENDENCIES: Base graphics logic provides nxmu_start()
|
* DEPENDENCIES: Base graphics logic provides nxmu_start()
|
||||||
*
|
*
|
||||||
|
* CMD: BOARDIOC_VNC_START
|
||||||
|
* DESCRIPTION: Start the NX server and framebuffer driver.
|
||||||
|
* ARG: A reference readable instance of struct
|
||||||
|
* boardioc_vncstart_s
|
||||||
|
* CONFIGURATION: CONFIG_VNCSERVER
|
||||||
|
* DEPENDENCIES: VNC server provides vnc_default_fbinitialize()
|
||||||
|
*
|
||||||
* CMD: BOARDIOC_NXTERM
|
* CMD: BOARDIOC_NXTERM
|
||||||
* DESCRIPTION: Create an NX terminal device
|
* DESCRIPTION: Create an NX terminal device
|
||||||
* ARG: A reference readable/writable instance of struct
|
* ARG: A reference readable/writable instance of struct
|
||||||
@@ -161,10 +172,11 @@
|
|||||||
#define BOARDIOC_OS_SYMTAB _BOARDIOC(0x0007)
|
#define BOARDIOC_OS_SYMTAB _BOARDIOC(0x0007)
|
||||||
#define BOARDIOC_USBDEV_CONTROL _BOARDIOC(0x0008)
|
#define BOARDIOC_USBDEV_CONTROL _BOARDIOC(0x0008)
|
||||||
#define BOARDIOC_NX_START _BOARDIOC(0x0009)
|
#define BOARDIOC_NX_START _BOARDIOC(0x0009)
|
||||||
#define BOARDIOC_NXTERM _BOARDIOC(0x000a)
|
#define BOARDIOC_VNC_START _BOARDIOC(0x000a)
|
||||||
#define BOARDIOC_NXTERM_REDRAW _BOARDIOC(0x000b)
|
#define BOARDIOC_NXTERM _BOARDIOC(0x000b)
|
||||||
#define BOARDIOC_NXTERM_KBDIN _BOARDIOC(0x000c)
|
#define BOARDIOC_NXTERM_REDRAW _BOARDIOC(0x000c)
|
||||||
#define BOARDIOC_TESTSET _BOARDIOC(0x000d)
|
#define BOARDIOC_NXTERM_KBDIN _BOARDIOC(0x000d)
|
||||||
|
#define BOARDIOC_TESTSET _BOARDIOC(0x000e)
|
||||||
|
|
||||||
/* If CONFIG_BOARDCTL_IOCTL=y, then board-specific commands will be support.
|
/* If CONFIG_BOARDCTL_IOCTL=y, then board-specific commands will be support.
|
||||||
* In this case, all commands not recognized by boardctl() will be forwarded
|
* In this case, all commands not recognized by boardctl() will be forwarded
|
||||||
@@ -173,31 +185,13 @@
|
|||||||
* User defined board commands may begin with this value:
|
* User defined board commands may begin with this value:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define BOARDIOC_USER _BOARDIOC(0x000e)
|
#define BOARDIOC_USER _BOARDIOC(0x000f)
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Type Definitions
|
* Public Type Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* Structure used to pass arguments and get returned values from the
|
/* Structures used with IOCTL commands */
|
||||||
* BOARDIOC_GRAPHICS_SETUP command.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifdef CONFIG_NX_LCDDRIVER
|
|
||||||
struct lcd_dev_s; /* Forward reference */
|
|
||||||
#else
|
|
||||||
struct fb_vtable_s; /* Forward reference */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
struct boardioc_graphics_s
|
|
||||||
{
|
|
||||||
int devno; /* IN: Graphics device number */
|
|
||||||
#ifdef CONFIG_NX_LCDDRIVER
|
|
||||||
FAR struct lcd_dev_s *dev; /* OUT: LCD driver instance */
|
|
||||||
#else
|
|
||||||
FAR struct fb_vtable_s *dev; /* OUT: Framebuffer driver instance */
|
|
||||||
#endif
|
|
||||||
};
|
|
||||||
|
|
||||||
/* In order to full describe a symbol table, a vector containing the address
|
/* In order to full describe a symbol table, a vector containing the address
|
||||||
* of the symbol table and the number of elements in the symbol table is
|
* of the symbol table and the number of elements in the symbol table is
|
||||||
@@ -271,7 +265,19 @@ struct boardioc_usbdev_ctrl_s
|
|||||||
};
|
};
|
||||||
#endif /* CONFIG_BOARDCTL_USBDEVCTRL */
|
#endif /* CONFIG_BOARDCTL_USBDEVCTRL */
|
||||||
|
|
||||||
|
#ifdef CONFIG_VNCSERVER
|
||||||
|
/* Argument passed with the BOARDIOC_VNC_START command */
|
||||||
|
|
||||||
|
struct boardioc_vncstart_s
|
||||||
|
{
|
||||||
|
int display; /* Display number */
|
||||||
|
NXHANDLE handle; /* Handle returned by nx_connect */
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_NXTERM
|
#ifdef CONFIG_NXTERM
|
||||||
|
/* Arguments passed with the BOARDIOC_NXTERM command */
|
||||||
|
|
||||||
enum boardioc_termtype_e
|
enum boardioc_termtype_e
|
||||||
{
|
{
|
||||||
BOARDIOC_XTERM_RAW = 0, /* Raw NX terminal window */
|
BOARDIOC_XTERM_RAW = 0, /* Raw NX terminal window */
|
||||||
@@ -288,7 +294,8 @@ struct boardioc_nxterm_create_s
|
|||||||
uint8_t minor; /* Terminal device minor number, N, in
|
uint8_t minor; /* Terminal device minor number, N, in
|
||||||
* /dev/nxtermN. 0 <= N <= 255 */
|
* /dev/nxtermN. 0 <= N <= 255 */
|
||||||
};
|
};
|
||||||
/* Structures used with IOCTL commands */
|
|
||||||
|
/* Arguments passed with the BOARDIOC_NXTERM_REDRAW command */
|
||||||
|
|
||||||
struct boardioc_nxterm_redraw_s
|
struct boardioc_nxterm_redraw_s
|
||||||
{
|
{
|
||||||
@@ -298,6 +305,8 @@ struct boardioc_nxterm_redraw_s
|
|||||||
};
|
};
|
||||||
|
|
||||||
#ifdef CONFIG_NXTERM_NXKBDIN
|
#ifdef CONFIG_NXTERM_NXKBDIN
|
||||||
|
/* Arguments passed with the BOARDIOC_NXTERM_KBDIN command */
|
||||||
|
|
||||||
struct boardioc_nxterm_kbdin_s
|
struct boardioc_nxterm_kbdin_s
|
||||||
{
|
{
|
||||||
NXTERM handle; /* NxTerm handle */
|
NXTERM handle; /* NxTerm handle */
|
||||||
|
|||||||
Reference in New Issue
Block a user