Exemplo n.º 1
0
 internal TocFetcher(ICrtpCommunicator communicator, TocCache <T> cache, byte port, bool useV2protocol)
 {
     _communicator = communicator;
     _port         = port;
     _tocCache     = cache;
     _useV2        = useV2protocol;
 }
Exemplo n.º 2
0
 internal Logger(ICrtpCommunicator communicator, bool useV2Protocol, DirectoryInfo cacheDirectory) : base(communicator, useV2Protocol,
                                                                                                          (byte)CrtpPort.LOGGING,
                                                                                                          new DirectoryInfo(Path.Combine(cacheDirectory.FullName, "LOG")))
 {
     _useV2Protocol = useV2Protocol;
     _communicator  = communicator;
     _communicator.RegisterEventHandler((byte)CrtpPort.LOGGING, LogPacketReceived);
 }
Exemplo n.º 3
0
 public PlatformService(ICrtpCommunicator communicator)
 {
     _communicator = communicator;
     _communicator.RegisterEventHandler((byte)CrtpPort.PLATFORM,
                                        PlatformMessageReceived);
     _communicator.RegisterEventHandler((byte)CrtpPort.LINKCTRL,
                                        CrtServiceMessageReceived);
 }
 internal ParamConfigurator(ICrtpCommunicator communicator, bool useV2Protocol, DirectoryInfo cacheDirectory) :
     base(communicator, useV2Protocol, (byte)CrtpPort.PARAM,
          new DirectoryInfo(Path.Combine(cacheDirectory.FullName, "PARAM")))
 {
     _useV2Protocol     = useV2Protocol;
     _communicator      = communicator;
     _paramSynchronizer = new ParameterSynchronizer(communicator, useV2Protocol);
     _paramSynchronizer.StartProcessing();
     _paramSynchronizer.ParameterReceived += ParameterReceived;
     _paramSynchronizer.ParameterStored   += ParameterStored;
 }
        protected TocContainerBase(ICrtpCommunicator communicator, bool useV2Protocol, byte port,
                                   DirectoryInfo cacheDirectory)
        {
            _useV2Protocol  = useV2Protocol;
            _communicator   = communicator;
            _cacheDirectory = cacheDirectory;
            _tocCache       = new TocCache <T>(_cacheDirectory);

            _tocFetcher = new TocFetcher <T>(_communicator, _tocCache,
                                             port, _useV2Protocol);
            _tocFetcher.TocReceived += TocFetcher_TocReceived;
        }
Exemplo n.º 6
0
        internal LogConfig(ICrtpCommunicator communicator, ITocContainer <LogTocElement> tocContainer, string name, ushort periodInMs)
        {
            _communicator = communicator;
            _tocContainer = tocContainer;
            var periodToSend = periodInMs / 10;

            if (!(periodToSend > 0 && periodToSend < 0xFF))
            {
                throw new ArgumentException("periodInMs must be < 2550 ms.");
            }
            PeriodInMs = periodInMs;
            Name       = name;
        }
 internal ParameterSynchronizer(ICrtpCommunicator communicator, bool useV2)
 {
     _communicator = communicator;
     _useV2        = useV2;
     _communicator.RegisterEventHandler((byte)CrtpPort.PARAM, ParamMessageReceived);
 }
Exemplo n.º 8
0
 internal AtLeastOnceCommunicatorStrategy(ICrtpCommunicator communicator)
 {
     _communicator = communicator;
     _communicator.RegisterAllEventHandler(CheckExceptedAnswer);
 }
Exemplo n.º 9
0
 internal Parameter(ICrtpCommunicator communicator, string name)
 {
     _communicator = communicator;
 }
 internal HighlevelCommander(ICrtpCommunicator communicator, ICrazyflieParamConfigurator paramConfigurator)
 {
     _communicator      = communicator;
     _paramConfigurator = paramConfigurator;
 }
Exemplo n.º 11
0
 /// <summary>
 /// Initialize the commander object. By default the commander is in
 /// +-mode(not x-mode).
 /// </summary>
 public Commander(ICrtpCommunicator communicator, bool clientXMode = false)
 {
     _communicator = communicator;
     ClientXMode   = clientXMode;
 }