mainPro.c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "inoutCommand.h"
#include "controDevice.h"
struct Devices* findDeviceByName(char* name,struct Devices* phead){
struct Devices*tmp=phead;
if(phead==NULL){
return NULL;
}
else{
while(tmp!=NULL){
if(strcmp(tmp->name,name)==0){
return tmp;
}
tmp=tmp->next;
}
return NULL;
}
}
int main(){
if(wiringPiSetup() == -1){
printf("wiringPiSetup failed!\n");
return -1;
}
char name[128];
struct Devices* tem=NULL;
struct inputcommander* commandhead=NULL;
tem=addbathroomLink(tem);
tem=addupstairLink(tem);
tem=addrestaurantLink(tem);
tem=addlivingroomLink(tem);
tem= addfiretoLink(tem);
commandhead=addvoiceControlInputLink(commandhead);
while(1){
printf("input:\n");
scanf(