Enviar por GPRS un array hacia un servido

Hola un saludo a todos

Primero que nada un agradecimieno en general por la ayuda en este foro de arduino que en verdad me a ayudadp mucho y espero que con mis aporte y mis preguntas le pueda servir a alguien mas.
Bueno en busca de nueva ayuda con mi codigo e avanzado vastante

[b]#include <SoftwareSerial.h>



 #include <avr/wdt.h>
#define IRQ_PIN  2   // Puerto Del MCU, Conectado SID (Presencia De datos )
#define D0_PIN   3   // Puerto Recibe dato Binario 0
#define D1_PIN   4   // Puerto Recibe dato Binario 1
#define D2_PIN   5   // Puerto Recibe dato Binario 2
#define D3_PIN   6   // Puerto Recibe dato Binario 3

#define COMMANDLEN 16
#define NUMCOMMANDS 8

// TABLA CON LOS COMANDOS A DETECTAR
const char tabla_comandos[NUMCOMMANDS][COMMANDLEN] = {
 {'2', '3', '4', '5', '6', '7', '8', '9', '0', 'D', '1', '*', '#', 'A', 'B', 'C'},
 {'D', '1', '2', '9', '0', '*', '#', 'A', 'B', 'C', '3', '4', '5', '6', '7', '8'},
 {'6', '7', '8', 'D', '1', '2', '3', '4', '5', '9', '0', '*', '#', 'A', 'B', 'C'},
 {'D', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '*', '#', 'A', 'B', 'C'},
 {'4', '5', '6', '7', '8', 'D', '1', '2', '3', '9', '0', '*', '#', 'A', 'B', 'C'},
 {'5', '6', '7', '8', '9', '0', '*', '#', 'A', 'D', '1', '2', '3', '4', 'B', 'C'},
 {'7', '8', '9', '0', '*', '#', 'A', 'B', 'D', '1', '2', '3', '4', '5', '6', 'C'},
 {'#', 'A', 'B', 'D', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '*', 'C'}
};

