New device driver - write function not being called

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

New device driver - write function not being called

Alastair D'Silva
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,00000100

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 <><FE.DECEA5EDBEEF><>
  DEBUG: ow_regex.c:(201) 1: 0->2 found <><FE><.DECEA5EDBEEF>
  DEBUG: ow_regex.c:(201) 2: 3->15 found <FE.><DECEA5EDBEEF><>
  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 <><FE.DECEA5EDBEEF><>
  DEBUG: ow_regex.c:(201) 1: 0->2 found <><FE><.DECEA5EDBEEF>
  DEBUG: ow_regex.c:(201) 2: 3->15 found <FE.><DECEA5EDBEEF><>
  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 <><FE.DECEA5EDBEEF><>
  DEBUG: ow_regex.c:(201) 1: 0->2 found <><FE><.DECEA5EDBEEF>
  DEBUG: ow_regex.c:(201) 2: 3->15 found <FE.><DECEA5EDBEEF><>
  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 </FE.DECEA5EDBEEF/channel0>
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 00
00 00 00 00 00
  DEBUG: ow_select.c:(84) Continuing root branch
  DEBUG: ow_tcp_read.c:(63) attempt 1 bytes Time: 5.000000 seconds
  DEBUG: ow_tcp_read.c:(113) read: 1 - 0 = 1
  DEBUG: ow_select.c:(226) Selecting device FE DE CE A5 ED BE EF E5
  DEBUG: ow_tcp_read.c:(63) attempt 9 bytes Time: 5.000000 seconds
  DEBUG: ow_tcp_read.c:(113) read: 9 - 0 = 9
  DEBUG: ow_transaction.c:(113) send = 0
  DEBUG: ow_transaction.c:(208) end = 0
  DEBUG: ow_transaction.c:(91) select = 0
  DEBUG: ow_tcp_read.c:(63) attempt 3 bytes Time: 5.000000 seconds
  DEBUG: ow_tcp_read.c:(113) read: 3 - 0 = 3
  DEBUG: ow_transaction.c:(113) send = 0
  DEBUG: ow_tcp_read.c:(63) attempt 7 bytes Time: 5.000000 seconds
  DEBUG: ow_tcp_read.c:(113) read: 7 - 0 = 7
  DEBUG: ow_transaction.c:(131) readin = 0
  DEBUG: ow_transaction.c:(208) end = 0
  DEBUG: ow_read.c:(620) Read /FE.DECEA5EDBEEF/channel0 Extension 0 Gives
result 0
  DEBUG: ow_cache.c:(374) Adding data for /FE.DECEA5EDBEEF/channel0
  DEBUG: ow_cache.c:(421) FE DE CE A5 ED BE EF E5 size=25
  DEBUG: ow_cache.c:(635) Add to cache sn FE DE CE A5 ED BE EF E5
pointer=0x7ff3f1d10f40 index=0 size=25
  DEBUG: ow_read.c:(253) return=0
OWQ OneWireQuery structure of /FE.DECEA5EDBEEF/channel0
    OneWireQuery size=25 offset=0, extension=0
Byte buffer OneWireQuery buffer, length=25
--000: 30 30 31 2C 30 30 32 2C 30 30 34 2C 30 30 30 2C
--016: 30 30 30 30 30 31 30 30 00
   <001,002,004,000,00000100.>
    Cleanup = 0002    OneWireQuery I=25 U=25 F=1.23516E-322 Y=25 D=Thu Jan
1 10:00:25 1970

--- OneWireQuery done
  DEBUG: ow_read.c:(263) After read is performed (bytes or error 25)
OWQ OneWireQuery structure of /FE.DECEA5EDBEEF/channel0
    OneWireQuery size=25 offset=0, extension=0
Byte buffer OneWireQuery buffer, length=25
--000: 30 30 31 2C 30 30 32 2C 30 30 34 2C 30 30 30 2C
--016: 30 30 30 30 30 31 30 30 00
   <001,002,004,000,00000100.>
    Cleanup = 0002    OneWireQuery I=25 U=25 F=1.23516E-322 Y=25 D=Thu Jan
