Пример #1
0
 /// <summary>
 /// Send a deactivate downlink request.
 /// </summary>
 /// <param name="id">Id of the sensor.</param>
 public Task <string> Deactivate(string id)
 {
     try {
         return(HttpAsync.Post($"/{Path}/{id}/deactivate"));
     } catch {
         Console.WriteLine("Couldn't send deactivate request.");
         throw;
     }
 }
Пример #2
0
 /// <summary>
 /// Send a reboot downlink request.
 /// </summary>
 /// <param name="id">Id of the sensor.</param>
 public Task <string> Reboot(string id)
 {
     try {
         return(HttpAsync.Post($"/{Path}/{id}/reboot"));
     } catch {
         Console.WriteLine("Couldn't send reboot request.");
         throw;
     }
 }
Пример #3
0
 /// <summary>
 /// Insert a new parking lot.
 /// Route: '/api/parking-lot/insert'
 /// </summary>
 /// <param name="json">JSON string</param>
 public static Task <string> InsertParkingLot(string json)
 {
     try {
         return(http.Post("/api/parking-lot/insert", json));
     } catch {
         Console.WriteLine("Couldn't Insert Parking Lot");
         throw;
     }
 }
 /// <summary>
 /// Insert a new gateway.
 /// Route: '/api/gateway/insert'
 /// </summary>
 /// <param name="json">JSON string</param>
 public static Task <string> InsertGateway(string json)
 {
     try {
         return(http.Post("/api/gateway/insert", json));
     } catch {
         Console.WriteLine("Couldn't Insert Gateway");
         throw;
     }
 }
Пример #5
0
        /// <summary>
        /// Get Sensors.
        /// Route: '/api/sensors'
        /// </summary>
        /// <param name="filter">Optional</param>
        /// <returns>Array of sensors</returns>
        public static async Task <List <Sensor> > GetSensors(string filter)
        {
            try {
                string sensors = await http.Post("/api/sensors", filter);

                return(Factories.CreateCollection <Sensor>(sensors));
            } catch {
                Console.WriteLine("Couldn't get Sensors");
                throw;
            }
        }