   Serial.println("EOR");
 //  tx_packet.push_back( (uint8_t) j+1);
 }
-else if(enable == 0)
+//else
+if(enable == 2) //For command mode use write for repsponse use print
 {
  if (Uart.available()) {
 		c = Uart.read();
 		Serial.write(c);
+                digitalWrite(led_pin, led_on);
+		led_on_time = millis();
+		return;
+	} 
+}
+//else 
+if(enable == 3) //For command mode use write for repsponse use print
+{
+ if (Uart.available()) {
+		c = Uart.read();
+//		Serial.write(c);
+                if(c == 0x7E) Serial.println();
+                Serial.print(c, HEX);
+                Serial.print(" ");
 		digitalWrite(led_pin, led_on);
 		led_on_time = millis();
 		return;

//#include <XBeeS6.h>

//#include "XbeeS6.h"
#define BAUD_RATE 9600

uint8_t my_buffer[20];


  //{
  if (Serial.available()) {
    //Uart.flush();
	c = Serial.read();
    if(c == '?') {enable = 3; return;}

    if(c == '$' ) {enable  =1; return;}
    if(c == '#' ) {enable = 2; return; }
    if(c == '^') {Uart.flush(); return; }
	Uart.write(c);
	digitalWrite(led_pin, led_on);
	led_on_time = millis();
