《SDEASYCAM 手机APP软件 后30页代码.docx》由会员分享,可在线阅读,更多相关《SDEASYCAM 手机APP软件 后30页代码.docx(31页珍藏版)》请在第壹文秘上搜索。
1、#pragmamark-保存设置-(void)save:(id)sender(NSIntegerstart,end;startSWeekIndex*49+SHourIndex*2+SMinuteIndex;end=eWeekindex49+eHorlnde*2+eMintelnde;if(endstart)for(NSIntegeri=start:isDayData,planTime,sizeof(plaTime);s2-u32SchedulType=AVIOTCSCHEDULETYPEALARM;self.camerasendlOClrlToChannel:0Type:IOTYPE_USER
2、_IPCAM_SET_SCHEDULE_REQData:(Char*)s2Dalasizersizeof(SMsgAvioctrISetScheduIeReq);free(s2);!);eseif(sWeeklndex=6&eWeeklndex=0&eHourlndex=0&eMinutelndex=0)(end=342:for(NSIntegeri=start;isDayData,planTime,sizeof(planTime);s2-u32ScheduleType=AVIOTC_SCHEDULETYPE_ALARM;self.camerasendlOCtrlToChannel:0Type
3、:IOTYPE_USER_IPCAM_SET_SCHEDULE_REQData:(char*)s2Datasizersizeof(SMsgAvioctrISetScheduIeReq);free(s2);!);elseif(sWeeklndex=0&sHourlndex=0&sMinutelndex=0&eWeeklndex=0&eHourlndex=0&eMinutelndex=0)(else(MBProgressHUDshowError:(NSStringstringWithFormat:NSLocalizedString(Error,Plstrysettingtimeagain!,ret
4、urn;/saveandIoadup/sendCMDSMsgAvioctrISetGuardReqEn*s1=malloc(sizeof(SMsgAVItrlSetGuardReqEn);memset(s1,O,sizeof(SMsgAVItrlSetGuardReqEn);s1-chanel=O;/memcpy(s1-ftpServer1sServerUTF8String,(sServerlength);Hmemcpy(s1-userName,sAccountUTF8String,sAccountlength);Hmemcpy(sl-password,sPasswdUTF8Strig,sPa
5、sswdlength);Hs1-ftpPort=(int)nPort;s1-alarm_motion_armed=self.isMotioSwitch;s1-alarm_motion_sensitivityself.motionDetection:sl-alarm_preset=self.alarmPresetValue;(Self-CamerasendlOCtrIToChannekOType:IOTYPE_USER_IPCAM_SETGUARD_REQData:(char*)s1Datasizersizeof(SMsgAvioctrISetGuardReqEn);free(s1):Z/2sa
6、vevideotoSDCardSMsgAvioctrISetAlarmLinkageReqs2=mall。C(SiZeOf(SMSgAVIoCmSetAIarmLinkageReq);memset(s2,O,Sizeof(SMsgAvioctrISetAIarmLinkageReq);s2-channel=O;s2-VidToSDCard(inl)self.isSaveVideoToSD;Self-CamerasendIOCtriToChannekOType:IOTYPE_USER_IPCAM_SET_ALARM_LINKAGE_REQData:(char)s2Datasizeisizeof(
7、SMsgAvioctrISetAlarmLinkageReq);free(s2);/quit(self.navigationControllerpopViewControllerAnimatedYES;)#pragmamark-sensiSpresetDelegate-(Vold)ClidSeleCtsenSitiVityValUe:(NSlnteger)VaIUe(self.motionDetection=value;SeIf-IabIeViewreIoadData;-(void)didSelectPresetValue:(NSInteger)valueself.alarmPreselVal
8、uevalue;SeIf-IabIeViewreIoadData;#pragmamark-MyCameraDeIegateMethods-(VOid)Camera:(MyCamera)Camera_didReceivelOClrlWithType:(NSIntec)er)typeData:(COnSlehar*)dataDataSiZe:(NSlntegerjSiZeif(camera.=self.camera&type=IOTYPE_USER_IPCAM_GETGUARD_RESP)1057SMsgAvioctrIGetGuardRespEn*s=(SMSgAVioetriGetGUardR
9、eSPEn)data;SelfjsMotionSwitchs-alarm_motion_armed;self.motionDetection=s-aarmmotionsensitivity;NSLog(%ld,(Iong)SeILmotionDetection);self.alarmPresetValues-alarm_PreSel;SelfjabeIHinLhiddenMYES;(Self-SenderIndicatorstopAnimating;self.navigationltem.righiBarButtonltem.enabledlself.senderlndicator.isAni
10、mating;SetfAabIeViewreIoadData;elseif(camera,=self.camera&type=IOTYPEUSERIPCAMGETMOTIONDETECTRESP)(SMsgAvioctrIGetMotionDetectResps=(SMsgAVIoctrtGtMotionDtectRsp*)clata;self.motionDetection=s-sensitivity;SetfJabIeViewreIoadData;Jelseif(camera.=self.camera&type=IOTYPE_USER_IPCAM_SET_ALARM_LINKAGE_RES
11、P)SMsgAvioctrISetAIarmLinkageResp*s=(SMSgAVlOCtrlSetAIarmLinkageReSPdata;if(s-32Resut=O)(NSLog(”设pic&video保存到ftp成功!!);SeIf-IabIeViewreIoadData;elseif(camera_=sclf.camera&type=IOTYPEUSERIPCAMGETALARMLINKAGERESP)/SMsgAvioctrIGetAIarmLinkageResp(1057SMSgAVloCmGetAIarmLinkageReSP*s=(SMsgAVIoctrIGetAIarm
12、LinkageResp*)data;SelfjsSaveVideoToSDsvidToSDCard;self.tableViewreIoadData;#pragmamark-UipickerViewDataSoure-(NSInteger)numberOfComponentslnPickerView:(UIPickerView,)pickerViewif(pickerType=WEEK_PICKER_VIEW)return1;elseif(pickerType=HM_PICKER_VIEW)(return2;retur1;)-(NSInteger)PiCkeMeW:(UIPiCkerVieW*)pickerViewnumberOfRowslnComponentr(NSInteger)mponent(if(pickerType=WEEK_PICKER_VIEW)(returnweekArr.count;elseif(pickerType=HM_PICKERVIEW)(if(component-0)