I am trying to make a program run from the Windows command line and it doesn't seem to be reading the function inside the parameters. What I basically want to happen is the user will type the information into the command line like "Program name Parameter name AppFile path BootFile Path" then the program will take the file paths you manually typed in and run them throught the Execute 1553 function which is defined elsewhere in the program. Please look at my code and see if you can help me figure out what's wrong. Thanks guys!
Code:
int main(int argc, char *argv[])
{
FILE *ISP_file;
FILE *SP_file;
int i = 1;
for(i = 1; i < argc; i++)
{
if(!strcmp("Interrogator", argv[i]))
{
printf ("Parameter %d read - Interrogator", i);
InterrogatorProtocol1553Flag = TRUE;
}
else if(!strcmp("SRecord", argv[i]))
{
Interrogator_OFP_Select = INT_OFP_DMV_183;
DirectFlashProgFlag = TRUE;
if(Execute1553(ISP_file, SP_file) != 0)
printf("Calculation failed\n");
}
else
{
fprintf(stderr, "Unknown parameter: %s", argv[i]);
}
}