Actually ther is only one public function call:
     function ask(pCallType, pFlags: UInt32; pTxt: AnsiString;
                                     var pAnswer: TStringlist):integer;

It returns the errorcode as delivered from owserver, and the value(s) 
obtained is in the pAnswer stringlist.

The different calltypes, and flags are defined in the unit as integer 
constants.

pTxt is the payload for the read or write command.

I have not tried a write (set) command, as the only 1-wire units I have 
are temperature sensors, with nothing to write.

The usual sequence as I have imagined (and used in my application) is:

// get allDirs
flags:=owpersistence+owBus_ret+fic; // format with no punctiation
                                     // and all digits
owClient.ask(owDirall, flags,'/', Answer); //dirs in Answer(TStringlist)

//Get a specific reading
// flags same as before
tmpstr:=Answer.Items[n]+'/temperature';
   // n point to string with relevant sensorID
Answer.clear;
owClient.ask(owDirall, flags,tmpstr, Answer);
   // Reading or 'not found' now in Answer[0] (TStringlist)

Answer must be created and destroyed in program, owClient just uses it 
as a transfer mechanism.

If you use flag owpersistence you should probably use

owClient.active:=false;

when you have the wanted readings, to avoid dead connections to the 
server. In testapplication this happens by using button Closeconnection.

But see the Teastapplication for further information. The TCheckListBox 
for setting flags is so far not implemented, but the RequestType sets 
the wanted type.

--
Yours
Hans Erik Busk

On 07-04-2013 19:04, Roberto Spadim wrote:
> Please, if possible send example with 'get' and 'set' and 'dir' commands
> to retrieve and send information about files and directories, i think
> its all we need in api client side, errors can be handled by app like no
> value from server, but maybe in a next release an error interface will
> be nice
>

------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
Owfs-developers mailing list
Owfs-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/owfs-developers

Reply via email to