1 10:00:25 1970

--- OneWireQuery done
  DEBUG: ow_read.c:(226) /FE.DECEA5EDBEEF/channel0 returns 25
  DEBUG: ow_read.c:(103) /FE.DECEA5EDBEEF/channel0 return 25
  DEBUG: ow_parsename.c:(63) /FE.DECEA5EDBEEF/channel0
   read[0] 25 bytes from 0
   unique: 12, success, outsize: 41
unique: 13, opcode: READ (15), nodeid: 3, insize: 80, pid: 17583
read[0] 131072 bytes from 25 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 <><FE.DECEA5EDBEEF><>
  DEBUG: ow_regex.c:(201) 1: 0->2 found <><FE><.DECEA5EDBEEF>
  DEBUG: ow_regex.c:(201) 2: 3->15 found <FE.><DECEA5EDBEEF><>
  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: ow_parsename.c:(63) /FE.DECEA5EDBEEF/channel0
   read[0] 0 bytes from 25
   unique: 13, success, outsize: 16
unique: 14, opcode: RELEASE (18), nodeid: 3, insize: 64, pid: 0
release[0] flags: 0x8000
   CALL: owfs_callback.c:(135) RELEASE path=/FE.DECEA5EDBEEF/channel0
   unique: 14, success, outsize: 16


Unsuccessful write:
=================

Command:
========
echo "5,10,15,20,300" > /mnt/1wire/FE.DECEA5EDBEEF/channel0
-bash: echo: write error: Invalid argument

Debug:
======
unique: 15, opcode: LOOKUP (1), nodeid: 1, insize: 56, pid: 17589
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 <><FE.DECEA5EDBEEF><>
  DEBUG: ow_regex.c:(201) 1: 0->2 found <><FE><.DECEA5EDBEEF>
  DEBUG: ow_regex.c:(201) 2: 3->15 found <FE.><DECEA5EDBEEF><>
  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:(1102) Value found in cache, but expired by 33 seconds.
 DETAIL: ow_presence.c:(80) Checking presence of /FE.DECEA5EDBEEF
  DEBUG: ow_select.c:(70) Selecting a path (and device)
path=/FE.DECEA5EDBEEF SN=FE DE CE A5 ED BE EF E5 last path=00 00 00 00 00 00
00 00
  DEBUG: ow_select.c:(84) Continuing root branch
  DEBUG: ow_tcp_read.c:(63) attempt 1 bytes Time: 5.000000 seconds
  DEBUG: ow_tcp_read.c:(113) read: 1 - 0 = 1
  DEBUG: ow_tcp_read.c:(63) attempt 25 bytes Time: 5.000000 seconds
  DEBUG: ow_tcp_read.c:(113) read: 25 - 0 = 25
  DEBUG: ow_transaction.c:(222) verify = 0
  DEBUG: ow_transaction.c:(208) end = 0
  DEBUG: ow_presence.c:(274) Presence of FE DE CE A5 ED BE EF E5 FOUND on
bus /dev/ttyUSB0
  DEBUG: ow_cache.c:(546) Adding device location FE DE CE A5 ED BE EF E5
bus=0
  DEBUG: ow_cache.c:(635) Add to cache sn FE DE CE A5 ED BE EF E5
pointer=0x7ff3f1d178d4 index=0 size=4
  DEBUG: ow_cache.c:(546) Adding device location FE DE CE A5 ED BE EF E5
bus=0
  DEBUG: ow_cache.c:(635) Add to cache sn FE DE CE A5 ED BE EF E5
pointer=0x7ff3f1d178d4 index=0 size=4
   CALL: ow_fstat.c:(38) ATTRIBUTES path=/FE.DECEA5EDBEEF
  DEBUG: ow_parsename.c:(63) /FE.DECEA5EDBEEF
   NODEID: 2
   unique: 15, success, outsize: 144
