| | |
| | | #define API_POST_EZ_GetCoverSwitchStaus @"/home-wisdom/platform/yingshi/getCoverSwitchStatus"//获取萤石镜头遮蔽开关状态 |
| | | #define API_POST_EZ_GetCoverSwitch @"/home-wisdom/platform/yingshi/coverSwitch"//设置萤石镜头遮蔽开关 |
| | | #define AOI_POST_EZ_UpdateAnswerStatus @"/home-wisdom/platform/yingshi/lock/updateAnswerStatus" // 更改门铃通话状态(接听和未接) |
| | | #define API_POST_EZ_GetAiSupportList @"/home-wisdom/platform/yingshi/getAiSupportList"//获取摄像头智能算法列表和状态 |
| | | #define API_POST_EZ_SetAiSupport @"/home-wisdom/platform/yingshi/setAiSupport"//设置摄像头智能算法 |
| | | |
| | | #pragma mark APP_KEY |
| | | #define APP_KEY @"HDL-HOME-APP-TEST" |
| | | #define SECRET_KEY @"WeJ8TY88vbakCcnvH8G1tDUqzLWY8yss" |
| | | #define APP_KEY @"QWERREWQ" |
| | | #define SECRET_KEY @"CPBUCTRLCPBUABCD" |
| | | |
| | | |
| | | #define TIME_OUT 30.0f |
| | |
| | | }]; |
| | | } |
| | | |
| | | /** |
| | | * @since 获取摄像头智能算法列表和状态 |
| | | * @param deviceSerial 设备序列号 |
| | | * @param completion 回调block,error为空时表示成功 |
| | | */ |
| | | - (void)getAiSupportDetectionList:(NSString *)deviceSerial |
| | | completion:(void (^)(ResponseData *responseData))completion { |
| | | //设置请求参数 |
| | | NSMutableDictionary *parameters = [NSMutableDictionary dictionary]; |
| | | [parameters setValue:deviceSerial forKey:@"deviceSerial"]; |
| | | // [parameters setValue:@(1) forKey:@"platform"]; |
| | | // [parameters setValue:[NSString stringWithFormat:@"%@",[GlobalKit shareKit].hdlAppKey] forKey:@"appKey"]; |
| | | // [parameters setValue:[GlobalKit shareKit].hdlHomeId forKey:@"homeId"]; |
| | | |
| | | parameters = [self GetSignRequestDictionary:parameters]; |
| | | |
| | | NSLog(@"获取设备消息参数:%@",parameters); |
| | | |
| | | [self requestHttpsPost:API_POST_EZ_GetAiSupportList parameters:parameters completion:^(ResponseData *responseData) { |
| | | if (completion) { |
| | | completion (responseData); |
| | | } |
| | | }]; |
| | | } |
| | | |
| | | /** |
| | | * @since 设置摄像头智能算法 |
| | | * @param deviceSerial 设备序列号 |
| | | * @param code 智能算法编码 |
| | | * @param completion 回调block,error为空时表示成功 |
| | | */ |
| | | - (void)setAiSupportDetection:(NSString *)deviceSerial |
| | | code:(NSString *)code |
| | | completion:(void (^)(ResponseData *responseData))completion { |
| | | //设置请求参数 |
| | | NSMutableDictionary *parameters = [NSMutableDictionary dictionary]; |
| | | [parameters setValue:deviceSerial forKey:@"deviceSerial"]; |
| | | [parameters setValue:code forKey:@"code"]; |
| | | // [parameters setValue:@(1) forKey:@"platform"]; |
| | | // [parameters setValue:[NSString stringWithFormat:@"%@",[GlobalKit shareKit].hdlAppKey] forKey:@"appKey"]; |
| | | // [parameters setValue:[GlobalKit shareKit].hdlHomeId forKey:@"homeId"]; |
| | | |
| | | parameters = [self GetSignRequestDictionary:parameters]; |
| | | |
| | | NSLog(@"获取设备消息参数:%@",parameters); |
| | | |
| | | [self requestHttpsPost:API_POST_EZ_SetAiSupport parameters:parameters completion:^(ResponseData *responseData) { |
| | | if (completion) { |
| | | completion (responseData); |
| | | } |
| | | }]; |
| | | } |
| | | |
| | | |
| | | /// 刷新token |
| | | /// @param block 结果 |
| | | - (void)refreshHDLToken:(void (^)(BOOL isSuccess))block{ |
| | |
| | | UInt64 recordTime = [[NSDate date] timeIntervalSince1970]*1000; |
| | | [params setValue:APP_KEY forKey:@"appKey"]; |
| | | [params setValue:[NSString stringWithFormat:@"%llu",recordTime] forKey:@"timestamp"]; |
| | | NSLog(@"##########APPKEY:%@, SECRET_KEY:%@", APP_KEY, SECRET_KEY); |
| | | //1.对KEY升序 |
| | | NSArray *keyArray = [params allKeys]; |
| | | NSArray *sortKeyArray = [keyArray sortedArrayUsingComparator:^NSComparisonResult(id _Nonnull obj1, id _Nonnull obj2) { |