//查找设备
void *cameraThread_func(void *data) //起线程的函数有格式要求
{
struct Devices *cameraTemp;
cameraTemp = findDeviceByName("camera", pdeviceHead); //设备都要从工厂里面取出来
if (cameraTemp == NULL)
{ //防止段错误的必需判断,当给指针赋值是,一定要考虑NULL的情况,否则后续操作都是空谈
printf("find camera error\n");
pthread_exit(NULL); //在线程中不用return
}
cameraTemp->justDoOnce(); //调用postUrl函数
}
void *monitoring_thread(void *datas) //视频监控线程
{
system("./start_web_video.sh"); //执行脚本,打开视频监控
pthread_exit(NULL); //退出线程
}
基于树莓派的智能家居系统(四十二)——摄像头线程
最新推荐文章于 2024-05-19 18:51:10 发布