// TABLA CON LA TRADUCCIÓN NÚMERO-KEY
const char tabla_key[] = {'D', '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '*', '#', 'A', 'B', 'C'};// no recuerdo para que sirbe pero jala 

byte irq_state;
char key[COMMANDLEN];
int indice=0;
SoftwareSerial mySerial(10, 11); // RX, TX

void setup()
{
  wdt_disable(); //Disabled durante las configuraciones, algunas configuranciones llevan mucho tiempo
  
  Serial.begin(9600); // Configura El Puerto Serial 9600,8,N,1
 
 // Pone Los Puerto En Modo De Lectura
 pinMode(IRQ_PIN, INPUT); 
 pinMode(D0_PIN, INPUT); 
 pinMode(D1_PIN, INPUT); 
 pinMode(D2_PIN, INPUT); 
 pinMode(D3_PIN, INPUT); 
   
}  

void loop()
{
  
 // Espera a Que Haya Una Senal o Tono 
 irq_state = digitalRead(IRQ_PIN);
 
 if ( irq_state == 1 )
    {
wdt_enable(WDTO_4S );//Una vez configurado el sistema iniciamos perro guardian, en este ejemplo 8sg
                                       //Serial.print("");
     
      key [indice]= read_codigo(); // Lee El Codigo DTMF
      Serial.print(indice); // Imprime La Tecla recibida
     
      if (indice < 15 ) {
       indice++;
       
      } else {
       indice=0;
       Serial.print("Se han recibido 16 tonos, que son: ");
       int comando = coincide();
        switch (comando) {
        case -1: //no hay coincidencias
          Serial.println("No se arma  ");
          delay(10);
          break;
        case 0: //coincide con el primer elemento de la tabla que  tiene que hacer una se;al codificada de un evento de accion de alarma 
          Serial.println("se abrio la puerta ");
          indice= 0;
          delay(1000);
          break;
        case 1: //coincide con el segundo
          Serial.println("Se abrio la ventana");
          indice= 0;
           delay(1000);
          break;
        case 2: // coincide con el tercero elemento.
          Serial.println("se abrio la puerta 333 ");
          indice= 0;
           delay(1000);
          break;
        case 3: // coincide con el cuarto elemento.
          Serial.println("Entro el gato ");
          indice= 0;
           delay(1000);
          break;
        case 4: // coincide con el quinto elemento.
          Serial.println(" Se activo alarma de incendio  ");
          indice= 0;
           delay(1000);    
          break;
        case 5: // coincide con el sexto elemento.
          Serial.println(" Tu casa esta indundada ");
          indice= 0;
           delay(1000);
          break;
        case 6: // coincide con el septimo elemento elemento.
          Serial.println(" Tienes un gris en tu cuarto ");
          indice= 0;
           delay(1000);
          break;
        case 7: // coincide con el octavo elemento.
          Serial.println("Te secuestraron los aliens  ");
          indice= 0;
           delay(1000);
          break;
}
      }
      delay(500);      // Pausa Para Sincronizar La Senal o IRQ
      wdt_reset();
    }
}

/*-------------------------------------------------------------*/

byte read_codigo()
{
 byte dato;           // Variable Que Tiene El Valor byte De La tecla
 char key;            // Variable Que Tiene El Valor Char  tecla


 byte D0,D1,D2,D3;    // Variable Donde Se Lee el Estado
 
 // Lee Los Estado Logico o Binario Del MT8870 (1 o 0 , ON o OFF )
 D0 = digitalRead(D0_PIN);
 D1 = digitalRead(D1_PIN);
 D2 = digitalRead(D2_PIN);
 D3 = digitalRead(D3_PIN);
 
 // Covierte De Binario A BYTE o ENTERO
 // Escribe Los BITS En Una Variable dato
 bitWrite(dato,0,D0);
 bitWrite(dato,1,D1);
 bitWrite(dato,2,D2);
 bitWrite(dato,3,D3);
  
return tabla_key[dato]; 
}


// Retorna número de comando coincidente con los datos recibidos, o -1 si no hay coincidencias.
int coincide() {
 bool coincidencia;
 for (int i=0; i<NUMCOMMANDS; i++) {
 coincidencia = true;
 for (int j=0; j<COMMANDLEN && coincidencia==true; j++) {
 if (tabla_comandos[i][j] != key[j]) {
 coincidencia = false;
 }
 }
 if (coincidencia==true) {
 return (i);
 }
 }
 return(-1);
}

[/b]

Estoy usando un sim900 en el codigo el meollo del asunto es que si el array resibido conside con alguin array en la matriz con un switch case envia un mensaje mi pregunta es como puedo enviar ese array mediante comandos AT por el protolo UDP a una IP/dianamica a un servido

De ante mano gracias a quien me pueda ayudar

en google puse : Arduino sim900 UDP y obtuve este link uno de tantos

/*
 *  Description: This example shows how to configure the GPRS module in multi 
 *  client mode and open a TCP socket as client. This example only shows the 
 *  AT commands (and the answers of the module) used to open a TCP/UDP 
 *  connection. For more information about the AT commands, refer to 
 *  the AT command manual.
 *
 *  Copyright (C) 2013 Libelium Comunicaciones Distribuidas S.L.
 *  http://www.libelium.com
 *
 *  This program is free software: you can redistribute it and/or modify 
 *  it under the terms of the GNU General Public License as published by 
 *  the Free Software Foundation, either version 3 of the License, or 
 *  (at your option) any later version. 
 *  
 *  This program is distributed in the hope that it will be useful, 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
 *  GNU General Public License for more details. 
 *  
 *  You should have received a copy of the GNU General Public License 
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>. 
 *
 *  Version 0.2
 *  Author: Alejandro Gallego 
 */
 
 
int8_t answer;
int onModulePin= 2;
char aux_str[50];

char ip_data[40]="Test string from GPRS shield\r\n";



void setup(){

    pinMode(onModulePin, OUTPUT);
    Serial.begin(115200);    
    
    Serial.println("Starting...");
    power_on();
    
    delay(3000);
    
    // sets the PIN code
    sendATcommand2("AT+CPIN=****", "OK", "ERROR", 2000);
    
    delay(3000);
    
    Serial.println("Connecting to the network...");

    while( sendATcommand2("AT+CREG?", "+CREG: 0,1", "+CREG: 0,5", 1000) == 0 );

}


void loop(){
    
    
    // Selects Multi-connection mode
    if (sendATcommand2("AT+CIPMUX=1", "OK", "ERROR", 1000) == 1)
    {
        // Waits for status IP INITIAL
        while(sendATcommand2("AT+CIPSTATUS", "INITIAL", "", 500)  == 0 );
        delay(5000);
        
        // Sets the APN, user name and password
        if (sendATcommand2("AT+CSTT=\"APN\",\"user_name\",\"password\"", "OK",  "ERROR", 30000) == 1)
        {
            // Waits for status IP START
            while(sendATcommand2("AT+CIPSTATUS", "START", "", 500)  == 0 );
            delay(5000);
            
            // Brings Up Wireless Connection
            if (sendATcommand2("AT+CIICR", "OK", "ERROR", 30000) == 1)
            {
                // Waits for status IP GPRSACT
                while(sendATcommand2("AT+CIPSTATUS", "GPRSACT", "", 500)  == 0 );
                delay(5000);
                
                // Gets Local IP Address
                if (sendATcommand2("AT+CIFSR", ".", "ERROR", 10000) == 1)
                {
                    // Waits for status IP STATUS
                    while(sendATcommand2("AT+CIPSTATUS", "IP STATUS", "", 500)  == 0 );
                    delay(5000);
                    Serial.println("Openning TCP");
                    
                    // Opens a TCP socket with connection 1
                    if (sendATcommand2("AT+CIPSTART=1,\"TCP\",\"IP_address\",\"port\"",
                                    "CONNECT OK", "CONNECT FAIL", 30000) == 1)
                    {
                        Serial.println("Connected");
                        
                        // Sends some data to the TCP socket
                        sprintf(aux_str,"AT+CIPSEND=1,%d", strlen(ip_data));
                        if (sendATcommand2(aux_str, ">", "ERROR", 10000) == 1)    
                        {
                            delay(500);
                            sendATcommand2(ip_data, "SEND OK", "ERROR", 10000);
                        }
                        
                        // Closes the socket
                        sendATcommand2("AT+CIPCLOSE=1", "CLOSE OK", "ERROR", 10000);
                    }
                    else
                    {
                        Serial.println("Error openning the connection 1");
                    }  
                    
                }
                else
                {
                    Serial.println("Error getting the IP address");
                }  
            }
            else
            {
                Serial.println("Error bring up wireless connection");
            }
        }
        else
        {
            Serial.println("Error setting the APN");
        } 
    }
    else
    {
        Serial.println("Error setting the multi-connection");
    }
    
    sendATcommand2("AT+CIPSHUT", "OK", "ERROR", 10000);
    delay(10000);
}

void power_on(){

    uint8_t answer=0;
    
    // checks if the module is started
    answer = sendATcommand2("AT", "OK", "OK", 2000);
    if (answer == 0)
    {
        // power on pulse
        digitalWrite(onModulePin,HIGH);
        delay(3000);
        digitalWrite(onModulePin,LOW);
    
        // waits for an answer from the module
        while(answer == 0){     // Send AT every two seconds and wait for the answer
            answer = sendATcommand2("AT", "OK", "OK", 2000);    
        }
    }
    
}

int8_t sendATcommand2(char* ATcommand, char* expected_answer1, 
        char* expected_answer2, unsigned int timeout){

    uint8_t x=0,  answer=0;
    char response[100];
    unsigned long previous;

    memset(response, '\0', 100);    // Initialize the string

    delay(100);

    while( Serial.available() > 0) Serial.read();    // Clean the input buffer

    Serial.println(ATcommand);    // Send the AT command 

    x = 0;
    previous = millis();

    // this loop waits for the answer
    do{
        // if there are data in the UART input buffer, reads it and checks for the asnwer
        if(Serial.available() != 0){    
            response[x] = Serial.read();
            x++;
            // check if the desired answer 1  is in the response of the module
            if (strstr(response, expected_answer1) != NULL)    
            {
                answer = 1;
            }
            // check if the desired answer 2 is in the response of the module
            else if (strstr(response, expected_answer2) != NULL)    
            {
                answer = 2;
            }
        }
    }
    // Waits for the asnwer with time out
    while((answer == 0) && ((millis() - previous) < timeout));    

    return answer;
}

Hola

tengo un monto de ejemplos y código para enviar UDP TCP/IP pero mi lógica de programación no es muy buena y no encuentro como encargar eso código con mi programa por eso acudo a ayuda en el foro de alguien que sepa mas, sigo investigado mas y razonare mas la lógica. Igual si alguien mas me pueda ayudar se lo agradezco.

Un saludo surbyte y gracias.