Click here to Skip to main content
15,896,063 members
Articles / Desktop Programming / WPF

Lego Mindstorms NXT 2.0 Bot controlled using MRDS

Rate me:
Please Sign up or sign in to vote.
4.43/5 (4 votes)
27 Nov 2010CPOL3 min read 51.5K   724   8  
A Lego Mindstorms NXT 2.0 Bot controlled using Microsoft Robotics Developer Studio
using System;
using System.Collections.Generic;
using System.ComponentModel;
using Microsoft.Ccr.Core;
using Microsoft.Dss.Core.Attributes;
using Microsoft.Dss.ServiceModel.Dssp;
using Microsoft.Dss.ServiceModel.DsspServiceBase;
using W3C.Soap;

namespace MyLegoCarService
{
    /// <summary>
    /// MyLegoCarService contract class
    /// </summary>
    public sealed class Contract
    {
        /// <summary>
        /// DSS contract identifer for MyLegoCarService
        /// </summary>
        [DataMember]
        public const string Identifier = "http://schemas.tempuri.org/2010/09/mylegocarservice.html";
    }

    /// <summary>
    /// MyLegoCarService state
    /// </summary>
    [DataContract]
    public class MyLegoCarServiceState
    {
    }

    /// <summary>
    /// MyLegoCarService main operations port
    /// </summary>
    [ServicePort]
    public class MyLegoCarServiceOperations : PortSet<DsspDefaultLookup, DsspDefaultDrop, Get, Subscribe, TimerTick>
    {
    }

    /// <summary>
    /// MyLegoCarService get operation
    /// </summary>
    public class Get : Get<GetRequestType, PortSet<MyLegoCarServiceState, Fault>>
    {
        /// <summary>
        /// Creates a new instance of Get
        /// </summary>
        public Get()
        {
        }

        /// <summary>
        /// Creates a new instance of Get
        /// </summary>
        /// <param name="body">the request message body</param>
        public Get(GetRequestType body)
            : base(body)
        {
        }

        /// <summary>
        /// Creates a new instance of Get
        /// </summary>
        /// <param name="body">the request message body</param>
        /// <param name="responsePort">the response port for the request</param>
        public Get(GetRequestType body, PortSet<MyLegoCarServiceState, Fault> responsePort)
            : base(body, responsePort)
        {
        }
    }

    /// <summary>
    /// MyLegoCarService subscribe operation
    /// </summary>
    public class Subscribe : Subscribe<SubscribeRequestType, PortSet<SubscribeResponseType, Fault>>
    {
        /// <summary>
        /// Creates a new instance of Subscribe
        /// </summary>
        public Subscribe()
        {
        }

        /// <summary>
        /// Creates a new instance of Subscribe
        /// </summary>
        /// <param name="body">the request message body</param>
        public Subscribe(SubscribeRequestType body)
            : base(body)
        {
        }

        /// <summary>
        /// Creates a new instance of Subscribe
        /// </summary>
        /// <param name="body">the request message body</param>
        /// <param name="responsePort">the response port for the request</param>
        public Subscribe(SubscribeRequestType body, PortSet<SubscribeResponseType, Fault> responsePort)
            : base(body, responsePort)
        {
        }
    }

    public class TimerTick : Update<TimerTickRequest, PortSet<DefaultUpdateResponseType, Fault>>
    {
        public TimerTick()
            : base(new TimerTickRequest())
        {
        }
    }


    [DataContract]
    public class TimerTickRequest
    {
    }

}


By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior)
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions