internal void Specific(GroupDevice obj) { base.Detail = obj.Detail; base.Token = obj.Token; Joined = obj.Joined; Ready = obj.Ready; try { _members = obj.Members; } catch (Exception ex) { _members = null; } }
/// <summary> /// 退出一个群组 /// </summary> /// <param name="group">指定的群组</param> /// <param name="communicateType">通讯的网络形式</param> public void ExitGroup(GroupDevice group, CommunicatType communicateType) { if (CommunicatType.Synchronization == communicateType) { try { base.CoSynExitGroup(group); } catch (System.Exception ex) { throw ex; } } else { base.CoAsynExitGroup(group); } }
/// <summary> /// 加入一个群组 /// </summary> /// <param name="group">指定的群组</param> /// <param name="role">设备在群组中的角色</param> /// <param name="communicateType">通讯的网络形式</param> public void JoinGroup(GroupDevice group, GroupMemberRole role, CommunicatType communicateType) { if (CommunicatType.Synchronization == communicateType) { try { base.CoSynJoinGroup(group, role); } catch (System.Exception ex) { throw ex; } } else { base.CoAsynJoinGroup(group, role); } }
/// <summary> /// 反馈一个应答通讯包, 阻塞式 /// </summary> /// <param name="communicator">应答通讯包</param> /// <param name="timeMillionsecond">等待的上限时长</param> //public void SynFeedbackCommunicateReplyMessage(ReplyCommunicatePackage communicator, int timeMillionsecond) //{ // try // { // base.CoSynFeedbackCommunicateReplyMessage(communicator, timeMillionsecond); // } // catch (System.Exception ex) // { // throw ex; // } //} /// <summary> /// 创建一个群组 /// </summary> /// <param name="detail">群组的自然语言描述,(UTF-8编码)</param> /// <param name="communicateType">发起该请求的网络形式</param> /// <returns>立即返回一个GroupDevice(可能未就绪)</returns> public GroupDevice CreateGroup(string detail, CommunicatType communicateType) { if (CommunicatType.Synchronization == communicateType) { GroupDevice retGroupDevice = null; try { retGroupDevice = base.CoSynCreateGroup(detail); } catch (Exception ex) { throw (ex as CreateGroupExcetion); } return(retGroupDevice); } else { return(base.CoAsynCreateGroup(detail)); } }
/// <summary> /// 创建一个群组通讯包 /// </summary> /// <param name="radioName">广播通讯的名称</param> /// <param name="radioParamPkg">携带的参数属性包</param> /// <param name="targetGroup">目的群组</param> /// <returns>返回创建完毕的通讯包</returns> public GroupComunicatePackage CreateRadioCommunicatePackage(string radioName, ParamPackage radioParamPkg, GroupDevice targetGroup) { return(base.CoCreateGroupCommunicatePackage(radioName, radioParamPkg, targetGroup)); }
internal static void Parse(CSCommunicateClass.GroupInfo item, GroupDevice gropInst) { gropInst.Detail = item.Detail; gropInst.Token = item.Token; gropInst.Ready = true; }