cf680SDK.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. //
  2. // cf680SDK.h
  3. // cf680SDK
  4. //
  5. // Created by tommy on 2023/8/28.
  6. //
  7. // https://blog.51cto.com/u_15740864/5542137?articleABtest=0
  8. #import <UIKit/UIKit.h>
  9. #import <Foundation/Foundation.h>
  10. @interface cf680SDK : NSObject
  11. -(void) SetVideoRect:(CGRect)FrameRect viewlay:(CALayer *)layer; //Normal windows.
  12. -(void) SetVideoFullScreenRect:(CGRect) FrameRect; //full screen windows.
  13. -(void) ShowVideoRect:(Boolean) hidden; //display or hidden windows.
  14. -(void) SetVideoWindows:(int) mode; //display windows mode. 0: Normal windows; 1: full screen windows
  15. //设置抓拍图片保存路径
  16. -(void) SetCapturePath:(char *)foldpath; //set jpg path;
  17. //手工抓拍一张,制定要保存的文件名称 比如 20240801144020.jpg
  18. -(void) ManualCapture:(char *)filename; //capture one;
  19. //打开视频
  20. -(int) StartVideo:(char *) ipaddr; //device ip: 192.168.1.1
  21. //关闭视频
  22. -(void) StopVideo;
  23. /* 视频文件保存路径 jpgvideo
  24. //视频文件名称 20240801143820.mov
  25. -(NSString *)recordSavedPath:(NSString *) recordName
  26. {
  27. NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  28. NSString *documentPath = [path objectAtIndex:0];
  29. NSFileManager *fileManager = [NSFileManager defaultManager];
  30. NSString *imageDocPath = [documentPath stringByAppendingPathComponent:@"jpgvideo"];
  31. [fileManager createDirectoryAtPath:imageDocPath withIntermediateDirectories:YES attributes:nil error:nil];
  32. NSString * imagePath = [imageDocPath stringByAppendingPathComponent:recordName];
  33. return imagePath;
  34. }
  35. */
  36. //启动录像. 是否推送到相册 0: 不用 1:推送
  37. -(void) JPGStartRecord:(int) savetoalbum;
  38. //停止录像
  39. -(void) JPGStopRecord;
  40. //1 成功. char Version[32]
  41. -(int)GetDeviceVersion:(char *)Version;
  42. //1: 成功 -4 10秒链接超时。-1 错误
  43. //-(int)GetConnectStatus;
  44. //以下函数在设备使用路由模式下使用,一般无用。
  45. -(int) FindDevice:(char *)ipaddr;
  46. //char ssid[32];
  47. //char pwd[20];
  48. int getwifiinfo(char* ip,int port,char *ssid,char *pwd);
  49. //mode: 0---switch to AP mode. 1: set route info. channel: 157/36
  50. int setwifiinfo(char* ip,int port,int mode,int channel,char *ssid,char *pwd);
  51. @end