Пример #1
0
        /// <summary>
        /// Insert a new sensor named "TEST: c#-api-sensor-insert"
        /// </summary>
        /// <param name="sensorId">The Id of the sensor to insert</param>
        /// <param name="parkingLotId">The Id of the parking lot inserted earlier</param>
        private static async Task InsertSensor(string sensorId, string parkingLotId)
        {
            Console.WriteLine("Testing '/api/sensor/insert'");

            // Sample JSON to send
            JObject json = new JObject {
                ["sensorId"]     = sensorId,
                ["parkingSpace"] = "TEST: c#-api-sensor-insert",
                ["parkingLotId"] = parkingLotId,
                ["network"]      = "PNI",
                ["appEui"]       = "0000000000000000",
                ["appKey"]       = "00000000000000000000000000000000",
                ["disabled"]     = false,
                ["latitude"]     = 33,
                ["longitude"]    = -111
            };

            await SensorApi.InsertSensor(json.ToString());

            Console.WriteLine("Sensor Insert Success\n");
        }