unique: 16, opcode: LOOKUP (1), nodeid: 2, insize: 49, pid: 17589
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 <><FE.DECEA5EDBEEF><>
  DEBUG: ow_regex.c:(201) 1: 0->2 found <><FE><.DECEA5EDBEEF>
  DEBUG: ow_regex.c:(201) 2: 3->15 found <FE.><DECEA5EDBEEF><>
  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: 120
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: 16, success, outsize: 144
unique: 17, opcode: OPEN (14), nodeid: 3, insize: 48, pid: 17589
open flags: 0x8000 /FE.DECEA5EDBEEF/channel0
   CALL: owfs_callback.c:(127) OPEN path=/FE.DECEA5EDBEEF/channel0
   open[0] flags: 0x8000 /FE.DECEA5EDBEEF/channel0
   unique: 17, success, outsize: 32
unique: 18, opcode: READ (15), nodeid: 3, insize: 80, pid: 17589
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 <><FE.DECEA5EDBEEF><>
  DEBUG: ow_regex.c:(201) 1: 0->2 found <><FE><.DECEA5EDBEEF>
  DEBUG: ow_regex.c:(201) 2: 3->15 found <FE.><DECEA5EDBEEF><>
  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: 120
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 </FE.DECEA5EDBEEF/channel0>
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 82 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 00
00 00 00 00 00
  DEBUG: ow_select.c:(84) Continuing root branch
  DEBUG: ow_tcp_read.c:(63) attempt 1 bytes Time: 5.000000 seconds
  DEBUG: ow_tcp_read.c:(113) read: 1 - 0 = 1
  DEBUG: ow_select.c:(226) Selecting device FE DE CE A5 ED BE EF E5
  DEBUG: ow_tcp_read.c:(63) attempt 9 bytes Time: 5.000000 seconds
  DEBUG: ow_tcp_read.c:(113) read: 9 - 0 = 9
  DEBUG: ow_transaction.c:(113) send = 0
  DEBUG: ow_transaction.c:(208) end = 0
  DEBUG: ow_transaction.c:(91) select = 0
  DEBUG: ow_tcp_read.c:(63) attempt 3 bytes Time: 5.000000 seconds
  DEBUG: ow_tcp_read.c:(113) read: 3 - 0 = 3
  DEBUG: ow_transaction.c:(113) send = 0
  DEBUG: ow_tcp_read.c:(63) attempt 7 bytes Time: 5.000000 seconds
  DEBUG: ow_tcp_read.c:(113) read: 7 - 0 = 7
  DEBUG: ow_transaction.c:(131) readin = 0
  DEBUG: ow_transaction.c:(208) end = 0
  DEBUG: ow_read.c:(620) Read /FE.DECEA5EDBEEF/channel0 Extension 0 Gives
result 0
  DEBUG: ow_cache.c:(374) Adding data for /FE.DECEA5EDBEEF/channel0
  DEBUG: ow_cache.c:(421) FE DE CE A5 ED BE EF E5 size=25
  DEBUG: ow_cache.c:(635) Add to cache sn FE DE CE A5 ED BE EF E5
pointer=0x7ff3f1d10f40 index=0 size=25
  DEBUG: ow_read.c:(253) return=0
OWQ OneWireQuery structure of /FE.DECEA5EDBEEF/channel0
    OneWireQuery size=25 offset=0, extension=0
Byte buffer OneWireQuery buffer, length=25
--000: 30 30 31 2C 30 30 32 2C 30 30 34 2C 30 30 30 2C
--016: 30 30 30 30 30 31 30 30 00
   <001,002,004,000,00000100.>
    Cleanup = 0002    OneWireQuery I=25 U=25 F=1.23516E-322 Y=25 D=Thu Jan
1 10:00:25 1970

