예제 #1
0
        public IEnumerable <string> Get()
        {
            Blitz  helper    = new Blitz();
            string deviceMAC = helper.GenerateToken("B8:7C6F:1A:D8:25");

            return(new string[] { deviceMAC, "value2" });
            //return new string[] { "Please add a parameter", "Parameter is an encoded MAC address" };
        }
예제 #2
0
        public IActionResult CreateToken(Device parameter)
        {
            DeviceManager manager = new DeviceManager();

            if (manager.IsActive(parameter.MAC, 2))
            {
                Blitz  helper = new Blitz();
                string token  = helper.GenerateToken(parameter.MAC);
                return(Ok(token));
            }
            return(BadRequest());
        }