资源简介
使用qt4.8 在ubuntu环境下写的一个串口的开发程序。其中是基于zigbee的传感器模块,包括温湿度检测,电机控制,等等

代码片段和文件信息
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
//#include
#include
#include “camerainit.h“
static int fd = -1;
struct buffer {
void * start;
size_t length;
};
//static io_method io = IO_METHOD_MMAP;
struct buffer * buffers1 = NULL;
static unsigned int n_buffers = 0;
// global settings
static unsigned int width = 800;
static unsigned int height = 480;
static char* deviceName = “/dev/video0“;
char image_buf[1536000+54];
unsigned char bmp_h[] ={
0x420x4d //BM
0x420x700x170x00 // 172000+66
0x000x000x000x00
0x360x000x000x00 //bmp_data offset
0x280x000x000x00
0x200x030x000x00 //width
0xE00x010x000x00 //hieght
0x010x00
0x200x00 //32bit
0x000x000x000x00
0x000x700x170x00 //bmp_data size
0x000x000x000x00
0x000x000x000x00
0x000x000x000x00
0x000x000x000x00
};
void deviceOpen(void)
{
fd = open(deviceName O_RDWR /* required */ | O_NONBLOCK 0);
// check if opening was successfull
if (-1 == fd)
{
fprintf(stderr “Cannot open ‘%s‘: %d %s\n“ deviceName errno strerror (errno));
//exit(EXIT_FAILURE); //liaoxp 20140216
}
}
/**
initialize device
*/
void deviceInit(void)
{
struct v4l2_capability cap;
struct v4l2_cropcap cropcap;
struct v4l2_crop crop;
struct v4l2_format fmt;
unsigned int min;
if (-1 == xioctl(fd VIDIOC_QUERYCAP &cap))
{
if (EINVAL == errno)
{
fprintf(stderr “%s is no V4L2 device\n“deviceName);
exit(EXIT_FAILURE);
} else
{
errno_exit(“VIDIOC_QUERYCAP“);
}
}
if (!(cap.capabilities & V4L2_CAP_VIDEO_CAPTURE))
{
fprintf(stderr “%s is no video capture device\n“deviceName);
exit(EXIT_FAILURE);
}
struct v4l2_input input;
input.index = 0;
if ( ioctl(fd VIDIOC_ENUMINPUT &input) != 0)
{
printf(“ set input error.\n“);
exit(0);
}
if ((ioctl(fd VIDIOC_S_INPUT &input)) < 0)
{
printf(“set s_input error.\n“);
exit(0);
}
/* Select video input video standard and tune here. */
CLEAR(cropcap);
cropcap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
if (0 == xioctl(fd VIDIOC_CROPCAP &cropcap))
{
crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
crop.c = cropcap.defrect; /* res
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 603017 2018-10-18 16:17 IOT128\1.png
文件 603017 2018-10-18 16:29 IOT128\final\1.png
文件 9217 2018-10-23 17:26 IOT128\final\camerainit.cpp
文件 501 2018-10-23 17:26 IOT128\final\camerainit.h
文件 6920 2018-10-23 17:22 IOT128\final\camerainit.o
文件 993 2018-10-23 17:27 IOT128\final\constant.h
文件 230 2018-10-16 22:43 IOT128\final\enddevice.cpp
文件 300 2018-10-16 22:43 IOT128\final\enddevice.h
文件 1348 2018-10-23 17:35 IOT128\final\enddevice.o
文件 712638 2018-10-23 17:35 IOT128\final\Intelligent
文件 799 2018-10-23 17:30 IOT128\final\Intelligent.pro
文件 14147 2018-10-23 17:35 IOT128\final\Intelligent.pro.user
文件 0 2018-10-18 22:39 IOT128\final\Intelligent.pro.user.1.3
文件 182 2018-10-16 22:43 IOT128\final\main.cpp
文件 1604 2018-10-23 17:35 IOT128\final\main.o
文件 17201 2018-10-23 17:34 IOT128\final\mainwindow.cpp
文件 2390 2018-10-23 17:34 IOT128\final\mainwindow.h
文件 55708 2018-10-23 17:35 IOT128\final\mainwindow.o
文件 9674 2018-10-18 19:18 IOT128\final\mainwindow.ui
文件 14338 2018-10-23 17:31 IOT128\final\Makefile
文件 236 2018-10-16 22:43 IOT128\final\messagequeue.cpp
文件 238 2018-10-16 22:43 IOT128\final\messagequeue.h
文件 1688 2018-10-23 17:35 IOT128\final\messagequeue.o
文件 2331 2018-10-23 17:35 IOT128\final\moc_enddevice.cpp
文件 4128 2018-10-23 17:35 IOT128\final\moc_enddevice.o
文件 6160 2018-10-23 17:35 IOT128\final\moc_mainwindow.cpp
文件 11412 2018-10-23 17:35 IOT128\final\moc_mainwindow.o
文件 3098 2018-10-23 17:35 IOT128\final\moc_mythread.cpp
文件 5056 2018-10-23 17:35 IOT128\final\moc_mythread.o
文件 3097 2018-10-23 17:35 IOT128\final\moc_qextserialba
............此处省略47个文件信息
- 上一篇:水墨屏 stm32f103核心板
- 下一篇:MyEclipse10汉化包+教程
相关资源
- vtk QT做的三维地质可视化系统2of2
- Qt局域网聊天软件
- Qt Creator opengl实现四元数鼠标控制轨迹
- QT局域网聊天系统(基于QT5.修改过)
- qt-电子点菜系统
- C 餐厅叫号系统(QT平)
- QT 实现文件下载
- qt图像处理
- QT,JPEG解码源代码(已完成)
- Qt 播放音频文件
- Qt 读取16进制的data文件
- MQTT+串口(usart)透传
- 易语言QQTEA算法源码
- VC工程转Qt工程文件的工具
- MQTT推送Demo
- 基于Linux、QT的视频监控系统的设计与
- Qt 百度地图 定位
- QT酷炫界面开发指南《QmlBook》
- Ubuntu下操作Excel,qt代码
- Qt图片浏览器 --基于Qt的Graphics View f
- qtnribbon2破解
- Qt软件开发 完整项目代码
- MQTT_3.1protocol_Specific中文版
- 在QT中使用RTP进行视频的采集和传输
- Mini6410 Qt4和Qtopia编程开发指南
- Qt实现Code39条形码
- qt_ffmpeg_mp4_export_and_import.zip
- QT5.5入门与项目实战
- Huffman Compress 霍夫曼编码 压缩 解压缩
- 基于QT的黑白棋游戏设计和实现
评论
共有 条评论