tw2815object.cpp
来自「C++封装的视频采集代码」· C++ 代码 · 共 61 行
CPP
61 行
#include <stdio.h> #include <stdlib.h> #include <errno.h> #include <string.h> #include <sys/stat.h>#include <sys/types.h>#include <fcntl.h>#include <unistd.h>#include <sys/ioctl.h>#include "Tw2815Object.h"/*Tw2815Object::Tw2815Object(){}Tw2815Object::~Tw2815Object(){}*/int Tw2815Object::Tw2815Open(){ tw2815fd_ = open(TW2815_DEVICE, O_RDWR | O_NONBLOCK, 0); if(tw2815fd_ < 0) { return TW2815_INTER_ERRER; } return 0;}int Tw2815Object::Tw2815Close(){ return 0;}int Tw2815Object::SetTw2815Color(tTw2815Color *pTw2815Color){ int Ret = 0; if (NULL == pTw2815Color) { return TW2815_INTER_ERRER; } Ret = ioctl(tw2815fd_, TW2815_S_COLOR, pTw2815Color); if (0 != Ret) { printf("SetTw2815Color:TW2815_S_COLOR fail, ret = %d\n", Ret); return TW2815_INTER_ERRER; } return 0; }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?