X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=blobdiff_plain;f=src%2Fhardware%2Fdcttech-usbrelay%2Fprotocol.c;fp=src%2Fhardware%2Fdcttech-usbrelay%2Fprotocol.c;h=111e4ef1206c2df87cc648b2279e4c19abbcd7e3;hp=0000000000000000000000000000000000000000;hb=64d54a719aed9204091b8d88c1b881f1341f0592;hpb=569165c0e44323ce8a4baf1da4d540e8976e9d33 diff --git a/src/hardware/dcttech-usbrelay/protocol.c b/src/hardware/dcttech-usbrelay/protocol.c new file mode 100644 index 00000000..111e4ef1 --- /dev/null +++ b/src/hardware/dcttech-usbrelay/protocol.c @@ -0,0 +1,41 @@ +/* + * This file is part of the libsigrok project. + * + * Copyright (C) 2021 Gerhard Sittig + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include "protocol.h" + +SR_PRIV int dcttech_usbrelay_receive_data(int fd, int revents, void *cb_data) +{ + const struct sr_dev_inst *sdi; + struct dev_context *devc; + + (void)fd; + + if (!(sdi = cb_data)) + return TRUE; + + if (!(devc = sdi->priv)) + return TRUE; + + if (revents == G_IO_IN) { + /* TODO */ + } + + return TRUE; +}