--- OneWireQuery done
  DEBUG: ow_read.c:(263) After read is performed (bytes or error 25)
OWQ OneWireQuery structure of /FE.DECEA5EDBEEF/channel0
    OneWireQuery size=25 offset=0, extension=0
Byte buffer OneWireQuery buffer, length=25
--000: 30 30 31 2C 30 30 32 2C 30 30 34 2C 30 30 30 2C
--016: 30 30 30 30 30 31 30 30 00
   <001,002,004,000,00000100.>
    Cleanup = 0002    OneWireQuery I=25 U=25 F=1.23516E-322 Y=25 D=Thu Jan
1 10:00:25 1970

--- OneWireQuery done
  DEBUG: ow_read.c:(226) /FE.DECEA5EDBEEF/channel0 returns 25
  DEBUG: ow_read.c:(103) /FE.DECEA5EDBEEF/channel0 return 25
  DEBUG: ow_parsename.c:(63) /FE.DECEA5EDBEEF/channel0
   read[0] 25 bytes from 0
   unique: 18, success, outsize: 41
unique: 19, opcode: READ (15), nodeid: 3, insize: 80, pid: 17589
read[0] 131072 bytes from 25 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 <><FE.DECEA5EDBEEF><>
  DEBUG: ow_regex.c:(201) 1: 0->2 found <><FE><.DECEA5EDBEEF>
  DEBUG: ow_regex.c:(201) 2: 3->15 found <FE.><DECEA5EDBEEF><>
  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: 120
seconds.
  DEBUG: ow_presence.c:(75) Found device on bus 0
  DEBUG: ow_regex.c:(154) Not found
  DEBUG: ow_parsename.c:(63) /FE.DECEA5EDBEEF/channel0
   read[0] 0 bytes from 25
   unique: 19, success, outsize: 16
unique: 20, opcode: RELEASE (18), nodeid: 3, insize: 64, pid: 0
release[0] flags: 0x8000
   CALL: owfs_callback.c:(135) RELEASE path=/FE.DECEA5EDBEEF/channel0
   unique: 20, success, outsize: 16
unique: 21, opcode: LOOKUP (1), nodeid: 1, insize: 56, pid: 30660
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 <><FE.DECEA5EDBEEF><>
  DEBUG: ow_regex.c:(201) 1: 0->2 found <><FE><.DECEA5EDBEEF>
  DEBUG: ow_regex.c:(201) 2: 3->15 found <FE.><DECEA5EDBEEF><>
  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: 109
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: 21, success, outsize: 144
unique: 22, opcode: LOOKUP (1), nodeid: 2, insize: 49, pid: 30660
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 <><FE.DECEA5EDBEEF><>
  DEBUG: ow_regex.c:(201) 1: 0->2 found <><FE><.DECEA5EDBEEF>
  DEBUG: ow_regex.c:(201) 2: 3->15 found <FE.><DECEA5EDBEEF><>
  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: 109
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: 22, success, outsize: 144
unique: 23, opcode: OPEN (14), nodeid: 3, insize: 48, pid: 30660
open flags: 0x8001 /FE.DECEA5EDBEEF/channel0
   CALL: owfs_callback.c:(127) OPEN path=/FE.DECEA5EDBEEF/channel0
   open[0] flags: 0x8001 /FE.DECEA5EDBEEF/channel0
   unique: 23, success, outsize: 32
unique: 24, opcode: GETXATTR (22), nodeid: 3, insize: 68, pid: 30660
   unique: 24, error: -38 (Function not implemented), outsize: 16
unique: 25, opcode: SETATTR (4), nodeid: 3, insize: 128, pid: 30660
truncate /FE.DECEA5EDBEEF/channel0 0
   CALL: owfs_callback.c:(143) TRUNCATE path=/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 <><FE.DECEA5EDBEEF><>
  DEBUG: ow_regex.c:(201) 1: 0->2 found <><FE><.DECEA5EDBEEF>
  DEBUG: ow_regex.c:(201) 2: 3->15 found <FE.><DECEA5EDBEEF><>
  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: 109
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
   unique: 25, success, outsize: 120
