mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-20 02:40:03 +02:00
allowing multi receiver with just 2 arguments (without call back as default)
This commit is contained in:
parent
07cc28f91b
commit
e57f49086d
@ -30,9 +30,12 @@ void sigInterruptHandler(int p) { sem_post(&semaphore); }
|
|||||||
* prints usage of this example program
|
* prints usage of this example program
|
||||||
*/
|
*/
|
||||||
void printHelp() {
|
void printHelp() {
|
||||||
cprintf(RESET, "Usage:\n"
|
cprintf(
|
||||||
|
RESET,
|
||||||
|
"Usage:\n"
|
||||||
"./slsMultiReceiver(detReceiver) [start_tcp_port] "
|
"./slsMultiReceiver(detReceiver) [start_tcp_port] "
|
||||||
"[num_receivers] [1 for call back, 0 for none]\n\n");
|
"[num_receivers] [optional: 1 for call back (print frame header for "
|
||||||
|
"debugging), 0 for none (default)]\n\n");
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -157,10 +160,16 @@ int main(int argc, char *argv[]) {
|
|||||||
|
|
||||||
/** - get number of receivers and start tcp port from command line
|
/** - get number of receivers and start tcp port from command line
|
||||||
* arguments */
|
* arguments */
|
||||||
if ((argc != 4) || (!sscanf(argv[1], "%d", &startTCPPort)) ||
|
if (argc != 3 && argc != 4)
|
||||||
(!sscanf(argv[2], "%d", &numReceivers)) ||
|
|
||||||
(!sscanf(argv[3], "%d", &withCallback)))
|
|
||||||
printHelp();
|
printHelp();
|
||||||
|
if ((argc == 3) && ((!sscanf(argv[1], "%d", &startTCPPort)) ||
|
||||||
|
(!sscanf(argv[2], "%d", &numReceivers))))
|
||||||
|
printHelp();
|
||||||
|
if ((argc == 4) && ((!sscanf(argv[1], "%d", &startTCPPort)) ||
|
||||||
|
(!sscanf(argv[2], "%d", &numReceivers)) ||
|
||||||
|
(!sscanf(argv[3], "%d", &withCallback))))
|
||||||
|
printHelp();
|
||||||
|
|
||||||
cprintf(BLUE, "Parent Process Created [ Tid: %ld ]\n",
|
cprintf(BLUE, "Parent Process Created [ Tid: %ld ]\n",
|
||||||
(long)syscall(SYS_gettid));
|
(long)syscall(SYS_gettid));
|
||||||
cprintf(RESET, "Number of Receivers: %d\n", numReceivers);
|
cprintf(RESET, "Number of Receivers: %d\n", numReceivers);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user