Hi Jan,
well, using echo wasn't a problem at all because owwrite give the same
results.
I ended up looking other .c of owfs and activating debug until I got what
was needed. At the end:
1. in the structure, that particular write needs to be:
{"io_valve", 2, NON_AGGREGATE, ft_ascii, fc_stable, NO_READ_FUNCTION,
FS_write_valve, VISIBLE, NO_FILETYPE_DATA, },
2. OW_write function needs to be re-written to accept two "normal" BYTEs and
not array (ok, can be done also using array, but ok). Looks like this:
static GOOD_OR_BAD OW_write(BYTE data0,BYTE data1, const struct parsedname
*pn)
{
BYTE cmd[] = { _1W_E5_WRITE, data0, data1, };
struct transaction_log t[] = {
TRXN_START,
TRXN_WRITE3(cmd),
TRXN_END,
};
RETURN_BAD_IF_BAD(BUS_transaction(t, pn));
return gbGOOD;
}
3. function that gets called on write needs to look like this:
static ZERO_OR_ERROR FS_write_valve(struct one_wire_query *owq)
{
if (OW_write(OWQ_buffer(owq)[0],OWQ_buffer(owq)[1], PN(owq))){
return -EINVAL ;
}
return 0;
}
Hope this helps someone if runs into the same problem;)
Gabrijel
--
View this message in context:
http://owfs-developers.1086194.n5.nabble.com/Custom-1-wire-slave-need-to-send-two-bytes-tp12906p12910.html
Sent from the OWFS Developers mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers