Hi folks,
I'm trying to get a new driver working, and I can't seem to get my write
functions called.
Here's the pertinent bits (from ow_iergbw.c):
READ_FUNCTION(FS_r_get_channel_0);
WRITE_FUNCTION(FS_w_set_channel_0);
static struct filetype IERGBW[] = {
F_STANDARD,
{"all_off", PROPERTY_LENGTH_YESNO, NON_AGGREGATE, ft_yesno,
fc_static, NO_READ_FUNCTION, FS_w_all_off, VISIBLE, NO_FILETYPE_DATA, },
{"channels", PROPERTY_LENGTH_INTEGER, NON_AGGREGATE, ft_unsigned,
fc_static, FS_r_count_channels, NO_WRITE_FUNCTION, VISIBLE,
NO_FILETYPE_DATA, },
{"channel0", 3+1+3+1+3+1+3+1+8+1 /* "r,g,b,w,time" */,
NON_AGGREGATE, ft_vascii, fc_volatile, FS_r_get_channel_0,
FS_w_set_channel_0, VISIBLE, NO_FILETYPE_DATA, },
};
static ZERO_OR_ERROR FS_w_set_channel(BYTE channel, struct one_wire_query
*owq)
{
RGBW_CHANNEL channelData;
channelData.channel = channel;
LEVEL_DEBUG("Channel=%d string='%s'", channel, OWQ_buffer(owq));
RETURN_ERROR_IF_BAD(parse_rgbw_string(OWQ_buffer(owq),
&channelData));
RETURN_ERROR_IF_BAD(OW_w_set_channel(&channelData, (PN(owq;
return 0;
}
static ZERO_OR_ERROR FS_w_set_channel_0(struct one_wire_query *owq)
{
LEVEL_DEBUG("here");
return FS_w_set_channel(0, owq);
}
And here is the debug output:
Successful read:
===
Command
=
cat /mnt/1wire/FE.DECEA5EDBEEF/channel0
001,002,004,000,0100
Debug
=
unique: 9, opcode: LOOKUP (1), nodeid: 1, insize: 56, pid: 17583
LOOKUP /FE.DECEA5EDBEEF
getattr /FE.DECEA5EDBEEF
CALL: ow_fstat.c:(21) path=/FE.DECEA5EDBEEF
CALL: ow_parsename.c:(104) path=[/FE.DECEA5EDBEEF]
DEBUG: ow_regex.c:(154) Not found
DEBUG: ow_regex.c:(201) 0: 0->15 found <><>
DEBUG: ow_regex.c:(201) 1: 0->2 found <><.DECEA5EDBEEF>
DEBUG: ow_regex.c:(201) 2: 3->15 found <>
DEBUG: ow_cache.c:(912) Looking for device FE DE CE A5 ED BE EF E5
DEBUG: ow_cache.c:(1070) Search in cache sn FE DE CE A5 ED BE EF E5
pointer=0x7ff3f1d178d4 index=0 size=4
DEBUG: ow_cache.c:(1086) Value found in cache. Remaining life: 64 seconds.
DEBUG: ow_presence.c:(75) Found device on bus 0
CALL: ow_fstat.c:(38) ATTRIBUTES path=/FE.DECEA5EDBEEF
DEBUG: ow_parsename.c:(63) /FE.DECEA5EDBEEF
NODEID: 2
unique: 9, success, outsize: 144
unique: 10, opcode: LOOKUP (1), nodeid: 2, insize: 49, pid: 17583
LOOKUP /FE.DECEA5EDBEEF/channel0
getattr /FE.DECEA5EDBEEF/channel0
CALL: ow_fstat.c:(21) path=/FE.DECEA5EDBEEF/channel0
CALL: ow_parsename.c:(104) path=[/FE.DECEA5EDBEEF/channel0]
DEBUG: ow_regex.c:(154) Not found
DEBUG: ow_regex.c:(201) 0: 0->15 found <><>
DEBUG: ow_regex.c:(201) 1: 0->2 found <><.DECEA5EDBEEF>
DEBUG: ow_regex.c:(201) 2: 3->15 found <>
DEBUG: ow_cache.c:(912) Looking for device FE DE CE A5 ED BE EF E5
DEBUG: ow_cache.c:(1070) Search in cache sn FE DE CE A5 ED BE EF E5
pointer=0x7ff3f1d178d4 index=0 size=4
DEBUG: ow_cache.c:(1086) Value found in cache. Remaining life: 64 seconds.
DEBUG: ow_presence.c:(75) Found device on bus 0
DEBUG: ow_regex.c:(154) Not found
CALL: ow_fstat.c:(38) ATTRIBUTES path=/FE.DECEA5EDBEEF/channel0
DEBUG: ow_parsename.c:(63) /FE.DECEA5EDBEEF/channel0
NODEID: 3
unique: 10, success, outsize: 144
unique: 11, opcode: OPEN (14), nodeid: 3, insize: 48, pid: 17583
open flags: 0x8000 /FE.DECEA5EDBEEF/channel0
CALL: owfs_callback.c:(127) OPEN path=/FE.DECEA5EDBEEF/channel0
open[0] flags: 0x8000 /FE.DECEA5EDBEEF/channel0
unique: 11, success, outsize: 32
unique: 12, opcode: READ (15), nodeid: 3, insize: 80, pid: 17583
read[0] 131072 bytes from 0 flags: 0x8000
DEBUG: ow_parseobject.c:(163) /FE.DECEA5EDBEEF/channel0
CALL: ow_parsename.c:(104) path=[/FE.DECEA5EDBEEF/channel0]
DEBUG: ow_regex.c:(154) Not found
DEBUG: ow_regex.c:(201) 0: 0->15 found <><>
DEBUG: ow_regex.c:(201) 1: 0->2 found <><.DECEA5EDBEEF>
DEBUG: ow_regex.c:(201) 2: 3->15 found <>
DEBUG: ow_cache.c:(912) Looking for device FE DE CE A5 ED BE EF E5
DEBUG: ow_cache.c:(1070) Search in cache sn FE DE CE A5 ED BE EF E5
pointer=0x7ff3f1d178d4 index=0 size=4
DEBUG: ow_cache.c:(1086) Value found in cache. Remaining life: 64 seconds.
DEBUG: ow_presence.c:(75) Found device on bus 0
DEBUG: ow_regex.c:(154) Not found
DEBUG: owfs_callback.c:(216) Requested read length 131072 will be trimmed
to owfs max 100050
DEBUG: ow_read.c:(72) /FE.DECEA5EDBEEF/channel0
DEBUG: ow_read.c:(204) /FE.DECEA5EDBEEF/channel0
DEBUG: ow_read.c:(238) About to read
extension=0 size=100050 offset=0
DEBUG: ow_read.c:(333) file_length=25 offset=0 size=25
DEBUG: ow_cache.c:(835) FE DE CE A5 ED BE EF E5 size=25 IsUncachedDir=0
DEBUG: ow_cache.c:(1070) Search in cache sn FE DE CE A5 ED BE EF E5
pointer=0x7ff3f1d10f40 index=0 size=25
DEBUG: ow_cache.c:(1102) Value found in cache, but expired by 41 seconds.
DEBUG: ow_select.c:(70) Selecting a path (and device)
path=/FE.DECEA5EDBEEF/channel0 SN=FE DE CE A5 ED BE EF E5 last path=00 00