SystemInfoConfig.mm 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. //
  2. // SystemInfoConfig.m
  3. // FunSDKDemo
  4. //
  5. // Created by XM on 2018/5/7.
  6. // Copyright © 2018年 XM. All rights reserved.
  7. //
  8. #import "SystemInfoConfig.h"
  9. #import "SystemInfo.h"
  10. @interface SystemInfoConfig ()
  11. {
  12. SystemInfo sysInfo;
  13. }
  14. @end
  15. @implementation SystemInfoConfig
  16. #pragma mark - 1、获取设备systeminfo
  17. - (void)getSystemInfo{
  18. ChannelObject *channel = [[DeviceControl getInstance] getSelectChannel];
  19. CfgParam* paramSysInfo = [[CfgParam alloc] initWithName:@"SystemInfo" andDevId:channel.deviceMac andChannel:-1 andConfig:&sysInfo andOnce:YES andSaveLocal:NO];
  20. [self AddConfig:paramSysInfo];
  21. [self GetConfig];
  22. }
  23. #pragma mark - 3、解析配置信息后回调
  24. - (void)OnGetConfig:(CfgParam *)param {
  25. if ( [param.name isEqualToString:[NSString stringWithUTF8String:sysInfo.Name()]]) {
  26. if (param.errorCode <= 0) {
  27. //获取设备systeminfo失败
  28. }else{
  29. ChannelObject *channel = [[DeviceControl getInstance] getSelectChannel];
  30. DeviceObject *object = [[DeviceControl getInstance] GetDeviceObjectBySN:channel.deviceMac];
  31. //设备升级时间
  32. object.info.buildTime = [NSString stringWithUTF8String:sysInfo.BuildTime.Value()];
  33. //设备序列号
  34. object.info.SerialNo = [NSString stringWithUTF8String:sysInfo.SerialNo.Value()];
  35. //设备硬件版本号
  36. object.info.hardWare = [NSString stringWithUTF8String:sysInfo.HardWare.Value()];
  37. //设备软件版本号
  38. object.info.softWareVersion = [NSString stringWithUTF8String:sysInfo.SoftWareVersion.Value()];
  39. //当前的网络类型
  40. object.info.netType = (NetTypeModel)param.param2;
  41. //设备模拟通道数量
  42. object.info.nVideoInChanNum = sysInfo.VideoInChannel.Value();
  43. }
  44. if ([self.delegate respondsToSelector:@selector(SystemInfoConfigGetResult:)]) {
  45. [self.delegate SystemInfoConfigGetResult:param.errorCode];
  46. }
  47. }
  48. }
  49. #pragma mark - 2、请求结果回调
  50. - (void)OnFunSDKResult:(NSNumber *)pParam {
  51. //传回底层进行数据解析,无需其他处理
  52. [super OnFunSDKResult:pParam];
  53. }
  54. @end