티스토리 뷰

void b_TreatCommand_WiFi(String CommandString1){
  int Index1 = CommandString1.indexOf(":");
  char CommandType0 = CommandString1.charAt(0);
  char CommandType1 = CommandString1.charAt(1);
  String CommandValue1 = CommandString1.substring(Index1+1);
  switch(CommandType0){
    case 'P': // Port Control
    {
      if(CommandType1 == '4'){
        if(CommandValue1.equals("0")) h_SwitchRelay('F');
        if(CommandValue1.equals("1")) h_SwitchRelay('N');
      }
    }
      break;
    case 'W': // WiFi Information
    {
     int Index2 = CommandValue1.indexOf(",");
     if(Index2 < 1) return;
     thisSSID = CommandValue1.substring(0, Index2);
     thisPASSWORD = CommandValue1.substring(Index2+1);
     b_SetWiFiInfo(thisSSID, thisPASSWORD);
    }
      break;
    case 'T':
      ADCValue_Ref = CommandValue1.toInt();
      break;
    case 'S':
      if(CommandType1 != 'N') return;
      SNo_Command = CommandValue1.toInt();
      break;
    default:
      break;
  }  
}

 

반응형

'SWDesk > Firmware' 카테고리의 다른 글

HC-05, 블루투스 통신 모듈  (0) 2020.12.20
[Arduino] JSON 예제  (0) 2020.11.25
[BMS] Command Process for VIC Instrument  (0) 2020.07.19
[BMS] Command Process for CD Devices  (0) 2020.07.19
[BMS] Command Process for LoRa Device  (0) 2020.07.19