Exemplo n.º 1
0
 /// <inheritdoc />
 protected BaseUnityGlarduinoClient(ArduinoPortConnectionInfo connectionInfo,
                                    IMessageDeserializerStrategy <TMessageType> messageDeserializer,
                                    IMessageDispatchingStrategy <TMessageType> messageDispatcher,
                                    ICommunicationPort comPort)
     : base(connectionInfo, messageDeserializer, messageDispatcher, comPort)
 {
 }
Exemplo n.º 2
0
 /// <summary>
 /// Crates a new <see cref="BaseStringGlarduinoClient"/>.
 /// </summary>
 /// <param name="connectionInfo">The connection information for the port.</param>
 /// <param name="messageDeserializer">The message deserialization strategy.</param>
 /// <param name="messageDispatcher">The message dispatching strategy.</param>
 /// <param name="comPort">The specified communication port.</param>
 public BaseStringGlarduinoClient(ArduinoPortConnectionInfo connectionInfo,
                                  IMessageDeserializerStrategy <string> messageDeserializer,
                                  IMessageDispatchingStrategy <string> messageDispatcher,
                                  ICommunicationPort comPort)
     : base(connectionInfo, messageDeserializer, messageDispatcher, comPort)
 {
 }
 /// <inheritdoc />
 public UnityQuaternionSegmentGlarduinoClient(ArduinoPortConnectionInfo connectionInfo,
                                              IMessageDeserializerStrategy <RecyclableArraySegment <Quaternion> > messageDeserializer,
                                              IMessageDispatchingStrategy <RecyclableArraySegment <Quaternion> > messageDispatcher,
                                              ICommunicationPort comPort)
     : base(connectionInfo, messageDeserializer, messageDispatcher, comPort)
 {
 }
Exemplo n.º 4
0
        /// <summary>
        /// Crates a new <see cref="BaseGlarduinoClient{TMessageType}"/>.
        /// Specifically defining the communication port.
        /// </summary>
        /// <param name="connectionInfo">The connection information for the port.</param>
        /// <param name="messageDeserializer">The message deserialization strategy.</param>
        /// <param name="messageDispatcher">The message dispatching strategy.</param>
        /// <param name="comPort">The specified communication port.</param>
        protected BaseGlarduinoClient(ArduinoPortConnectionInfo connectionInfo,
                                      IMessageDeserializerStrategy <TMessageType> messageDeserializer,
                                      IMessageDispatchingStrategy <TMessageType> messageDispatcher,
                                      ICommunicationPort comPort)
        {
            ConnectionInfo        = connectionInfo ?? throw new ArgumentNullException(nameof(connectionInfo));
            MessageDeserializer   = messageDeserializer ?? throw new ArgumentNullException(nameof(messageDeserializer));
            MessageDispatcher     = messageDispatcher ?? throw new ArgumentNullException(nameof(messageDispatcher));
            InternallyManagedPort = comPort ?? throw new ArgumentNullException(nameof(comPort));

            _ConnectionEvents = new ConnectionEvents();
        }
Exemplo n.º 5
0
 private static SerialPort CreateNewSerialPort(ArduinoPortConnectionInfo connectionInfo)
 {
     //Address issues in underlying stream opening: http://zachsaw.blogspot.com/2010/07/net-serialport-woes.html
     SerialPortFixer.Execute(connectionInfo.PortName);
     return(new SerialPort(connectionInfo.PortName, connectionInfo.BaudRate));
 }
Exemplo n.º 6
0
 /// <summary>
 /// Crates a new <see cref="BaseGlarduinoClient{TMessageType}"/>.
 /// </summary>
 /// <param name="connectionInfo">The connection information for the port.</param>
 /// <param name="messageDeserializer">The message deserialization strategy.</param>
 /// <param name="messageDispatcher">The message dispatching strategy.</param>
 protected BaseGlarduinoClient(ArduinoPortConnectionInfo connectionInfo,
                               IMessageDeserializerStrategy <TMessageType> messageDeserializer,
                               IMessageDispatchingStrategy <TMessageType> messageDispatcher)
     : this(connectionInfo, messageDeserializer, messageDispatcher, new SerialPortCommunicationPortAdapter(CreateNewSerialPort(connectionInfo)))
 {
 }
 /// <inheritdoc />
 public UnityStringGlarduinoClient(ArduinoPortConnectionInfo connectionInfo,
                                   IMessageDeserializerStrategy <string> messageDeserializer,
                                   IMessageDispatchingStrategy <string> messageDispatcher)
     : base(connectionInfo, messageDeserializer, messageDispatcher)
 {
 }
Exemplo n.º 8
0
 /// <summary>
 /// Crates a new <see cref="BaseIntGlarduinoClient"/>.
 /// </summary>
 /// <param name="connectionInfo">The connection information for the port.</param>
 /// <param name="messageDeserializer">The message deserialization strategy.</param>
 /// <param name="messageDispatcher">The message dispatching strategy.</param>
 public BaseIntGlarduinoClient(ArduinoPortConnectionInfo connectionInfo,
                               IMessageDeserializerStrategy <int> messageDeserializer,
                               IMessageDispatchingStrategy <int> messageDispatcher)
     : base(connectionInfo, messageDeserializer, messageDispatcher)
 {
 }