public void transmit(string msgType, LCMEncodable lcmOut) { try { Utils.lcmTransmitterMessage("Transmitting {0} message", msgType); appLCM.Publish(msgType, lcmOut); } catch (Exception e) { Console.Error.WriteLine("Ex: " + e); } }
/// <summary> /// Publish an LCM-defined type on a channel. If more than one URL was /// specified, the message will be sent on each. /// </summary> /// <param name="channel">channel name</param> /// <param name="e">encodable object to send</param> public void Publish(string channel, LCMEncodable e) { if (this.closed) { throw new SystemException(); } lock (this) { try { encodeBuffer.Reset(); e.Encode(encodeBuffer); Publish(channel, encodeBuffer.Buffer, 0, encodeBuffer.Length); } catch (System.IO.IOException ex) { Console.Error.WriteLine("LC Publish fail: " + ex); } } }
/// <summary> /// Publish an LCM-defined type on a channel. If more than one URL was /// specified, the message will be sent on each. /// </summary> /// <param name="channel">channel name</param> /// <param name="e">encodable object to send</param> public void Publish(string channel, LCMEncodable e) { if (this.closed) { throw new SystemException(); } lock (this) { try { encodeBuffer.Reset(); e.Encode(encodeBuffer); Publish(channel, encodeBuffer.Buffer, 0, encodeBuffer.Length); } catch (System.IO.IOException ex) { Console.Error.WriteLine("LC Publish fail: " + ex); } } }