server/client

Dependencies:   mbed NetServicesMin

net_routing.cpp

Committer:
recotana
Date:
2012-02-23
Revision:
1:6e61ee662fd3

File content as of revision 1:6e61ee662fd3:

#include "net_routing.h"
#include "types.h"
#include "config.h"
#include "xbee_lib.h"
#include "tcp_client.h"

void netRouting(Payload *_payload)
{
    

    #ifdef _SERVER_TEST_MODE_
        tcpSendPayload(_payload);

    #else
    
    uint32_t xbeeAdr=0;
    
    switch(_payload->message.device)
    {
        case LED_SENDER:
        {
            xbeeAdr = kLedSender;
            break;
        }
        
        case LED_RECIEVER:
        {
            xbeeAdr = kLedReciever;
            break;
        }
    
    }
    

    xbeeSend(xbeeAdr,_payload);
    #endif
    
}