2012-03-27 02:23:40 +02:00
|
|
|
/****************************************************************************
|
2021-03-08 22:39:04 +01:00
|
|
|
* graphics/nxterm/nxterm_driver.c
|
2012-03-27 02:23:40 +02:00
|
|
|
*
|
2021-02-05 11:12:53 +01:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
2012-03-27 02:23:40 +02:00
|
|
|
*
|
2021-02-05 11:12:53 +01:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2012-03-27 02:23:40 +02:00
|
|
|
*
|
2021-02-05 11:12:53 +01:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
2012-03-27 02:23:40 +02:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <fcntl.h>
|
|
|
|
#include <assert.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <debug.h>
|
|
|
|
|
|
|
|
#include <nuttx/fs/fs.h>
|
|
|
|
|
2014-09-20 23:53:28 +02:00
|
|
|
#include "nxterm.h"
|
2012-03-27 02:23:40 +02:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Private Function Prototypes
|
|
|
|
****************************************************************************/
|
|
|
|
|
2014-09-20 23:53:28 +02:00
|
|
|
static int nxterm_open(FAR struct file *filep);
|
2019-03-06 17:16:47 +01:00
|
|
|
static int nxterm_close(FAR struct file *filep);
|
2014-09-20 23:53:28 +02:00
|
|
|
static ssize_t nxterm_write(FAR struct file *filep, FAR const char *buffer,
|
2022-04-12 12:16:13 +02:00
|
|
|
size_t buflen);
|
2019-05-16 19:54:38 +02:00
|
|
|
static int nxterm_ioctl(FAR struct file *filep, int cmd,
|
|
|
|
unsigned long arg);
|
2019-03-06 17:16:47 +01:00
|
|
|
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
|
|
|
static int nxterm_unlink(FAR struct inode *inode);
|
|
|
|
#endif
|
2012-03-27 02:23:40 +02:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Data
|
|
|
|
****************************************************************************/
|
2017-01-08 18:20:16 +01:00
|
|
|
|
2012-03-27 02:23:40 +02:00
|
|
|
/* This is the common NX driver file operations */
|
|
|
|
|
2014-09-20 22:18:08 +02:00
|
|
|
#ifdef CONFIG_NXTERM_NXKBDIN
|
2012-05-20 18:05:15 +02:00
|
|
|
|
2014-09-20 23:53:28 +02:00
|
|
|
const struct file_operations g_nxterm_drvrops =
|
2012-05-20 18:05:15 +02:00
|
|
|
{
|
2022-01-10 15:51:17 +01:00
|
|
|
nxterm_open, /* open */
|
|
|
|
nxterm_close, /* close */
|
|
|
|
nxterm_read, /* read */
|
|
|
|
nxterm_write, /* write */
|
|
|
|
NULL, /* seek */
|
|
|
|
nxterm_ioctl, /* ioctl */
|
|
|
|
nxterm_poll /* poll */
|
2019-03-06 17:16:47 +01:00
|
|
|
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
2022-01-10 15:51:17 +01:00
|
|
|
, nxterm_unlink /* unlink */
|
2019-03-06 17:16:47 +01:00
|
|
|
#endif
|
2012-05-20 18:05:15 +02:00
|
|
|
};
|
|
|
|
|
2014-09-20 22:18:08 +02:00
|
|
|
#else /* CONFIG_NXTERM_NXKBDIN */
|
2012-05-20 18:05:15 +02:00
|
|
|
|
2014-09-20 23:53:28 +02:00
|
|
|
const struct file_operations g_nxterm_drvrops =
|
2012-03-27 02:23:40 +02:00
|
|
|
{
|
2022-01-10 15:51:17 +01:00
|
|
|
nxterm_open, /* open */
|
|
|
|
nxterm_close, /* close */
|
|
|
|
NULL, /* read */
|
|
|
|
nxterm_write, /* write */
|
|
|
|
NULL, /* seek */
|
|
|
|
nxterm_ioctl, /* ioctl */
|
|
|
|
NULL /* poll */
|
2019-03-06 17:16:47 +01:00
|
|
|
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
2022-01-10 15:51:17 +01:00
|
|
|
, nxterm_unlink /* unlink */
|
2012-03-27 02:23:40 +02:00
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
2014-09-20 22:18:08 +02:00
|
|
|
#endif /* CONFIG_NXTERM_NXKBDIN */
|
2012-05-20 18:05:15 +02:00
|
|
|
|
2012-03-27 02:23:40 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Private Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
2014-09-20 23:53:28 +02:00
|
|
|
* Name: nxterm_open
|
2012-03-27 02:23:40 +02:00
|
|
|
****************************************************************************/
|
|
|
|
|
2014-09-20 23:53:28 +02:00
|
|
|
static int nxterm_open(FAR struct file *filep)
|
2012-03-27 02:23:40 +02:00
|
|
|
{
|
|
|
|
FAR struct inode *inode = filep->f_inode;
|
2022-02-01 17:55:50 +01:00
|
|
|
FAR struct nxterm_state_s *priv = inode->i_private;
|
2012-03-27 02:23:40 +02:00
|
|
|
|
|
|
|
DEBUGASSERT(filep && filep->f_inode);
|
|
|
|
|
|
|
|
/* Get the driver structure from the inode */
|
|
|
|
|
|
|
|
inode = filep->f_inode;
|
2014-09-20 23:53:28 +02:00
|
|
|
priv = (FAR struct nxterm_state_s *)inode->i_private;
|
2012-03-27 02:23:40 +02:00
|
|
|
DEBUGASSERT(priv);
|
|
|
|
|
|
|
|
/* Verify that the driver is opened for write-only access */
|
|
|
|
|
2014-09-20 22:18:08 +02:00
|
|
|
#ifndef CONFIG_NXTERM_NXKBDIN
|
2012-03-28 00:33:15 +02:00
|
|
|
if ((filep->f_oflags & O_RDOK) != 0)
|
2012-03-27 02:23:40 +02:00
|
|
|
{
|
2016-06-11 23:50:49 +02:00
|
|
|
gerr("ERROR: Attempted open with read access\n");
|
2012-03-27 02:23:40 +02:00
|
|
|
return -EACCES;
|
|
|
|
}
|
2012-05-20 18:05:15 +02:00
|
|
|
#endif
|
2012-03-27 02:23:40 +02:00
|
|
|
|
2019-03-06 17:16:47 +01:00
|
|
|
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
2020-02-22 19:31:14 +01:00
|
|
|
/* Increment the count of open file reference */
|
2019-03-06 17:16:47 +01:00
|
|
|
|
|
|
|
DEBUGASSERT(priv->orefs != UINT8_MAX);
|
|
|
|
priv->orefs++;
|
|
|
|
#endif
|
|
|
|
|
2012-03-27 02:23:40 +02:00
|
|
|
/* Assign the driver structure to the file */
|
|
|
|
|
|
|
|
filep->f_priv = priv;
|
|
|
|
return OK;
|
|
|
|
}
|
|
|
|
|
2019-03-06 17:16:47 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxterm_close
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
static int nxterm_close(FAR struct file *filep)
|
|
|
|
{
|
|
|
|
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
|
|
|
FAR struct nxterm_state_s *priv;
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
/* Recover our private state structure */
|
|
|
|
|
|
|
|
DEBUGASSERT(filep != NULL && filep->f_priv != NULL);
|
|
|
|
priv = (FAR struct nxterm_state_s *)filep->f_priv;
|
|
|
|
|
|
|
|
/* Get exclusive access */
|
|
|
|
|
2022-09-06 08:18:45 +02:00
|
|
|
ret = nxmutex_lock(&priv->lock);
|
2019-03-06 17:16:47 +01:00
|
|
|
if (ret < 0)
|
|
|
|
{
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2020-02-22 19:31:14 +01:00
|
|
|
/* Has the driver been unlinked? Was this the last open references to the
|
2019-03-06 17:16:47 +01:00
|
|
|
* terminal driver?
|
|
|
|
*/
|
|
|
|
|
|
|
|
DEBUGASSERT(priv->orefs > 0);
|
|
|
|
if (priv->unlinked && priv->orefs <= 1)
|
|
|
|
{
|
|
|
|
/* Yes.. Unregister the terminal device */
|
|
|
|
|
2022-09-06 08:18:45 +02:00
|
|
|
nxmutex_unlock(&priv->lock);
|
2019-03-06 17:16:47 +01:00
|
|
|
nxterm_unregister(priv);
|
2022-04-11 11:46:59 +02:00
|
|
|
return OK;
|
2019-03-06 17:16:47 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* No.. Just decrement the count of open file references */
|
|
|
|
|
|
|
|
priv->orefs--;
|
|
|
|
}
|
|
|
|
|
2022-09-06 08:18:45 +02:00
|
|
|
nxmutex_unlock(&priv->lock);
|
2019-03-06 17:16:47 +01:00
|
|
|
#endif
|
|
|
|
|
|
|
|
return OK;
|
|
|
|
}
|
|
|
|
|
2012-03-27 02:23:40 +02:00
|
|
|
/****************************************************************************
|
2014-09-20 23:53:28 +02:00
|
|
|
* Name: nxterm_write
|
2012-03-27 02:23:40 +02:00
|
|
|
****************************************************************************/
|
|
|
|
|
2014-09-20 23:53:28 +02:00
|
|
|
static ssize_t nxterm_write(FAR struct file *filep, FAR const char *buffer,
|
2012-03-27 02:23:40 +02:00
|
|
|
size_t buflen)
|
|
|
|
{
|
2014-09-20 23:53:28 +02:00
|
|
|
FAR struct nxterm_state_s *priv;
|
|
|
|
enum nxterm_vt100state_e state;
|
2012-03-28 18:06:56 +02:00
|
|
|
ssize_t remaining;
|
2012-03-27 02:23:40 +02:00
|
|
|
char ch;
|
2012-03-27 21:40:49 +02:00
|
|
|
int ret;
|
2012-03-27 02:23:40 +02:00
|
|
|
|
|
|
|
/* Recover our private state structure */
|
|
|
|
|
2019-03-06 17:16:47 +01:00
|
|
|
DEBUGASSERT(filep != NULL && filep->f_priv != NULL);
|
2014-09-20 23:53:28 +02:00
|
|
|
priv = (FAR struct nxterm_state_s *)filep->f_priv;
|
2012-03-27 02:23:40 +02:00
|
|
|
|
2012-03-27 21:40:49 +02:00
|
|
|
/* Get exclusive access */
|
|
|
|
|
2022-09-06 08:18:45 +02:00
|
|
|
ret = nxmutex_lock(&priv->lock);
|
2012-03-27 21:40:49 +02:00
|
|
|
if (ret < 0)
|
|
|
|
{
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2012-03-31 18:26:32 +02:00
|
|
|
/* Hide the cursor while we update the display */
|
|
|
|
|
2014-09-20 23:53:28 +02:00
|
|
|
nxterm_hidecursor(priv);
|
2012-03-31 18:26:32 +02:00
|
|
|
|
2012-03-27 02:23:40 +02:00
|
|
|
/* Loop writing each character to the display */
|
|
|
|
|
2012-03-28 18:06:56 +02:00
|
|
|
for (remaining = (ssize_t)buflen; remaining > 0; remaining--)
|
2012-03-27 02:23:40 +02:00
|
|
|
{
|
2012-03-30 20:42:40 +02:00
|
|
|
/* Get the next character from the user buffer */
|
2012-03-27 18:59:15 +02:00
|
|
|
|
|
|
|
ch = *buffer++;
|
|
|
|
|
2012-03-30 20:42:40 +02:00
|
|
|
/* Check if this character is part of a VT100 escape sequence */
|
2012-03-27 02:23:40 +02:00
|
|
|
|
2012-03-30 20:42:40 +02:00
|
|
|
do
|
2012-03-27 02:23:40 +02:00
|
|
|
{
|
2012-03-30 20:42:40 +02:00
|
|
|
/* Is the character part of a VT100 escape sequnce? */
|
2012-03-27 02:23:40 +02:00
|
|
|
|
2014-09-20 23:53:28 +02:00
|
|
|
state = nxterm_vt100(priv, ch);
|
2012-03-30 20:42:40 +02:00
|
|
|
switch (state)
|
|
|
|
{
|
|
|
|
/* Character is not part of a VT100 escape sequence (and no
|
|
|
|
* characters are buffer.
|
|
|
|
*/
|
2012-03-27 02:23:40 +02:00
|
|
|
|
2012-03-30 20:42:40 +02:00
|
|
|
default:
|
|
|
|
case VT100_NOT_CONSUMED:
|
|
|
|
{
|
|
|
|
/* We can output the character to the window */
|
2012-03-27 02:23:40 +02:00
|
|
|
|
2014-09-20 23:53:28 +02:00
|
|
|
nxterm_putc(priv, (uint8_t)ch);
|
2012-03-30 20:42:40 +02:00
|
|
|
}
|
|
|
|
break;
|
2012-03-27 18:59:15 +02:00
|
|
|
|
2012-03-30 20:42:40 +02:00
|
|
|
/* The full VT100 escape sequence was processed (and the new
|
|
|
|
* character was consumed)
|
|
|
|
*/
|
2012-03-27 02:23:40 +02:00
|
|
|
|
2012-03-30 20:42:40 +02:00
|
|
|
case VT100_PROCESSED:
|
2012-03-27 02:23:40 +02:00
|
|
|
|
2012-03-30 20:42:40 +02:00
|
|
|
/* Character was consumed as part of the VT100 escape processing
|
|
|
|
* (but the escape sequence is still incomplete.
|
|
|
|
*/
|
|
|
|
|
2014-04-14 00:22:22 +02:00
|
|
|
case VT100_CONSUMED:
|
2012-03-30 20:42:40 +02:00
|
|
|
{
|
|
|
|
/* Do nothing... the VT100 logic owns the character */
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* Invalid/unsupported character in escape sequence */
|
|
|
|
|
|
|
|
case VT100_ABORT:
|
|
|
|
{
|
|
|
|
int i;
|
2012-03-27 02:23:40 +02:00
|
|
|
|
2012-03-30 20:42:40 +02:00
|
|
|
/* Add the first unhandled character to the window */
|
2012-03-27 02:23:40 +02:00
|
|
|
|
2014-09-20 23:53:28 +02:00
|
|
|
nxterm_putc(priv, (uint8_t)priv->seq[0]);
|
2012-03-30 20:42:40 +02:00
|
|
|
|
|
|
|
/* Move all buffer characters down one */
|
|
|
|
|
|
|
|
for (i = 1; i < priv->nseq; i++)
|
|
|
|
{
|
2021-02-05 09:05:48 +01:00
|
|
|
priv->seq[i - 1] = priv->seq[i];
|
2012-03-30 20:42:40 +02:00
|
|
|
}
|
2019-03-08 18:52:49 +01:00
|
|
|
|
2012-03-30 20:42:40 +02:00
|
|
|
priv->nseq--;
|
|
|
|
|
|
|
|
/* Then loop again and check if what remains is part of a
|
|
|
|
* VT100 escape sequence. We could speed this up by
|
|
|
|
* checking if priv->seq[0] == ASCII_ESC.
|
|
|
|
*/
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
while (state == VT100_ABORT);
|
2012-03-27 02:23:40 +02:00
|
|
|
}
|
|
|
|
|
2012-03-31 18:26:32 +02:00
|
|
|
/* Show the cursor at its new position */
|
|
|
|
|
2014-09-20 23:53:28 +02:00
|
|
|
nxterm_showcursor(priv);
|
2022-09-06 08:18:45 +02:00
|
|
|
nxmutex_unlock(&priv->lock);
|
2012-03-28 18:06:56 +02:00
|
|
|
return (ssize_t)buflen;
|
2012-03-27 02:23:40 +02:00
|
|
|
}
|
|
|
|
|
2019-05-16 19:54:38 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxterm_ioctl
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
static int nxterm_ioctl(FAR struct file *filep, int cmd, unsigned long arg)
|
|
|
|
{
|
|
|
|
/* NOTE: We don't need driver context here because the NXTERM handle
|
|
|
|
* provided within each of the NXTERM IOCTL command data. Mutual
|
2020-02-23 09:50:23 +01:00
|
|
|
* exclusion is similar managed by the IOCTL cmmand handler.
|
2019-05-16 19:54:38 +02:00
|
|
|
*
|
|
|
|
* This permits the IOCTL to be called in abnormal context (such as
|
|
|
|
* from boardctl())
|
|
|
|
*/
|
|
|
|
|
|
|
|
return nxterm_ioctl_tap(cmd, arg);
|
|
|
|
}
|
|
|
|
|
2019-03-06 17:16:47 +01:00
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxterm_unlink
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef CONFIG_DISABLE_PSEUDOFS_OPERATIONS
|
|
|
|
static int nxterm_unlink(FAR struct inode *inode)
|
|
|
|
{
|
|
|
|
FAR struct nxterm_state_s *priv;
|
|
|
|
int ret;
|
|
|
|
|
2019-03-06 20:27:50 +01:00
|
|
|
DEBUGASSERT(inode != NULL && inode->i_private != NULL);
|
2019-03-06 17:16:47 +01:00
|
|
|
priv = inode->i_private;
|
|
|
|
|
|
|
|
/* Get exclusive access */
|
|
|
|
|
2022-09-06 08:18:45 +02:00
|
|
|
ret = nxmutex_lock(&priv->lock);
|
2019-03-06 17:16:47 +01:00
|
|
|
if (ret < 0)
|
|
|
|
{
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Are there open references to the terminal driver? */
|
|
|
|
|
|
|
|
if (priv->orefs > 0)
|
|
|
|
{
|
|
|
|
/* Yes.. Just mark the driver unlinked. Resources will be cleaned up
|
|
|
|
* when the final reference is close.
|
|
|
|
*/
|
|
|
|
|
|
|
|
priv->unlinked = true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
/* No.. Unregister the terminal device now */
|
|
|
|
|
2022-09-06 08:18:45 +02:00
|
|
|
nxmutex_unlock(&priv->lock);
|
2019-03-06 17:16:47 +01:00
|
|
|
nxterm_unregister(priv);
|
2022-04-11 11:46:59 +02:00
|
|
|
return OK;
|
2019-03-06 17:16:47 +01:00
|
|
|
}
|
|
|
|
|
2022-09-06 08:18:45 +02:00
|
|
|
nxmutex_unlock(&priv->lock);
|
2019-03-06 17:16:47 +01:00
|
|
|
return OK;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2012-03-27 02:23:40 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Public Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
2019-05-16 19:54:38 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* Name: nxterm_ioctl_tap
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Execute an NXTERM IOCTL command from an external caller.
|
|
|
|
*
|
|
|
|
* NOTE: We don't need driver context here because the NXTERM handle
|
|
|
|
* provided within each of the NXTERM IOCTL command data. Mutual
|
2020-02-23 09:50:23 +01:00
|
|
|
* exclusion is similar managed by the IOCTL cmmand handler.
|
2019-05-16 19:54:38 +02:00
|
|
|
*
|
|
|
|
* This permits the IOCTL to be called in abnormal context (such as
|
|
|
|
* from boardctl())
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
int nxterm_ioctl_tap(int cmd, uintptr_t arg)
|
|
|
|
{
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
switch (cmd)
|
|
|
|
{
|
|
|
|
/* CMD: NXTERMIOC_NXTERM_REDRAW
|
|
|
|
* DESCRIPTION: Re-draw a portion of the NX console. This function
|
|
|
|
* should be called from the appropriate window callback
|
|
|
|
* logic.
|
|
|
|
* ARG: A reference readable instance of struct
|
|
|
|
* nxtermioc_redraw_s
|
|
|
|
* CONFIGURATION: CONFIG_NXTERM
|
|
|
|
*/
|
|
|
|
|
|
|
|
case NXTERMIOC_NXTERM_REDRAW:
|
|
|
|
{
|
|
|
|
FAR struct nxtermioc_redraw_s *redraw =
|
|
|
|
(FAR struct nxtermioc_redraw_s *)((uintptr_t)arg);
|
|
|
|
|
|
|
|
nxterm_redraw(redraw->handle, &redraw->rect, redraw->more);
|
|
|
|
ret = OK;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
/* CMD: NXTERMIOC_NXTERM_KBDIN
|
|
|
|
* DESCRIPTION: Provide NxTerm keyboard input to NX.
|
|
|
|
* ARG: A reference readable instance of struct
|
|
|
|
* nxtermioc_kbdin_s
|
|
|
|
* CONFIGURATION: CONFIG_NXTERM_NXKBDIN
|
|
|
|
*/
|
|
|
|
|
|
|
|
case NXTERMIOC_NXTERM_KBDIN:
|
|
|
|
{
|
|
|
|
#ifdef CONFIG_NXTERM_NXKBDIN
|
|
|
|
FAR struct nxtermioc_kbdin_s *kbdin =
|
|
|
|
(FAR struct nxtermioc_kbdin_s *)((uintptr_t)arg);
|
|
|
|
|
|
|
|
nxterm_kbdin(kbdin->handle, kbdin->buffer, kbdin->buflen);
|
|
|
|
ret = OK;
|
|
|
|
#else
|
|
|
|
ret = -ENOSYS;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2019-05-16 21:12:24 +02:00
|
|
|
/* CMD: NXTERMIOC_NXTERM_RESIZE
|
|
|
|
* DESCRIPTION: Inform NxTerm keyboard the the size of the window has
|
|
|
|
* changed
|
2021-02-05 09:05:48 +01:00
|
|
|
* ARG: A reference readable instance of struct
|
|
|
|
* nxtermioc_resize_s
|
2019-05-16 21:12:24 +02:00
|
|
|
* CONFIGURATION: CONFIG_NXTERM
|
|
|
|
*/
|
|
|
|
|
|
|
|
case NXTERMIOC_NXTERM_RESIZE:
|
|
|
|
{
|
|
|
|
FAR struct nxtermioc_resize_s *resize =
|
|
|
|
(FAR struct nxtermioc_resize_s *)((uintptr_t)arg);
|
|
|
|
|
|
|
|
ret = nxterm_resize(resize->handle, &resize->size);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
2019-05-16 19:54:38 +02:00
|
|
|
default:
|
|
|
|
ret = -ENOTTY;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|