unique: 26, opcode: WRITE (16), nodeid: 3, insize: 95, pid: 30660
write[0] 15 bytes to 0 flags: 0x8001
   CALL: ow_write.c:(71) path=/FE.DECEA5EDBEEF/channel0 size=15 offset=0
  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 <><FE.DECEA5EDBEEF><>
  DEBUG: ow_regex.c:(201) 1: 0->2 found <><FE><.DECEA5EDBEEF>
  DEBUG: ow_regex.c:(201) 2: 3->15 found <FE.><DECEA5EDBEEF><>
  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: 109
seconds.
  DEBUG: ow_presence.c:(75) Found device on bus 0
  DEBUG: ow_regex.c:(154) Not found
OWQ OneWireQuery structure of /FE.DECEA5EDBEEF/channel0
    OneWireQuery size=15 offset=0, extension=0
Byte buffer OneWireQuery buffer, length=15
--000: 35 2C 31 30 2C 31 35 2C 32 30 2C 33 30 30 0A
   <5,10,15,20,300.>
    Cleanup = 0002    OneWireQuery I=15 U=15 F=7.41098E-323 Y=15 D=Thu Jan
1 10:00:15 1970

--- OneWireQuery done
  DEBUG: ow_write.c:(437) Write a non-array element
/FE.DECEA5EDBEEF/channel0
  DEBUG: ow_cache.c:(1362) Delete from cache sn FE DE CE A5 ED BE EF E5
in=0x7ff3f1d10f40 index=0
  DEBUG: ow_write.c:(495) Write /FE.DECEA5EDBEEF/channel0 Extension 0 Gives
result -22
  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 00
00 00 00 00 00
  DEBUG: ow_select.c:(84) Continuing root branch
  DEBUG: ow_tcp_read.c:(63) attempt 1 bytes Time: 5.000000 seconds
  DEBUG: ow_tcp_read.c:(113) read: 1 - 0 = 1
  DEBUG: ow_tcp_read.c:(63) attempt 25 bytes Time: 5.000000 seconds
  DEBUG: ow_tcp_read.c:(113) read: 25 - 0 = 25
  DEBUG: ow_transaction.c:(222) verify = 0
  DEBUG: ow_transaction.c:(208) end = 0
  DEBUG: ow_presence.c:(274) Presence of FE DE CE A5 ED BE EF E5 FOUND on
bus /dev/ttyUSB0
  DEBUG: ow_cache.c:(546) Adding device location FE DE CE A5 ED BE EF E5
bus=0
  DEBUG: ow_cache.c:(635) Add to cache sn FE DE CE A5 ED BE EF E5
pointer=0x7ff3f1d178d4 index=0 size=4
  DEBUG: ow_write.c:(437) Write a non-array element
/FE.DECEA5EDBEEF/channel0
  DEBUG: ow_cache.c:(1362) Delete from cache sn FE DE CE A5 ED BE EF E5
in=0x7ff3f1d10f40 index=0
  DEBUG: ow_write.c:(495) Write /FE.DECEA5EDBEEF/channel0 Extension 0 Gives
result -22
  DEBUG: ow_write.c:(437) Write a non-array element
/FE.DECEA5EDBEEF/channel0
  DEBUG: ow_cache.c:(1362) Delete from cache sn FE DE CE A5 ED BE EF E5
in=0x7ff3f1d10f40 index=0
  DEBUG: ow_write.c:(495) Write /FE.DECEA5EDBEEF/channel0 Extension 0 Gives
result -22
  DEBUG: ow_write.c:(112) Error writing to /FE.DECEA5EDBEEF/channel0
  DEBUG: ow_parsename.c:(63) /FE.DECEA5EDBEEF/channel0
   unique: 26, error: -22 (Invalid argument), outsize: 16
