Esempio n. 1
0
 public int LandCommand(CMD_NAV_Land cmd)
 {
         Clients.Group("vehicles").sendLandCommand(cmd, Context.ConnectionId);
         return cmd.Id;
 }
Esempio n. 2
0
        public IHttpActionResult PostCMD_NAV_LAND(int uid, CMD_NAV_Land jsObject)
        {
            CMD_NAV_Land cmd_nav_land = new CMD_NAV_Land();
            cmd_nav_land.Id = jsObject.Id;
            cmd_nav_land.Altitude = jsObject.Altitude;
            cmd_nav_land.Latitude = jsObject.Latitude;
            cmd_nav_land.Longitude = jsObject.Longitude;
            cmd_nav_land.Throttle = jsObject.Throttle;
            cmd_nav_land.UAVId = jsObject.UAVId;

            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            db.CMD_NAV_Land.Add(cmd_nav_land);
            db.SaveChanges();

            return Ok();
        }