server/client
Dependencies: mbed NetServicesMin
net_routing.cpp@1:6e61ee662fd3, 2012-02-23 (annotated)
- Committer:
- recotana
- Date:
- Thu Feb 23 02:38:05 2012 +0000
- Revision:
- 1:6e61ee662fd3
added standalone test mode
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
recotana | 1:6e61ee662fd3 | 1 | #include "net_routing.h" |
recotana | 1:6e61ee662fd3 | 2 | #include "types.h" |
recotana | 1:6e61ee662fd3 | 3 | #include "config.h" |
recotana | 1:6e61ee662fd3 | 4 | #include "xbee_lib.h" |
recotana | 1:6e61ee662fd3 | 5 | #include "tcp_client.h" |
recotana | 1:6e61ee662fd3 | 6 | |
recotana | 1:6e61ee662fd3 | 7 | void netRouting(Payload *_payload) |
recotana | 1:6e61ee662fd3 | 8 | { |
recotana | 1:6e61ee662fd3 | 9 | |
recotana | 1:6e61ee662fd3 | 10 | |
recotana | 1:6e61ee662fd3 | 11 | #ifdef _SERVER_TEST_MODE_ |
recotana | 1:6e61ee662fd3 | 12 | tcpSendPayload(_payload); |
recotana | 1:6e61ee662fd3 | 13 | |
recotana | 1:6e61ee662fd3 | 14 | #else |
recotana | 1:6e61ee662fd3 | 15 | |
recotana | 1:6e61ee662fd3 | 16 | uint32_t xbeeAdr=0; |
recotana | 1:6e61ee662fd3 | 17 | |
recotana | 1:6e61ee662fd3 | 18 | switch(_payload->message.device) |
recotana | 1:6e61ee662fd3 | 19 | { |
recotana | 1:6e61ee662fd3 | 20 | case LED_SENDER: |
recotana | 1:6e61ee662fd3 | 21 | { |
recotana | 1:6e61ee662fd3 | 22 | xbeeAdr = kLedSender; |
recotana | 1:6e61ee662fd3 | 23 | break; |
recotana | 1:6e61ee662fd3 | 24 | } |
recotana | 1:6e61ee662fd3 | 25 | |
recotana | 1:6e61ee662fd3 | 26 | case LED_RECIEVER: |
recotana | 1:6e61ee662fd3 | 27 | { |
recotana | 1:6e61ee662fd3 | 28 | xbeeAdr = kLedReciever; |
recotana | 1:6e61ee662fd3 | 29 | break; |
recotana | 1:6e61ee662fd3 | 30 | } |
recotana | 1:6e61ee662fd3 | 31 | |
recotana | 1:6e61ee662fd3 | 32 | } |
recotana | 1:6e61ee662fd3 | 33 | |
recotana | 1:6e61ee662fd3 | 34 | |
recotana | 1:6e61ee662fd3 | 35 | xbeeSend(xbeeAdr,_payload); |
recotana | 1:6e61ee662fd3 | 36 | #endif |
recotana | 1:6e61ee662fd3 | 37 | |
recotana | 1:6e61ee662fd3 | 38 | } |