关于 Qt 中使用 GSM/GPRS 调制解调器的网络浏览器的想法
我已成功将 Telit GL 865 GSM/GPRS 调制解调器连接至我的 Atmel 微处理器。我的 POC 板运行嵌入式 Linux,我还交叉编译了 Qt 库(包括 Webkit)并将其传输到板。
我还可以通过打开 FD(文件描述符)然后执行命令来从 Qt 应用程序读取和写入 AT 命令。
我还能够连接到 GPRS,并获得 HTTP 响应。目前,我正在通过 QWebView 的 setHTML() 函数设置从 AT 命令获取的 HTML。但这样图像不会加载(显然),而且我也无法浏览链接,因为浏览器无法直接访问互联网。那么,我的 Qt Webkit 浏览器可以使用调制解调器直接通过 GPRS 进行通信的正确实现是什么?
I have successfully interfacted Telit GL 865 GSM/GPRS modem to my Atmel microprocessor. My POC board is running embedded linux and I have also cross compiled Qt libraries(including Webkit) and transferred it to the board.
I can also read and write AT commands from Qt application by opening an FD(File descriptor) and then executing commands.
I'm also able to connect to the GPRS, also getting HTTP response. Currently I'm setting the HTML that I get from AT commands, through the QWebView's setHTML() function. But by this the images doesn't load(obviously) and also I cannot navigate through the links as the browser doesn't have a direct access to the Internet. So what is the proper implementation by which my Qt Webkit browser can directly communicate over GPRS using my modem ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看来您正在应用程序级别构建 TCP/IP 堆栈。通常这是一个内核任务。
WebKit 完全能够创建 HTTP 响应,但它希望将它们交给内核。具体来说,它通常创建一个 TCP 套接字,连接到 Web 服务器的端口 80,通过套接字发送 HTTP 请求,并从套接字检索 HTTP 响应。
所以,看来你只是缺少一个驱动程序。与其说这是一个真正的编程问题,不如说这是一个 Linux 问题。
It seems you're building your TCP/IP stack at application level. Normally that's a kernel task.
WebKit is perfectly capable of creating HTTP responses, but it expects to hand them off to the kernel. Specifically, it normally creates a TCP socket, connect to port 80 of the webserver, sends the HTTP request over the socket, and retrieves the HTTP response from the socket.
So, it seems you're just missing a driver. That's not really a programming question so much as a Linux question.
您需要为 QWebPages 设置属性。像这样的东西:
查看 QWebSettings 文档 了解更多 Webkit 属性。 ..
UPD:如果您直接使用 AT 命令而不是驱动程序来使用 tcp-ip,那么@MSalters 解释也是您的浏览器工作的先决条件...
You need to set up attributes for your QWebPages. something like this:
look into QWebSettings docs for more Webkit attributes...
UPD: if you work with tcp-ip directly with AT commands, not with drivers, than @MSalters explanation is also pre-requisite for your browser to work...