       #endif
    }
    showStatusLed();
+   
     
    if(_config.mode == MODE_SETUP && wifi.available()) {
       uint8_t data = wifi.read();
-      _buffer[_bufferIdx % BUFF_SIZE] = data;
       uint8_t result = checkResString(data,_resIdx);
+
       
       if(equalResType(RES_LINK_LEN,result)) {
-        _isLink = true;
+        _dataState = DATA_STATE_HTTP_FIND_FPATH;
         _resIdx = 0;
         #ifdef DEBUG
         Serial.println("debug : LINKED");
         #endif
-      } else if(equalResType(RES_UNLINK_LEN,result)) {
-        _isLink = false;
+      } else if(equalResType(RES_OK_LEN,result) && _dataState == DATA_STATE_HTTP_FIND_FPATH) {
+        _dataState = DATA_STATE_WAIT;
         _resIdx = 0;
         #ifdef DEBUG
-        Serial.println("debug : UNLINKED");
+        Serial.println("debug : WAIT");
         #endif
+      } else if(_dataState == DATA_STATE_HTTP_FIND_EOL && isResCheckOk(result)) {
+        if(strncmp((char*)_buffer, "/set/", 5) > 0) { 
+          for(int i = 5; --i;) {
+            _buffer[5 - i - 1] = i; 
+          }
+          
+          char * token = NULL;
+          
+           
+        }
+        
       } else if(result == RES_NONE || isResCheckOk(result)) {
         _resIdx = 0;
       } else {
         _resIdx++;
       }
-      
+
+      if(_dataState == DATA_STATE_HTTP_FIND_FPATH && data == '/') {
+        _dataState = DATA_STATE_HTTP_FIND_EPATH;
+        resetBuffer();
+        _buffer[_bufferIdx % BUFF_SIZE] = data;
+      } else if(_dataState == DATA_STATE_HTTP_FIND_EPATH) {
+        if(data == ' ') {
+          _dataState = DATA_STATE_HTTP_FIND_EOL;  
+        } else {
+          _buffer[_bufferIdx % BUFF_SIZE] = data; 
+        }
+      }
       _bufferIdx++;
       #ifdef DEBUG
         Serial.write((char)data);

   
}


void showStatusLed() {
  int delayMillis = 0;

#define RES_UNLINK_LEN 8
#define RES_NONE 0

#define VER 104
#define MODE_BOOT 0
#define MODE_SETUP 1
#define MODE_RUN 2
