//Response management.
void GSM3ShieldV1ClientProvider::manageResponse(byte from, byte to)
{
	switch(theGSM3ShieldV1ModemCore.getOngoingCommand())
	{
		case NONE:
			theGSM3ShieldV1ModemCore.gss.cb.deleteToTheEnd(from);
			break;
		case CONNECTTCPCLIENT:
			connectTCPClientContinue();
			break;
		case FLUSHSOCKET:
			flushSocketContinue();
			break;	
	}
}
//Response management.
void GSM3ShieldV1MultiClientProvider::manageResponse(byte from, byte to)
{
	switch(theGSM3ShieldV1ModemCore.getOngoingCommand())
	{
		case XON:
			if (flagReadingSocket) 
				{
//					flagReadingSocket = 0;
					fullBufferSocket = (theGSM3ShieldV1ModemCore.theBuffer().availableBytes()<3);
				}
			else theGSM3ShieldV1ModemCore.setOngoingCommand(NONE);
			break;
		case NONE:
			theGSM3ShieldV1ModemCore.gss.cb.deleteToTheEnd(from);
			break;
		case CONNECTTCPCLIENT:
			connectTCPClientContinue();
			break;
		case DISCONNECTTCP:
			disconnectTCPContinue();
			break;	
	 	case BEGINWRITESOCKET:
			beginWriteSocketContinue();
			break;
		case ENDWRITESOCKET:
			endWriteSocketContinue();
			break;	
		case AVAILABLESOCKET:
			availableSocketContinue();
			break;	
		case FLUSHSOCKET:
			fullBufferSocket = (theGSM3ShieldV1ModemCore.theBuffer().availableBytes()<3);
			flushSocketContinue();
			break;	
	}
}
//Flush SMS main function.
void GSM3ShieldV1ClientProvider::flushSocket()
{
	theGSM3ShieldV1ModemCore.openCommand(this,FLUSHSOCKET);

	flushSocketContinue();
}
//Flush SMS main function.
void GSM3ShieldV1MultiClientProvider::flushSocket()
{
	flagReadingSocket=0;
	theGSM3ShieldV1ModemCore.openCommand(this,FLUSHSOCKET);
	flushSocketContinue();
}