Beispiel #1
0
 public BrokerController(
     ILogger <BrokerController> logger,
     IMosquittoBrokerService service,
     IMqttClientConfigService configService,
     IServerHostAccessor hostAccessor)
 {
     _logger        = logger;
     _service       = service;
     _configService = configService;
     _hostAccessor  = hostAccessor;
 }
Beispiel #2
0
 public DevicesController(
     ILogger <DevicesController> logger,
     IDeviceService service,
     IMqttEntityIdentifierSuggestionService identifierSuggestService,
     IMqttIdentifierService mqttService,
     ISecureKeySuggestionService SecureKeySuggestionService,
     IMqttClientConfigService configService,
     IServerHostAccessor hostAccessor,
     ISensorValueService valueService)
 {
     _logger      = logger;
     _service     = service;
     _mqttService = mqttService;
     _identifierSuggestService   = identifierSuggestService;
     _secureKeySuggestionService = SecureKeySuggestionService;
     _configService = configService;
     _hostAccessor  = hostAccessor;
     _valueService  = valueService;
 }
        public MosquittoClientService(IMosquittoClientAuthenticationService authService, IMqttClientConfigService config, IMosquittoMessageHandler handler)
        {
            _authService     = authService;
            Host             = config.GetHost();
            Port             = config.GetPort();
            KeepAlive        = 60;
            Timeout          = -1;
            MaxPackets       = 1; // document says it's unused and should be set to 1 for future compatibility
            SleepOnReconnect = 10;
            MessageCallback  = handler.HandleMessage;

            // the service is registered as transient, but double invoke this can cause trouble.
            MosquittoWrapper.mosq_init();
        }