/// <summary> /// AT指令 /// </summary> /// <param name="msg"></param> /// <param name="service"></param> private void InstantAtCommand(FsMessage msg, EtService service) { string tid = msg.Header.U.ToString(); uint dtu = msg.BodyValue <uint>("dtuId"); JObject[] cmds = msg.BodyValues <JObject>("cmds"); int taskId = service.Dtm.ArrangeInstantTask(tid, dtu, cmds, null); msg.Body = JObject.FromObject(new { tid = taskId }); service.Push(msg.Header.S, msg); }
/// <summary> /// 即时采集 /// </summary> /// <param name="msg"></param> /// <param name="service"></param> private void InstantCol(FsMessage msg, EtService service) { string tid = msg.Header.U.ToString(); uint dtu = msg.BodyValue <uint>("dtu"); uint[] sensors = msg.BodyValues <uint>("sensors"); var sensorList = new List <uint>(sensors); int taskId = service.Dtm.ArrangeInstantTask(tid, dtu, sensorList, null); msg.Body = JObject.FromObject(new { tid = taskId }); _log.DebugFormat("Resp.OnMessageReceived: {0}-{1}, dtu = {2}, sensors={3},resp={4}", msg.Header.S, msg.Header.R, dtu, sensors.Length, msg.Body); service.Push(msg.Header.S, msg); }