private void btnTest_Clicked(object sender, EventArgs e) { GBGProtocol protocol = new GBGProtocol(); List <byte> reqData = protocol.AppToDevice_AirCheckTime(TwoByte.SetFromInt(0)); DisplayAlert("Test", BitConverter.ToString(reqData.ToArray()).Replace("-", String.Empty), "OK !"); }
public static TwoByte SetFromInt(int _Data) { TwoByte bytes = new TwoByte(); bytes.hByte = (byte)(_Data / (byte.MaxValue + 1)); bytes.lByte = (byte)(_Data % (byte.MaxValue + 1)); return(bytes); }
public List <byte> AppToDevice_AirCheckTime(TwoByte time) //AppToDevice C. 공기질 측정 주기 { List <byte> airCheck = new List <byte>(); airCheck.AddRange(time.GetData()); airCheck.Add(GBGP_CMD_ETC_AIR_CHECK_TIME); return(_makeProtocol(airCheck, true, GBGP_CMD_ETC)); }
public List <byte> AppToDevice_EatCalo(UserInfo userInfo, TwoByte calo1, TwoByte calo2, TwoByte calo3) //AppToDevice D. 조식, 중식, 섭취 칼로리량 { List <byte> eatCalo = new List <byte>(); eatCalo.AddRange(userInfo.GetUserInfo()); eatCalo.AddRange(calo1.GetData()); eatCalo.AddRange(calo2.GetData()); eatCalo.AddRange(calo3.GetData()); eatCalo.Add(GBGP_CMD_ETC_CAL); return(_makeProtocol(eatCalo, true, GBGP_CMD_ETC)); }
public List <byte> AppToDevice_AirCheckSetting(TwoByte PM25, TwoByte PM10, TwoByte VOC, TwoByte CO2, TwoByte Temp, TwoByte Humi) //AppToDevice 공기질 경보 발생 측정 수치 설정 { List <byte> ac = new List <byte>(); ac.AddRange(PM25.GetData()); ac.AddRange(PM10.GetData()); ac.AddRange(VOC.GetData()); ac.AddRange(CO2.GetData()); ac.AddRange(Temp.GetData()); ac.AddRange(Humi.GetData()); ac.Add(GBGP_CMD_AIRCHECK_DEFAULT); return(_makeProtocol(ac, true, GBGP_CMD_AIRCHECK)); }
public List <byte> AppToDevice_4Setting(UserInfo userInfo, TwoByte time1, TwoByte time2, TwoByte time3, TwoByte time4) //AppToDevice B. 총 4개 알람 설정 { List <byte> alarm = new List <byte>(); alarm.AddRange(userInfo.GetUserInfo()); alarm.AddRange(time1.GetData()); alarm.AddRange(time2.GetData()); alarm.AddRange(time3.GetData()); alarm.AddRange(time4.GetData()); alarm.Add(GBGP_CMD_ETC_SETTING_ALARM); return(_makeProtocol(alarm, true, GBGP_CMD_ETC)); }