1- # this script can be used to generate log files for the CANedge e.g. for testing WiFi transfer
2-
31import os
42import hashlib
53
6- # specify details of log files (device ID should match your test device)
7- device_id = "534F281B"
8- file_type = "MF4"
9- sessions = 120
10- splits = 50
11- size_bytes = 2 * 1024 * 1024
124
13- # function for creating files
145def sha256_file (path ):
156 digest = hashlib .sha256 ()
167 with open (path , "rb" ) as f :
@@ -21,10 +12,17 @@ def sha256_file(path):
2112 digest .update (buf )
2213 return digest .hexdigest ().upper ()
2314
24- # run loop to create log files in folders
15+
16+ device_id = "3851A144" #"1973B1D6"
17+ file_type = "MF4"
18+ sessions = 30
19+ splits = 50
20+ session_offset = 20000
21+ size_bytes = 2 * 1024 * 1024
22+
2523dir_path = os .path .dirname (os .path .abspath (__file__ ))
2624
27- for session_no in range (1 , sessions + 1 ):
25+ for session_no in range (session_offset , sessions + session_offset ):
2826 for split_no in range (1 , splits + 1 ):
2927 tmp_file_name = "{}.mf4" .format (split_no )
3028 tmp_file_path = os .path .join (dir_path , tmp_file_name )
@@ -36,9 +34,7 @@ def sha256_file(path):
3634 # Calculate digest of file
3735 digest = sha256_file (tmp_file_path )
3836
39- # create folder name
4037 folder = f'{ session_no } ' .zfill (8 )
41-
4238 # Check whether the specified path exists or not
4339 isExist = os .path .exists (folder )
4440
0 commit comments