- Timestamp:
- 09/07/2017 03:25:09 PM (9 years ago)
- Location:
- branches/fep_client_cpp
- Files:
-
- 3 edited
-
fep_client.cpp (modified) (4 diffs)
-
network.h (modified) (3 diffs)
-
network_factory.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/fep_client_cpp/fep_client.cpp
r72 r73 30 30 void xfer_replys(CLIENT *clnt, FEP_LINE_LDS *lines, int lines_size, LDS_LOOP *ldsMap) 31 31 { 32 printf("Lines_size %d\n", lines_size);33 32 int i, j; // i == line_index, j == lds_index 34 33 void *rv; 34 35 35 // Send one reply for every "line" in the FEP 36 36 for (i = 0; i < lines_size; i++) … … 59 59 */ 60 60 fepReply.schedule_time = time(NULL); 61 62 61 63 62 fepReply.user_info1 = lines[i].lineNum; … … 99 98 100 99 // send out data 101 printf(" line=%d, lds=%d\n", lines[i].lineNum, ldsMap[index].drop);100 printf("Transferring line=%d, lds_drop_no=%d...\n", lines[i].lineNum, ldsMap[index].drop); 102 101 rv = fep_reply_xfer_32(&fepReply, clnt); 103 102 … … 138 137 /* Load data to be xfered to ATMS */ 139 138 int lines_size = 0; 140 printf("Loading lines and ldsMap\n");139 printf("Loading lines\n"); 141 140 FEP_LINE_LDS *lines = load_lines(&lines_size, "./lines_atms.txt"); 142 printf(" Done loading lines\n");141 printf("Loading ldsMap...\n"); 143 142 LDS_LOOP *ldsMap = load_lds("./lds_atms.txt"); 144 printf("Done loading lines and lds...\n");145 143 146 144 /* Transfer data to ATMS */ 145 printf("Transferring data to ATMS...\n"); 147 146 xfer_replys(clnt, lines, lines_size, ldsMap); 148 147 149 148 /* Free allocated memory */ 149 printf("Freeing lines and ldsMap...\n"); 150 free(lines); 151 free(ldsMap); 150 152 151 153 /* Destroy client */ -
branches/fep_client_cpp/network.h
r72 r73 4 4 5 5 using namespace std; 6 // the first byte is not considered in the calculation of "BYTE 2"7 const int Fixed_Byte_To_Checksum = 25;8 6 7 /*** CONSTANTS ***/ 8 const int Fixed_Byte_To_Checksum = 25; // the first byte is not considered in the calculation of "BYTE 2" 9 9 const int CONTROL_DATA_LEN = 27; 10 11 10 char * const dp5[8] = { "ML_1", "ML_2", "ML_3", "ML_4", "ML_5", 12 11 "ML_6", "HOV_Lane", "FYW_Conn"}; … … 18 17 "SD_6", "Pass_Vol_Count", "X"}; 19 18 20 21 19 /*** NETWORK STRUCTS ***/ 22 20 typedef struct loopagg LOOPAGG; 23 21 struct loopagg … … 52 50 }; 53 51 52 // Loop detector station: has several loops 54 53 typedef struct Lds_loop LDS_LOOP; 55 54 struct Lds_loop -
branches/fep_client_cpp/network_factory.cpp
r72 r73 2 2 #include <vector> 3 3 #include <math.h> 4 4 5 // determine if a loop has data based on lane config data 5 6 bool DataAvail(char flag, int num) … … 34 35 } 35 36 37 // Initializes the LDS_LOOP dataPack with all necessary static data and default dynamic data 36 38 void init_loop_dataPack(LDS_LOOP *loop) 37 39 { 38 int j = 0; 40 int j; 41 // Allocate memory for dataPack 39 42 loop->dataPack = (unsigned char *) calloc(sizeof(unsigned char), loop->length); 43 40 44 // dataPack 5-8: lane config 41 45 char d5 = 0, d6 = 0, d7 = 0, d8 = 0;
Note: See TracChangeset
for help on using the changeset viewer.
