X13.Periphery.MsDevice.MsGUdp.SendGw C# (CSharp) Method

SendGw() public method

public SendGw ( MsDevice dev, MsMessage msg ) : void
dev MsDevice
msg MsMessage
return void
      public void SendGw(MsDevice dev, MsMessage msg) {
        if(_udp==null || msg==null) {
          return;
        }

        byte[] buf=msg.GetBytes();
        IPAddress addr;
        if(dev==null) {
          addr=IPAddress.Broadcast;
          foreach(var bc in _bcIps) {
            _udp.Send(buf, buf.Length, new IPEndPoint(bc, 1883));
          }
        } else if(dev.Addr!=null && dev.Addr.Length==4) {
          addr=new IPAddress(dev.Addr);
          _udp.Send(buf, buf.Length, new IPEndPoint(addr, 1883));
        } else {
          return;
        }
        if(_verbose.value) {
          Log.Debug("s  {0}: {1}  {2}", addr, BitConverter.ToString(buf), msg.ToString());
        }
      }
      public string name { get { return "UDP"; } }

Same methods

MsDevice.MsGUdp::SendGw ( byte arr, MsMessage msg ) : void