@@ -769,14 +769,30 @@ - (void)reportUserList:(data_report_t)report {
769769 [accessParam setValue: @([[TIoTCoreXP2PBridge getNowTimeTimestamp ] integerValue ]) forKey: @" Time" ];
770770 [accessParam setValue: @" ios" forKey: @" System" ];
771771 [accessParam setValue: @" app" forKey: @" Platform" ];
772- [accessParam setValue: appPeerName forKey: @" AppPeerName" ];
773- [accessParam setValue: deviceP2PInfo forKey: @" DeviceP2PInfo" ];
774772 [accessParam setValue: [self getAppUUID ] forKey: @" Uuid" ];
775773 [accessParam setValue: [self getAppUUID ] forKey: @" UserId" ];
776774 [accessParam setValue: self .pro_id forKey: @" ProductId" ];
777775 [accessParam setValue: self .dev_name forKey: @" DeviceName" ];
778776 [accessParam setValue: @(report.live_size) forKey: @" ByteCount" ];
779777 [accessParam setValue: @(0 ) forKey: @" Channel" ];
778+ [accessParam setValue: appPeerName forKey: @" AppPeerNameFromApp" ];
779+ [accessParam setValue: deviceP2PInfo forKey: @" DeviceP2PInfoFromApp" ];
780+ [accessParam setValue: @(report.appUpByte) forKey: @" AppUpByte" ];
781+ [accessParam setValue: @(report.appDownByte) forKey: @" AppDownByte" ];
782+ [accessParam setValue: [TIoTCoreXP2PBridge getSDKVersion ] forKey: @" AppVersion" ];
783+ if ([status isEqualToString: @" fail" ]) {
784+ [accessParam setValue: @" err" forKey: @" AppResult" ];
785+ [accessParam setValue: @(report.errorcode) forKey: @" AppFailMsg" ];
786+
787+ }else {
788+ [accessParam setValue: @" succ" forKey: @" AppResult" ];
789+ }
790+ NSString *appConnectIp = @" " ;
791+ if (report.appConnectIp != NULL ) {
792+ appConnectIp = [NSString stringWithCString: (const char *)report.appConnectIp encoding: NSASCIIStringEncoding];
793+ }
794+ [accessParam setValue: appConnectIp forKey: @" AppConnectIp" ];
795+
780796 NSURL *url = [NSURL URLWithString: @" https://applog.iotcloud.tencentiotcloud.com/api/xp2p_ops/applog" ];
781797 NSMutableURLRequest *reqlog = [NSMutableURLRequest requestWithURL: url cachePolicy: NSURLRequestUseProtocolCachePolicy timeoutInterval: 5 ];
782798 [reqlog setValue: @" application/json" forHTTPHeaderField: @" Content-Type" ];
@@ -791,7 +807,7 @@ - (void)reportUserList:(data_report_t)report {
791807 }];
792808 [tasklog resume ];
793809
794- if ([status isEqualToString: @" end" ]) {
810+ if ([status isEqualToString: @" end" ] || [status isEqualToString: @" fail " ] ) {
795811 [self .uniReqStartTime removeObjectForKey: reqid];
796812 }
797813}
0 commit comments