|
@@ -89,6 +89,8 @@
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ self.curUploadPostion = [fileLengthNum longValue];
|
|
|
+
|
|
|
if(self.curUploadFileDataMod.curUploadFileType == uploadFileTypeImage){
|
|
|
[self beginGotoUploadImageFun:fileLengthNum];
|
|
|
}
|
|
@@ -243,6 +245,7 @@
|
|
|
fileLengthNum = data[@"fileLenth"];
|
|
|
}
|
|
|
|
|
|
+ self.curUploadPostion = [fileLengthNum longValue];
|
|
|
[self handleUploadingFun:fileLengthNum];
|
|
|
}
|
|
|
else if ([status isEqualToString:@"2"]) {
|
|
@@ -324,6 +327,11 @@
|
|
|
#pragma mark 处理上传过程
|
|
|
- (void)handleUploadingFun:(NSNumber*)fileLengthNum
|
|
|
{
|
|
|
+ //异常处理
|
|
|
+ if(fileLengthNum.longValue < 0)
|
|
|
+ {
|
|
|
+ return;
|
|
|
+ }
|
|
|
|
|
|
BOOL isCanUseCellular = [HWDataManager getBoolWithKey:stringKeyAddSn(Const_file_Transfe_canUse_Cellular)];
|
|
|
|
|
@@ -470,6 +478,24 @@
|
|
|
return [NSData dataWithBytes:result length:sizeof(result)];
|
|
|
}
|
|
|
|
|
|
+// long转NSData
|
|
|
+- (NSData *)long2Data:(long)i{
|
|
|
+ Byte b0 = i & 0xff;
|
|
|
+ Byte b1 = i >> 8 & 0xff;
|
|
|
+ Byte b2 = i >> 16 & 0xff;
|
|
|
+ Byte b3 = i >> 24 & 0xff;
|
|
|
+ Byte b4 = i >> 32 & 0xff;
|
|
|
+ Byte b5 = i >> 40 & 0xff;
|
|
|
+ Byte b6 = i >> 48 & 0xff;
|
|
|
+ Byte b7 = i >> 56 & 0xff;
|
|
|
+
|
|
|
+ // 有大小端模式问题?
|
|
|
+ //Byte result[] = {b0, b1, b2, b3};
|
|
|
+ //Byte result[] = {b3, b2, b1, b0};
|
|
|
+ Byte result[] = {b7, b6, b5,b4,b3, b2, b1, b0};
|
|
|
+ return [NSData dataWithBytes:result length:sizeof(result)];
|
|
|
+}
|
|
|
+
|
|
|
// short转NSData
|
|
|
- (NSData *)short2Data:(short)i{
|
|
|
Byte b0 = i & 0xff;
|
|
@@ -509,7 +535,8 @@
|
|
|
|
|
|
//msgType
|
|
|
//unsigned char msgType = 12;
|
|
|
- unsigned char msgType = 15;
|
|
|
+ //unsigned char msgType = 15;
|
|
|
+ unsigned char msgType = 20;
|
|
|
NSData *msgTypeData = [NSMutableData dataWithBytes:&msgType length:sizeof(msgType)];
|
|
|
//HLog(@"msgTypeData:%@",msgTypeData);
|
|
|
|
|
@@ -526,7 +553,7 @@
|
|
|
|
|
|
|
|
|
//curNum
|
|
|
- int curNum = (int)self.indexOfUploadFlie;
|
|
|
+ int curNum = (int)self.indexOfUploadFlie + 1;
|
|
|
//NSData *curNumData = [NSData dataWithBytes:&curNum length:sizeof(curNum)];
|
|
|
NSData * curNumData = [self int2Data:curNum];
|
|
|
//HLog(@"curNumData:%@",curNumData);
|
|
@@ -537,6 +564,10 @@
|
|
|
NSData * totalNumData = [self int2Data:totalNum];
|
|
|
//HLog(@"totalNumData:%@",totalNumData);
|
|
|
|
|
|
+ long Postion = self.curUploadPostion;
|
|
|
+ //long Postion = 100000000000;
|
|
|
+ NSData * PostionData = [self long2Data:Postion];
|
|
|
+ HLog(@"PostionData:%@",PostionData);
|
|
|
|
|
|
NSMutableData *checkBCCData = [NSMutableData new];
|
|
|
[checkBCCData appendData:msgTypeData];
|
|
@@ -544,6 +575,7 @@
|
|
|
[checkBCCData appendData:datalenData];
|
|
|
[checkBCCData appendData:curNumData];
|
|
|
[checkBCCData appendData:totalNumData];
|
|
|
+ [checkBCCData appendData:PostionData];
|
|
|
[checkBCCData appendData:curData];
|
|
|
|
|
|
long length = [curData length];
|