Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
telnet
5
Agile Telnet 移植出现error: 'POLLIN' undeclared (first use in this function)
发布于 2023-07-28 23:29:21 浏览:476
订阅该版
使用rt thread studio 工具环境,使用软件包 agile telnet 和agile conosle后,在serial.c文件 出现 ``` /rt-thread/components/drivers/serial/serial.c:61:49: error: 'POLLIN' undeclared (first use in this function) ``` 这个`POLLIN` 未定义, 请问一下这个`POLLIN`是什么的呢,不懂是什么数据, ```c static rt_err_t serial_fops_rx_ind(rt_device_t dev, rt_size_t size) { rt_wqueue_wakeup(&(dev->wait_queue), (void*)POLLIN); return RT_EOK; } static int serial_fops_poll(struct dfs_fd *fd, struct rt_pollreq *req) { int mask = 0; int flags = 0; rt_device_t device; struct rt_serial_device *serial; device = (rt_device_t)fd->data; RT_ASSERT(device != RT_NULL); serial = (struct rt_serial_device *)device; /* only support POLLIN */ flags = fd->flags & O_ACCMODE; if (flags == O_RDONLY || flags == O_RDWR) { rt_base_t level; struct rt_serial_rx_fifo* rx_fifo; rt_poll_add(&(device->wait_queue), req); rx_fifo = (struct rt_serial_rx_fifo*) serial->serial_rx; level = rt_hw_interrupt_disable(); if ((rx_fifo->get_index != rx_fifo->put_index) || (rx_fifo->get_index == rx_fifo->put_index && rx_fifo->is_full == RT_TRUE)) mask |= POLLIN; rt_hw_interrupt_enable(level); } return mask; } ``` 这里几个地方引用了POLLIN,但不是懂是是哪个数据。。。
查看更多
WKJay
认证专家
2023-07-29
wkjay.com
`POLLIN`定义在头文件`poll.h`中,具体定义如下: ```c /* * Copyright (c) 2006-2021, RT-Thread Development Team * * SPDX-License-Identifier: Apache-2.0 * * Change Logs: * Date Author Notes * 2021-09-11 Meco Man First version */ #ifndef __POLL_H__ #define __POLL_H__ #ifdef __cplusplus extern "C" { #endif #if !defined(POLLIN) && !defined(POLLOUT) #define POLLIN (0x01) #define POLLRDNORM (0x01) #define POLLRDBAND (0x01) #define POLLPRI (0x01) #define POLLOUT (0x02) #define POLLWRNORM (0x02) #define POLLWRBAND (0x02) #define POLLERR (0x04) #define POLLHUP (0x08) #define POLLNVAL (0x10) typedef unsigned int nfds_t; struct pollfd { int fd; short events; short revents; }; #endif /* !defined(POLLIN) && !defined(POLLOUT) */ #define POLLMASK_DEFAULT (POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM) int poll(struct pollfd *fds, nfds_t nfds, int timeout); #ifdef __cplusplus } #endif #endif /* __POLL_H__ */ ``` 一般`POLLIN`表示有数据可读。 题主关注一下是否包含了对应的头文件。同时检查一下 RT-Thread Settings 中是否打开了如下选项: ![screenshot_image.png](https://oss-club.rt-thread.org/uploads/20230729/3304ed230afdba74a1dae00558f90197.png)
1
个回答
默认排序
按发布时间排序
撰写答案
登录
注册新账号
关注者
0
被浏览
476
关于作者
wxfjog
这家伙很懒,什么也没写!
提问
16
回答
12
被采纳
3
关注TA
发私信
相关问题
1
用telnet组件提示bind socket failed
2
telnet功能开启之后,断开网线则死机
3
【已解决】msh使用telnet方式很容易死机,哪里问题呢?
4
telnet例程运行一段时间后出现异常,系统复位
5
TELNET 添加用户名和密码
6
agile telnet 后续改进交流
7
telnet_server 能打印 msh 提示符,但输入字符后回车没有反应
8
finsh 中使用错误指令会卡死,rt-thread版本为 3.0.3
9
w5500使用telnet问题?
10
v4.10 console 切换后, 只能输出打印, 不能接收指令
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
国产MCU移植系列教程汇总,欢迎查看!
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
五分钟玩转RT-Thread新社区
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
最新文章
1
【RT-Thread】【ci】【scons】将ci.attachconfig.yml和scons结合使用
2
Rt-thread中OTA下载后,bootloader不搬程序
3
ulog 日志 LOG_HEX 输出时间改为本地日期时间
4
在RT-Thread Studio中构建前执行python命令
5
研究一了一段时间RTT,直接标准版上手太难,想用nano,但又舍不得组件
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
FinSH
ART-Pi
USB
DMA
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
RTC
FAL
rt-smart
I2C_IIC
ESP8266
UART
WIZnet_W5500
ota在线升级
cubemx
PWM
flash
freemodbus
BSP
packages_软件包
潘多拉开发板_Pandora
定时器
ADC
flashDB
GD32
socket
编译报错
中断
Debug
rt_mq_消息队列_msg_queue
SFUD
msh
keil_MDK
ulog
C++_cpp
MicroPython
本月问答贡献
出出啊
1518
个答案
343
次被采纳
小小李sunny
1444
个答案
290
次被采纳
张世争
813
个答案
177
次被采纳
crystal266
547
个答案
161
次被采纳
whj467467222
1222
个答案
149
次被采纳
本月文章贡献
出出啊
1
篇文章
5
次点赞
小小李sunny
1
篇文章
1
次点赞
张世争
1
篇文章
3
次点赞
crystal266
2
篇文章
2
次点赞
whj467467222
2
篇文章
2
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部