在 C 程序中使用 telnet [英] Using telnet in a C Program
问题描述
我正在从事机器人自动化项目,但遇到了障碍.要控制机器人,需要通过telnet与它无线连接,并通过tcp/ip协议发送命令.(例如,'Mabc' 命令根据左轮速度 (a)、右轮速度 (b) 和时间 (c) 将其向前移动).我想要做的是在 C 程序中进行一些计算,然后根据计算值向机器人发送消息.
I am working on a robot automation project and I have run into a road block. To control the robot, one needs to connect with it wirelessly via telnet and send commands through the tcp/ip protocol. (ex. The 'Mabc' command moves it forward based on the left wheel speed (a), the right wheel speed (b) and time (c)). What I am trying to do is do some calculations in a C program and then send a message to the robot based on the value of the calculation.
如何在C程序中通过tcp/ip协议发送命令?
How can send commands via tcp/ip protocol in a C program?
谢谢!
埃里克
推荐答案
您正在寻找套接字.这是 C 语言套接字编程的综合指南. Telnet 也是一个定义明确的协议,尽管我不知道这个机器人是否会使用 telnet(对于一个协议来说,这是额外的处理开销,对机器人控制程序没有太多好处).RFC 854
You are looking for sockets. This is a comprehensive guide to socket programming in C. Telnet is also a well defined protocol, although I don't know if this robot would use telnet or not (it's extra processing overhead for a protocol that wouldn't have much added benefit for a robot control program). Telnet is covered in detail by RFC 854
这篇关于在 C 程序中使用 telnet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!