/**
@author Reid Kersey <*****@*****.**> 678-736-0899

@brief This sends data back to the HMI telem computer, and checks for a response. This function is the only one that should be accessed by outside sources

@details This function sends the data in the format of 'date, time, component, data, packet#, termination' This function will then wait for a response
and may send instructions to increase the signal power.

@note DATA_String an example string would be someting like: 071512|~233715|~BMS|~07|~{etc}|~1|~~|$

@param device This is a sturcture of settings for the wireless device
@param component This is a character representation of the general name of the data you are to be sending
@param data	This is a character array with each "string" being one piece of data
@param numDataElements This is the number of "strings" that are to be sent
*/
void sendWirelessData(struct WirelessPins *device, char* component, char** data, int numDataElements){
	int i;
	char wirelessString[10240];
	sprintf(wirelessString, "%s|~%s|~%s|~", getDate(), getTime(), component);
	for(i = 0; i < numDataElements; i++){
		sprintf(wirelessString, "%s|~", data[i]);
	}
	sprintf(wirelessString, "%d|~", packetNum);
	sprintf(wirelessString, "~|$");
	sendWirelessPacket(device, wirelessString);
}
int RobotController::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QObject::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: sendWirelessPacket((*reinterpret_cast< WirelessPacket(*)>(_a[1]))); break;
        case 1: processWirelessPacket((*reinterpret_cast< WirelessPacket(*)>(_a[1]))); break;
        default: ;
        }
        _id -= 2;
    }
    return _id;
}