/*
Forum: https://forum.arduino.cc/t/command-line-needs-sending-by-a-keyboard/1244534/6
Wokwi: https://wokwi.com/projects/394418839211631617
*/
struct camDataType{
char Name[8];
char PartialIP[8];
};
const char command[] = "curl.exe -d \"{\"command\": \"sendCameraCommand\",\"cameras\": [\"GoPro %s\"],\"cameraCommand\": \"startRecording\"}\" \"http://192.168.0.%s\"";
const camDataType cam[] {
{"2281","108:809"},
{"2282","208:809"},
{"2283","308:809"},
{"2284","408:809"},
{"2285","508:809"},
{"2286","608:809"},
};
const byte noOfCams = sizeof(cam)/sizeof(cam[0]);
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
printCamCmds();
}
void loop() {
delay(100);
}
void printCamCmds(){
char buffer[160];
for (int i = 0;i< noOfCams;i++){
sprintf(buffer,command,cam[i].Name,cam[i].PartialIP);
Serial.println(buffer);
}
}