unique: 27, opcode: RELEASE (18), nodeid: 3, insize: 64, pid: 0
release[0] flags: 0x8001
   CALL: owfs_callback.c:(135) RELEASE path=/FE.DECEA5EDBEEF/channel0
   unique: 27, success, outsize: 16

==========
END DEBUG
==========

Notably missing is the debug line from FS_w_set_channel_0 and
FS_w_set_channel.

Any ideas?


--
Alastair D'Silva           mob: 0423 762 819
skype: alastair_dsilva     msn: [hidden email]
blog: http://alastair.d-silva.org    Twitter: @EvilDeece




------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

Re: New device driver - write function not being called

Jan Kandziora
Am 15.02.2017 um 12:54 schrieb Alastair D'Silva:
>
> Command:
> ========
> echo "5,10,15,20,300" > /mnt/1wire/FE.DECEA5EDBEEF/channel0
> -bash: echo: write error: Invalid argument
>
Is your parse_rgbw_string() tolerant against \n?


Kind regards

        Jan

------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

Re: New device driver - write function not being called

Alastair D'Silva
> -----Original Message-----
> From: Jan Kandziora [mailto:[hidden email]]
> Sent: Thursday, 16 February 2017 3:01 AM
> To: OWFS (One-wire file system) discussion and help <owfs-
> [hidden email]>
> Subject: Re: [Owfs-developers] New device driver - write function not
being

> called
>
> Am 15.02.2017 um 12:54 schrieb Alastair D'Silva:
> >
> > Command:
> > ========
> > echo "5,10,15,20,300" > /mnt/1wire/FE.DECEA5EDBEEF/channel0
> > -bash: echo: write error: Invalid argument
> >
> Is your parse_rgbw_string() tolerant against \n?

Thanks Jan, it should be, but for completeness, here it is:

static GOOD_OR_BAD parse_rgbw_string(char *buf, RGBW_CHANNEL *channel) {

        if (sscanf(buf, "%hhu,%hhu,%hhu,%hhu,%d", &channel->red,
&channel->green, &channel->blue, &channel->white, &channel->fade_time) != 5)
{
                LEVEL_DEBUG("Parsing failed");
                return gbBAD;
        }

        if (channel->fade_time >= (2^24)) {
                return gbBAD;
        }

        return gbGOOD;
}

Note that I don't get the debug message out.

I did notice that this might be the first time that writes are used on a
ft_vascii field, so I may not be following a well-tested path.

--
Alastair D'Silva           mob: 0423 762 819
skype: alastair_dsilva     msn: [hidden email]
blog: http://alastair.d-silva.org    Twitter: @EvilDeece




------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

Re: New device driver - write function not being called

Alastair D'Silva
> -----Original Message-----
> From: Alastair D'Silva [mailto:[hidden email]]
> Sent: Thursday, 16 February 2017 7:02 PM
> To: 'OWFS (One-wire file system) discussion and help' <owfs-
> [hidden email]>
> Subject: Re: [Owfs-developers] New device driver - write function not
being
> called
>
> if (channel->fade_time >= (2^24)) {
> return gbBAD;
> }

And there's the problem - that's not how you perform a power operation :)


------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

Re: New device driver - write function not being called

Jan Kandziora
Am 16.02.2017 um 09:10 schrieb Alastair D'Silva:

>> -----Original Message-----
>> From: Alastair D'Silva [mailto:[hidden email]]
>> Sent: Thursday, 16 February 2017 7:02 PM
>> To: 'OWFS (One-wire file system) discussion and help' <owfs-
>> [hidden email]>
>> Subject: Re: [Owfs-developers] New device driver - write function not
> being
>> called
>>
>> if (channel->fade_time >= (2^24)) {
>> return gbBAD;
>> }
>
> And there's the problem - that's not how you perform a power operation :)
>
You're welcome. __[^_^]__

Kind regards

        Jan


------------------------------------------------------------------------------
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
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers