Ejemplo n.º 1
0
        public NodeResult GetNodeConfiguration(string hardwareId)
        {
            int hwId = 0;

            try {
                hwId = Int32.Parse(hardwareId, System.Globalization.NumberStyles.HexNumber);
            } catch (Exception) {
                _logger.LogWarning("Could not parse chipId: {hardwareId}. Using 0 as a default.", hardwareId);
            }

            _logger.LogInformation("Returning information for node {hardwareId}", hwId);


            // Return a static node untill we have a database up and running.
            // Or have some configuration in place to load dynamic node settings
            return(NodeResult.FromNode(
                       new Node {
                Hardware_id = hwId,
                Name = "DefaultNode",
                Sensors = new[] { SensorSchemaBuilder.BuildDefault(SensorType.LED) }
            }
                       ));
        }