I would just as soon set the structure values as arguments to the "SendToNano()" function, save some code... I have another similar structure that I'm sending back that has 7 arguments.
My other option is to set and use the structures globally, but I was taught to try to stay away from globals.
There are a couple of options. Usually by reference is preferred so that the data does not have to be copied, taking up extra space. Use by value if you don't want the possibility of the data being modified.
Sorry, I didn't explain my code well enough for what I'm doing. I'm not trying to pass in a struct in the call to the function. In the call to the function, I have some regular variables that will be loaded in the struct which is passed through comms.
loop() {
byte Mode = 5;
int Band = 3;
boolean TxStatus = 0;
//Call the function
sendToNano(Mode, Band, TxStatus);
So the function and the args that I'm trying to do is to put the values directly into the structure: