import axios from "axios"
export function DeviceProtocol(){
    return axios.get('http://192.168.0.214:8000/op/dev_cmd_name_poll').then(
        function (response){
            return response.data
        }
    )
}

export function ProtocolCmd(){
    return axios.get('http://192.168.0.214:8000/op/all_dev_cmd_define').then(
        function (response){
            return response.data
        }
    )
}

export function EditProtocolCmd(id,params){
    return axios.put('http://192.168.0.214:8000/op/all_dev_cmd_define/' + id + '/', params).then(
        function (response){
            return response.data
        }
    )
}

export function DeleteProtocolCmd(id){
    return axios.delete('http://192.168.0.214:8000/op/all_dev_cmd_define/' + id).then(
        function (response){
            return response.data
        }
    )
}

export function AddProtocolCMd(params){
    return axios.post('http://192.168.0.214:8000/op/all_dev_cmd_define/' , params).then(
        function (response){
            return response.data
        }
    )
}
