That's very helpful. The functions should be correct for data on the slave 
(it's little endian). If we cast host integers to char and use these functions 
would be incorrect. 

Sent via the Samsung Galaxy S™ III, an AT&T 4G LTE smartphone

-------- Original message --------
From: Robin Gilks <[email protected]> 
Date: 02/26/2014  4:59 PM  (GMT-05:00) 
To: "OWFS (One-wire file system) discussion and help" 
<[email protected]> 
Subject: Re: [Owfs-developers] Trying to nail ds2413 endian bug 
 

> Not getting very far but at least it is something in the sibling
> processing - I just can't work out what it does in there!!

Can someone confirm that the functions in owfs/module/owlib/src/c/util.c

int UT_getbit(const BYTE * buf, const int loc)
int UT_get2bit(const BYTE * buf, const int loc)
void UT_setbit(BYTE * buf, const int loc, const int bit)
void UT_set2bit(BYTE * buf, const int loc, const int bits)

won't work for big endian as they all treat the input (whether it be UINT
or whatever) as a little endian array, for example as its used in
ow_write>>FS_write_a_bit()

It would certainly explain the ds2413 problem I (and others) have.

Not sure of the solution, maybe a sprinkling of htonl() and ntohl() calls
since they are endian specific for the target?

Cheers

-- 
Robin Gilks



------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
------------------------------------------------------------------------------
Flow-based real-time traffic analytics software. Cisco certified tool.
Monitor traffic, SLAs, QoS, Medianet, WAAS etc. with NetFlow Analyzer
Customize your own dashboards, set traffic alerts and generate reports.
Network behavioral analysis & security monitoring. All-in-one tool.
http://pubads.g.doubleclick.net/gampad/clk?id=126839071&iu=/4140/ostg.clktrk
_______________________________________________
Owfs-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to