Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- uint32_t Size_Conv()
- {
- uint8_t List_Size[4]={0,0,0,0}, Count = 32, Count2=0, Count3=0;
- uint8_t Pedding_Bytes[10]={0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39};
- All_Data_Download_Flag = 0;
- while(receiveBuffer[Count] != 0x0D)
- {
- for(Count3=0; Count3<=9; Count3++)
- {
- if( receiveBuffer[Count] == Pedding_Bytes[Count3])
- {
- List_Size[Count2] = Count3;
- }
- }
- Count++;
- Count2++;
- }
- if(List_Size[3] == 0)
- {
- List_Size[3] = List_Size[2];
- List_Size[2] = List_Size[1];
- List_Size[1] = List_Size[0];
- List_Size[0] = 0;
- All_Data_Download_Flag = 0;
- }
- if( (List_Size[3] == 0) && (List_Size[2] == 0) )
- {
- List_Size[3] = List_Size[1];
- List_Size[2] = List_Size[0];
- List_Size[1] = 0;
- List_Size[0] = 0;
- All_Data_Download_Flag = 0;
- }
- if( (List_Size[3] == 0) && (List_Size[2] == 0) && (List_Size[1] == 0) )
- {
- List_Size[3] = List_Size[0];
- List_Size[2] = 0;
- List_Size[1] = 0;
- List_Size[0] = 0;
- All_Data_Download_Flag = 0;
- }
- if( (List_Size[3] == 0) && (List_Size[2] == 0) && (List_Size[1] == 0) && (List_Size[0] == 0) )
- {
- All_Data_Download_Flag = 0;
- }
- Result = (uint32_t)(1*1000) + (uint32_t)(0*100) + (uint32_t)(4*10) + (uint32_t)9;
- return Result ;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement