Download User manual

Transcript
18. Using with unsupported languages
halt;
end;
// forces a device inventory
if( yapiUpdateDeviceList(1,errmsg)<0) then
begin
writeln(errmsg);
halt;
end;
// loads all device handles into dataBuffer
if yapiGetAllDevices(@dataBuffer,sizeof(dataBuffer),neededsize,errmsg)<0 then
begin
writeln(errmsg);
halt;
end;
// gets device info from each handle
for i:=0 to neededsize div sizeof(integer)-1 do
begin
if (apiGetDeviceInfo(dataBuffer[i], devinfos, errmsg)<0) then
begin
writeln(errmsg);
halt;
end;
writeln(pansichar(@devinfos.serial)+' ('+pansichar(@devinfos.productname)+')');
end;
end.
18.4. Porting the high level library
As all the sources of the Yoctopuce API are fully provided, you can very well port the whole API in
the language of your choice. Note, however, that a large portion of the API source code is
automatically generated.
Therefore, it is not necessary for you to port the complete API. You only need to port the yocto_api
file and one file corresponding to a function, for example yocto_relay. After a little additional work,
Yoctopuce is then able to generate all other files. Therefore, we highly recommend that you contact
Yoctopuce support before undertaking to port the Yoctopuce library in another language.
Collaborative work is advantageous to both parties.
122
www.yoctopuce.com