Go to the source code of this file.
Functions | |
void | B_copy (unsigned char main[], unsigned char tmp[], int ind, int n) |
void | H2S (char a[], unsigned char temp_6[]) |
void | i2c (int t, unsigned char temp[]) |
void | li2c (long int t1, unsigned char temp_1[]) |
void | f2c (float f, unsigned char temp_4[]) |
int | c2i (unsigned char temp_2[]) |
long int | c2li (unsigned char temp_3[]) |
uint16_t | compute_CRC (unsigned char *message, char length) |
void | sigchld_handler (int s) |
void B_copy | ( | unsigned char | main[], | |
unsigned char | tmp[], | |||
int | ind, | |||
int | n | |||
) |
Definition at line 64 of file function.c.
Referenced by create_cfg(), generate_data_frame(), header_frm_gen(), and reconfig_cfg_CC().
int c2i | ( | unsigned char | temp_2[] | ) |
Definition at line 144 of file function.c.
References i.
Referenced by create_cfg(), frame_size(), new_pmu_tcp(), and pmu_udp().
00145 { 00146 int i; 00147 00148 i = temp[0]; 00149 i<<=8; 00150 i |=temp[1]; 00151 return(i); 00152 }
long int c2li | ( | unsigned char | temp_3[] | ) |
Definition at line 160 of file function.c.
References i.
Referenced by create_cfg().
00161 { 00162 long int i; 00163 unsigned char a[4]; 00164 memset(a, '\0', 4); 00165 strcpy((char *)a, (char *)temp_3); 00166 00167 i = a[0]; 00168 i<<=8; 00169 i |=a[1]; 00170 i<<=8; 00171 i |=a[2]; 00172 i<<=8; 00173 i |=a[3]; 00174 return(i); 00175 }
uint16_t compute_CRC | ( | unsigned char * | message, | |
char | length | |||
) |
Definition at line 183 of file function.c.
Referenced by create_cfg(), generate_data_frame(), header_frm_gen(), and reconfig_cfg_CC().
00184 { 00185 uint16_t crc=0x0ffff,temp,quick; 00186 int i; 00187 00188 for(i=0;i<length;i++) 00189 { 00190 temp=(crc>>8)^message[i]; 00191 crc<<=8; 00192 quick=temp ^ ( temp >>4); 00193 crc ^=quick; 00194 quick<<=5; 00195 crc ^=quick; 00196 quick <<=7; 00197 crc ^= quick; 00198 } 00199 return crc; 00200 }
void f2c | ( | float | f, | |
unsigned char | temp_4[] | |||
) |
Definition at line 124 of file function.c.
Referenced by generate_data_frame().
00125 { 00126 int i, j; 00127 float fv; 00128 unsigned char a1[sizeof fv]; 00129 00130 fv = f; 00131 memcpy(a1, &fv, sizeof fv); 00132 for (i=0, j=3; i<sizeof fv; i++, j--) 00133 { 00134 temp_1[j] = a1[i]; 00135 } 00136 }
void H2S | ( | char | a[], | |
unsigned char | temp_6[] | |||
) |
Definition at line 79 of file function.c.
00080 { 00081 int k; 00082 00083 for(k=0; k<16; k++) 00084 { 00085 a[k] = temp_6[k]; 00086 } 00087 a[16] = '\0'; 00088 }
void i2c | ( | int | t, | |
unsigned char | temp[] | |||
) |
Definition at line 96 of file function.c.
Referenced by create_cfg(), generate_data_frame(), header_frm_gen(), and reconfig_cfg_CC().
void li2c | ( | long int | t1, | |
unsigned char | temp_1[] | |||
) |
Definition at line 109 of file function.c.
Referenced by create_cfg(), generate_data_frame(), header_frm_gen(), and reconfig_cfg_CC().
00110 { 00111 00112 temp_1[0] = t1>>24; 00113 temp_1[1] = t1>>16; 00114 temp_1[2] = t1>>8; 00115 temp_1[3] = t1; 00116 }
void sigchld_handler | ( | int | s | ) |
Definition at line 208 of file function.c.
Referenced by start_server().