yapi.h
Go to the documentation of this file.
1 /*********************************************************************
2  *
3  * $Id: yapi.h 24575 2016-05-26 06:28:03Z seb $
4  *
5  * Declaration of public entry points to the low-level API
6  *
7  * - - - - - - - - - License information: - - - - - - - - -
8  *
9  * Copyright (C) 2011 and beyond by Yoctopuce Sarl, Switzerland.
10  *
11  * Yoctopuce Sarl (hereafter Licensor) grants to you a perpetual
12  * non-exclusive license to use, modify, copy and integrate this
13  * file into your software for the sole purpose of interfacing
14  * with Yoctopuce products.
15  *
16  * You may reproduce and distribute copies of this file in
17  * source or object form, as long as the sole purpose of this
18  * code is to interface with Yoctopuce products. You must retain
19  * this notice in the distributed source file.
20  *
21  * You should refer to Yoctopuce General Terms and Conditions
22  * for additional information regarding your rights and
23  * obligations.
24  *
25  * THE SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT
26  * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING
27  * WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY, FITNESS
28  * FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO
29  * EVENT SHALL LICENSOR BE LIABLE FOR ANY INCIDENTAL, SPECIAL,
30  * INDIRECT OR CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA,
31  * COST OF PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR
32  * SERVICES, ANY CLAIMS BY THIRD PARTIES (INCLUDING BUT NOT
33  * LIMITED TO ANY DEFENSE THEREOF), ANY CLAIMS FOR INDEMNITY OR
34  * CONTRIBUTION, OR OTHER SIMILAR COSTS, WHETHER ASSERTED ON THE
35  * BASIS OF CONTRACT, TORT (INCLUDING NEGLIGENCE), BREACH OF
36  * WARRANTY, OR OTHERWISE.
37  *
38  *********************************************************************/
39 
40 #ifndef YAPI_H
41 #define YAPI_H
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
47 #include "ydef.h"
48 
49 #if defined(WINDOWS_API) && defined(GENERATE_DLL)
50 #define YAPI_FUNCTION_EXPORT __declspec(dllexport)
51 #else
52 #define YAPI_FUNCTION_EXPORT
53 #endif
54 
55 // Timeout for blocking requests to the devices, in milliseconds
56 #define YAPI_BLOCKING_USBOPEN_REQUEST_TIMEOUT 2000
57 #define YAPI_BLOCKING_USBREAD_REQUEST_TIMEOUT 8000
58 #define YAPI_BLOCKING_NET_REQUEST_TIMEOUT 30000
59 
60 /*****************************************************************************
61  CALLBACK TYPES
62  ****************************************************************************/
63 
64 // prototype of the Log callback
65 typedef void YAPI_FUNCTION_EXPORT(*yapiLogFunction)(const char *log,u32 loglen);
66 
67 // prototype of the device arrival/update/removal callback
69 
70 
71 // prototype of functions change callback
72 // value :
73 // if null : notify a new logical name
74 // if not null : notify a new value, (a pointer to a YOCTO_PUBVAL_LEN bytes null terminated string)
75 typedef void YAPI_FUNCTION_EXPORT(*yapiFunctionUpdateCallback)(YAPI_FUNCTION fundescr,const char *value);
76 
77 // prototype of timed report callback
78 typedef void YAPI_FUNCTION_EXPORT(*yapiTimedReportCallback)(YAPI_FUNCTION fundesc, double timestamp, const u8 *bytes, u32 len);
79 
80 // prototype of the ssdp hub discovery callback
81 typedef void YAPI_FUNCTION_EXPORT(*yapiHubDiscoveryCallback)(const char *serial, const char *url);
82 
83 typedef void YAPI_FUNCTION_EXPORT(*yapiDeviceLogCallback)(YAPI_FUNCTION fundescr,const char *line);
84 
85 
86 /*****************************************************************************
87  API FUNCTION DECLARATION
88  ****************************************************************************/
89 
90 
91 void YAPI_FUNCTION_EXPORT yapiStartStopDeviceLogCallback(const char *serial,int start);
92 
93 
94 
95 
96 
97 /*****************************************************************************
98  Function:
99  YRETCODE yInitAPI(int type,char *errmsg)
100 
101  Description:
102  Initializes and Allocate structures needed for the YoctoAPI
103 
104  Parameters:
105  type: Y_DETECT_USB will auto-detect only USB connnected devices
106  Y_DETECT_NET will auto-detect only Network devices
107  Y_DETECT_ALL will auto-detect devices on all usable protocol
108  errmsg: a pointer to a buffer of YOCTO_ERRMSG_LEN bytes to store any error message
109 
110  Returns:
111  on ERROR : error code
112  on SUCCES : YAPI_SUCCESS
113 
114  Remarks:
115  This function must be called first and only one time.
116  Network devices can be used when Y_DETECT_NET is not specified when
117  manually registering network hubs; auto-detection only applies to
118  Bonjour-based and NBNS-based discovery.
119  ***************************************************************************/
120 YRETCODE YAPI_FUNCTION_EXPORT yapiInitAPI(int type,char *errmsg);
121 
122 #define Y_DETECT_NONE 0
123 #define Y_DETECT_USB 1
124 #define Y_DETECT_NET 2
125 #define Y_RESEND_MISSING_PKT 4
126 #define Y_DETECT_ALL (Y_DETECT_USB | Y_DETECT_NET)
127 
128 #define Y_DEFAULT_PKT_RESEND_DELAY 50
129 
130 
131 /*****************************************************************************
132  Function:
133  void yFreeAPI(void)
134 
135  Description:
136  Release Allocate structures needed for the YoctoAPI
137 
138  Parameters:
139  None
140 
141  Returns:
142  None
143 
144  Remarks:
145 
146  ***************************************************************************/
148 
149 
150 /*****************************************************************************
151  Function:
152  void yapiRegisterLogFunction(yapiLogFunction logfun);
153 
154  Description:
155  Register log function for yapi. This function is used mainly for debug purpose.
156  To unregister your callback you can call this function with a NULL pointer.
157 
158  Parameters:
159  logfun : a function to register or NULL to unregister the callback
160 
161  Returns:
162  None
163 
164  ***************************************************************************/
166 
167 /*****************************************************************************
168 
169 
170  ***************************************************************************/
172 
173 /*****************************************************************************
174  Function:
175  void yapiRegisterDeviceArrivalCallback(yapiDeviceUpdateCallback arrivalCallback);
176 
177  Description:
178  Register a callback function for device arrival. This function is only used to
179  notify event you should return as soon as possible of the callback. you should
180  also not call yapiUpdateDeviceList from the callback.
181  To unregister your callback you can call this function with a NULL pointer.
182 
183  Parameters:
184  arrivalCallback : a function to register or NULL to unregister the callback
185 
186  Returns:
187  None
188 
189  ***************************************************************************/
191 
192 /*****************************************************************************
193  Function:
194  void yapiRegisterDeviceRemovalCallback(yapiDeviceUpdateCallback removalCallback);
195 
196  Description:
197  Register a callback function for device removal. This function is only used to
198  notify event you should return as soon as possible of the callback. you should
199  also not call yapiUpdateDeviceList from the callback.
200  To unregister your callback you can call this function with a NULL pointer.
201 
202  Parameters:
203  removalCallback : a function to register or NULL to unregister the callback
204 
205  Returns:
206  None
207 
208  ***************************************************************************/
210 
211 /*****************************************************************************
212  Function:
213  void yapiRegisterDeviceChangeCallback(yapiDeviceUpdateCallback changeCallback);
214 
215  Description:
216  Register a callback function for a device that change his logical name. This function
217  is only used to notify event you should return as soon as possible of the callback.
218  you should also not call yapiUpdateDeviceList from the callback. To unregister
219  your callback you can call this function with a NULL pointer.
220 
221  Parameters:
222  changeCallback : a function to register or NULL to unregister the callback
223 
224  Returns:
225  None
226 
227  ***************************************************************************/
229 
230 /*****************************************************************************
231  Function:
232  void yapiRegisterFunctionUpdateCallback(yapiFunctionUpdateCallback updateCallback);
233 
234  Description:
235  Register a callback function for device function notification (value change,
236  configuration change...). This function is only used to notify event you should
237  return as soon as possible of the callback. To unregister your callback you can
238  call this function with a NULL pointer.
239 
240  Parameters:
241  updateCallback : a function to register or NULL to unregister the callback
242 
243  Returns:
244  None
245 
246  ***************************************************************************/
248 
249 /*****************************************************************************
250  Function:
251  void YAPI_FUNCTION_EXPORT yapiRegisterTimedReportCallback(yapiTimedReportCallback timedReportCallback);
252 
253  Description:
254  Register a callback function for device function timed report. This function
255  is only used to notify event you should return as soon as possible of the
256  callback. To unregister your callback you can call this function with a NULL
257  pointer.
258 
259  Parameters:
260  timedReportCallback : a function to register or NULL to unregister the callback
261 
262  Returns:
263  None
264 
265  ***************************************************************************/
267 
269 
270 
272 
274 
275 
277 
278 
279 
280 
281 /*****************************************************************************
282  Function:
283  YRETCODE yapiTestHub(const char *rooturl, int mstimeout, char *errmsg)
284 
285  Description:
286  Test if a network URL can be used for yapiRegisterHub and yapiPreregisterHub. This
287  function will not register the hub but will test that the hub is reachable and that
288  authentication parameters are correct. This function will return before mstimeout (or
289  2 * mstimeout if the hub use authentication)
290 
291  Parameters:
292  rooturl: The network URL of the hub, for instance "http://192.168.2.34", or "usb"
293  mstimeout: The number of ms that the function has to test the URL
294  errmsg: a pointer to a buffer of YOCTO_ERRMSG_LEN bytes to store any error message
295 
296  Returns:
297  on ERROR : error code
298  on SUCCES : YAPI_SUCCESS
299 
300  Remarks:
301 
302  ***************************************************************************/
303 YRETCODE YAPI_FUNCTION_EXPORT yapiTestHub(const char *rooturl, int mstimeout, char *errmsg);
304 
305 
306 /*****************************************************************************
307  Function:
308  YRETCODE yRegisterHub(const char *rooturl,char *errmsg)
309 
310  Description:
311  Register a network URL to be scanned for devices when yUpdateDeviceList
312  is called. To enable USB detection you could use "usb" as rooturl. This
313  is will return an error (and not register the hub) the url is not reachable
314 
315  Parameters:
316  rooturl: The network URL of the hub, for instance "http://192.168.2.34", or "usb"
317  errmsg: a pointer to a buffer of YOCTO_ERRMSG_LEN bytes to store any error message
318 
319  Returns:
320  on ERROR : error code
321  on SUCCES : YAPI_SUCCESS
322 
323  Remarks:
324  if you have initialized the API with Y_DETECT_USB it is not necessary to
325  manually to call this function with "usb"
326 
327  ***************************************************************************/
328 YRETCODE YAPI_FUNCTION_EXPORT yapiRegisterHub(const char *rooturl, char *errmsg);
329 
330 
331 /*****************************************************************************
332  Function:
333  YRETCODE yPreregisterHub(const char *rooturl,char *errmsg)
334 
335  Description:
336  Register a network URL to be scanned for devices when yUpdateDeviceList
337  is called. To enable USB detection you could use "usb" as rooturl. it is
338  not considered as an error to give an url that is not reachable.
339 
340  Parameters:
341  rooturl: The network URL of the hub, for instance "http://192.168.2.34", or "usb"
342  errmsg: a pointer to a buffer of YOCTO_ERRMSG_LEN bytes to store any error message
343 
344  Returns:
345  on ERROR : error code
346  on SUCCES : YAPI_SUCCESS
347 
348  Remarks:
349  if you have initialized the API with Y_DETECT_USB it is not necessary to
350  manually to call this function with "usb"
351 
352  ***************************************************************************/
353 YRETCODE YAPI_FUNCTION_EXPORT yapiPreregisterHub(const char *rooturl, char *errmsg);
354 
355 
356 
357 
358 /*****************************************************************************
359  Function:
360  YRETCODE yUnregisterHub(const char *rooturl)
361 
362  Description:
363  Unregister a network URL that has been register by yapiPreRegisterHub or yapiRegisterHub
364 
365  Parameters:
366  rooturl: The network URL of the hub, for instance "http://192.168.2.34", or "usb"
367 
368  Returns:
369 
370  Remarks:
371 
372  ***************************************************************************/
373 void YAPI_FUNCTION_EXPORT yapiUnregisterHub(const char *url);
374 
375 
376 
377 /*****************************************************************************
378  Function:
379  int yUpdateDeviceList(char *errmsg)
380 
381  Description:
382  Detect or redetect all Yocto devices. This function can be called multiples
383  times to refresh the devices list.
384 
385  Parameters:
386  errmsg: a pointer to a buffer of YOCTO_ERRMSG_LEN bytes to store any error message
387 
388  Returns:
389  on ERROR : an error code
390  on SUCCES : YAPI_SUCCESS
391 
392  Remarks:
393 
394  ***************************************************************************/
395 YRETCODE YAPI_FUNCTION_EXPORT yapiUpdateDeviceList(u32 forceupdate, char *errmsg);
396 
397 
398 /*****************************************************************************
399  Function:
400  YRETCODE yapiHandleEvents(char *errmsg)
401 
402  Description:
403  Perform periodic polling tasks on USB queues, invoke callbacks, etc
404  This function can be called either from application main loop (if any)
405  or from a dedicated thread in a multithreaded application.
406 
407  Parameters:
408  errmsg: a pointer to a buffer of YOCTO_ERRMSG_LEN bytes to store any error message
409 
410  Returns:
411  on ERROR : error code
412  on SUCCESS : YAPI_SUCCESS
413 
414  Remarks:
415 
416  ***************************************************************************/
418 
419 
420 /*****************************************************************************
421  Function:
422  YRETCODE yapiSleep(int duration_ms,char *errmsg)
423 
424  Description:
425  Perform periodic polling tasks on USB queues, invoke callbacks, etc
426  This function can be called either from application main loop (if any)
427  or from a dedicated thread in a multithreaded application.
428 
429  Parameters:
430  errmsg: a pointer to a buffer of YOCTO_ERRMSG_LEN bytes to store any error message
431 
432  Returns:
433  on ERROR : error code
434  on SUCCESS : YAPI_SUCCESS
435 
436  Remarks:
437 
438  ***************************************************************************/
439 YRETCODE YAPI_FUNCTION_EXPORT yapiSleep(int duration_ms, char *errmsg);
440 
441 
442 /*****************************************************************************
443  Function:
444  u64 yGetTickCount()
445 
446  Description:
447  Return a the current value of a monotone millisecond-based time counter
448 
449  Returns:
450  Monotone millisecond-based time counter
451 
452  Remarks:
453  ***************************************************************************/
455 
456 
457 /*****************************************************************************
458  Function:
459  int yCheckLogicalName(const char *name)
460 
461  Description:
462  Verifies if a given logical name is valid or not for this API
463 
464  Parameters:
465  name: the logicalName to verify
466 
467  Returns:
468  true (1) or false (0)
469 
470  Remarks:
471 
472  *****************************************************************************/
473 int YAPI_FUNCTION_EXPORT yapiCheckLogicalName(const char *name);
474 
475 /*****************************************************************************
476  Function:
477  u16 yGetAPIVersion(char **version,char **subversion)
478 
479  Description:
480  Return API Version
481 
482  Parameters:
483  version: if not NULL this pointer will be updated with the version of the api
484  build: if not NULL this pointer will be updated with the subversion of the api
485  date : if not NULL this pointer will be updated with the date of the api
486 
487  Returns:
488  Return the BCD encoded version number of the API
489 
490  Remarks:
491  ***************************************************************************/
492 u16 YAPI_FUNCTION_EXPORT yapiGetAPIVersion(const char **version,const char **apidate);
493 
494 
495 //
496 /*****************************************************************************
497  Function:
498  YRETCODE SetTraceFile(const char *file)
499 
500  Description:
501  Enable low-level traces of the API into a specified file
502 
503  Parameters:
504  file: the full path of the log file to use
505 
506  Remarks:
507  This function is typically called even before yInitAPI.
508  It is optional, and should only be called when low-level logs
509  are desirable.
510  ***************************************************************************/
511 void YAPI_FUNCTION_EXPORT yapiSetTraceFile(const char *file);
512 
513 
514 /*****************************************************************************
515  Function:
516  YAPI_DEVICE yGetDevice(const char *device_str,char *errmsg)
517 
518  Description:
519  return a device descriptor identifying a device provided by serial number,
520  logical name or URL. The descriptor can later be used with yGetDeviceInfo
521  to retrieve all properties of the device. The function will fail if there
522  is no connected device matching the requested device string.
523 
524  Parameters:
525  device_str : string referring to a Yocto device (serial number, logical name or URL)
526  errmsg : a pointer to a buffer of YOCTO_ERRMSG_LEN bytes to store any error message
527 
528  Returns:
529  check the result with the YISERR(retcode)
530  on ERROR : error code
531  on SUCCESS : a valid YAPI_DEVICE descriptor
532 
533  Example:
534  char errmsg[YOCTO_ERRMSG_LEN];
535  YAPI_DEVICE mydevice = yGetDevice("logicalname");
536  yDeviceSt infos;
537  if(mydevice < 0 || yGetDeviceInfo(mydevice, &infos, errmsg) < 0) {
538  // handle error
539  }
540 
541  ***************************************************************************/
542 YAPI_DEVICE YAPI_FUNCTION_EXPORT yapiGetDevice(const char *device_str,char *errmsg);
543 
544 
545 /*****************************************************************************
546  Function:
547  int yGetAllDevices(YAPI_DEVICE *buffer,int maxsize,int *neededsize,char *errmsg)
548 
549  Description:
550  fill buffer with device descriptors that can be used to access device details.
551  If buffer == NULL the function will only set neededsize so that the caller can
552  allocate a buffer of the right size and call again the function with a buffer
553  of correct size.
554 
555  Parameters:
556  buffer : buffer to be filled with devices descriptors
557  maxize : size in byte of buffer
558  neededsize : size in byte of buffer to pass to this function to get all devices
559  errmsg : a pointer to a buffer of YOCTO_ERRMSG_LEN bytes to store any error message
560 
561  Returns:
562  check the ressult with the YISERR(retcode)
563  on ERROR : error code
564  on SUCCESS : nb of devices descriptors written into buffer
565 
566  Example:
567  char errmsg[YOCTO_ERRMSG_LEN];
568  YAPI_DEVICE *buffer;
569  int nbdev, buffsize;
570  if(yGetAllDevices(NULL,0,&buffsize,errmsg) >= 0) {
571  buffer = (YAPI_DEVICE *)malloc(buffsize);
572  nbdev = yGetAllDevices(buffer,buffsize,&buffsize,errmsg);
573  }
574 
575  ***************************************************************************/
576 int YAPI_FUNCTION_EXPORT yapiGetAllDevices(YAPI_DEVICE *buffer,int maxsize,int *neededsize,char *errmsg);
577 
578 
579 /*****************************************************************************
580  Function:
581  YRETCODE yGetDeviceInfo(YAPI_DEVICE devhdl, yDeviceSt *infos, char *errmsg)
582 
583  Description:
584  Get all information about a single device given by its descriptor,
585  as returned by yGetDevice or yGetAllDevices.
586 
587  Parameters:
588  devdesc: device object returned by yGetDevice or yGetAllDevices
589  errmsg: a pointer to a buffer of YOCTO_ERRMSG_LEN bytes to store any error message
590 
591  Returns:
592  on ERROR : error code
593  on SUCCESS : YAPI_SUCCESS
594 
595  Remarks:
596  the call may fail if the device pointed by devhdl has been disconnected
597 
598  ***************************************************************************/
600 
601 
602 /*****************************************************************************
603  Function:
604  YRETCODE yapiGetDevicePath(YAPI_DEVICE devdesc, char *rootdevice, char *path, int pathsize, int *neededsize, char *errmsg);
605 
606  Description:
607  return the rootdevice and the path to access a device.
608 
609  Parameters:
610  devdesc : device descriptor returned by yapiGetAllDevices or yapiGetDevice
611  rootdevice : a pointer to a buffer of YOCTO_SERIAL_LEN characters for receiving the rootdevice
612  path : a pointer to a buffer of for storing the base path to add to your HTTP request
613  pathtsize : size of the path buffer
614  neededsize : size of the path buffer needed to be complete (may be NULL)
615  errmsg : a pointer to a buffer of YOCTO_ERRMSG_LEN bytes to store any error message
616 
617  Returns:
618  on ERROR : error code
619  on SUCCESS : YAPI_SUCCESS
620 
621  Remarks:
622 
623  ***************************************************************************/
624 
625 YRETCODE YAPI_FUNCTION_EXPORT yapiGetDevicePath(YAPI_DEVICE devdesc, char *rootdevice, char *path, int pathsize, int *neededsize, char *errmsg);
626 
627 
628 /*****************************************************************************
629  Function:
630  YRETCODE yapiGetDevicePathEx(const char * serial, char *rootdevice, char *path, int pathsize, int *neededsize, char *errmsg);
631 
632  Description:
633  return the rootdevice and the path to access a device.
634 
635  Parameters:
636  serila : the serial number of the devcie
637  rootdevice : a pointer to a buffer of YOCTO_SERIAL_LEN characters for receiving the rootdevice
638  path : a pointer to a buffer of for storing the base path to add to your HTTP request
639  pathtsize : size of the path buffer
640  neededsize : size of the path buffer needed to be complete (may be NULL)
641  errmsg : a pointer to a buffer of YOCTO_ERRMSG_LEN bytes to store any error message
642 
643  Returns:
644  on ERROR : error code
645  on SUCCESS : YAPI_SUCCESS
646 
647  Remarks:
648 
649  ***************************************************************************/
650 YRETCODE YAPI_FUNCTION_EXPORT yapiGetDevicePathEx(const char * serial, char *rootdevice, char *request, int requestsize, int *neededsize, char *errmsg);
651 
652 
653 /*****************************************************************************
654  Function:
655  YAPI_FUNCTION yGetFunction(const char *class_str,const char *func_str,char *errmsg)
656 
657  Description:
658  return a function descriptor identifying a function provided by full hardware id,
659  logical name or mixed. The descriptor can later be used with yGetFunctionInfo
660  to retrieve all yellow-page information or to access the function. This function
661  fails if there is no connected device with the requested function identification.
662 
663  Parameters:
664  class_str : string refering to the function class
665  func_str : string refering to a Yocto function (hardware id, logical name, etc.)
666  errmsg : a pointer to a buffer of YOCTO_ERRMSG_LEN bytes to store any error message
667 
668  Returns:
669  check the ressult with the YISERR(retcode)
670  on ERROR : error code
671  on SUCCESS : a valid YAPI_FUNCTION descriptor
672 
673  Example:
674  char errmsg[YOCTO_ERRMSG_LEN];
675  YAPI_FUNCTION myfunction = yGetFunction("functionname");
676  if(myfunction < 0 || yGetFunctionInfo(mydevice, &infos, errmsg) < 0) {
677  // handle error
678  }
679 
680  ***************************************************************************/
681 YAPI_FUNCTION YAPI_FUNCTION_EXPORT yapiGetFunction(const char *class_str, const char *function_str,char *errmsg);
682 
683 
684 /*****************************************************************************
685  Function:
686  int yGetFunctionsByClass(const char *class_str, YAPI_FUNCTION prevfundesc,
687  YAPI_FUNCTION *buffer,int maxsize,int *neededsize,char *errmsg);
688  int yGetFunctionsByDevice(YAPI_DEVICE devdesc, YAPI_FUNCTION prevfundesc,
689  YAPI_FUNCTION *buffer,int maxsize,int *neededsize,char *errmsg);
690 
691  Description:
692  fill buffer with function descriptors that can be used to access functions.
693  If buffer == NULL the function will only set neededsize so that the caller can
694  allocate a buffer of the right size and call again the function with a buffer
695  of correct size.
696 
697  Parameters:
698  class_str : string referring to the function class
699  or
700  devdesc : device descriptor returned by yGetDevice or yGetAllDevices
701  prevfundesc: 0 when calling for the first time, or last function descriptor previously received
702  buffer : buffer to be filled with function descriptors
703  maxize : size in byte of buffer
704  neededsize : size in byte of buffer to pass to this function to get all functions
705  errmsg : a pointer to a buffer of YOCTO_ERRMSG_LEN bytes to store any error message
706 
707  Returns:
708  check the result with the YISERR(retcode)
709  on ERROR : error code
710  on SUCCESS : nb of function descriptors written into buffer
711 
712  Example:
713  char errmsg[YOCTO_ERRMSG_LEN];
714  YAPI_FUNCTION *buffer;
715  int nbfunc, buffsize;
716  if(yGetFunctionsByClass("Relay",0,NULL,0,&buffsize,errmsg) >= 0) {
717  buffer = (YAPI_FUNCTION *)malloc(buffsize);
718  nbfunc = yGetFunctionsByClass("Relay",0,buffer,buffsize,&buffsize,errmsg);
719  }
720 
721  ***************************************************************************/
722 int YAPI_FUNCTION_EXPORT yapiGetFunctionsByClass(const char *class_str, YAPI_FUNCTION prevfundesc,
723  YAPI_FUNCTION *buffer,int maxsize,int *neededsize,char *errmsg);
725  YAPI_FUNCTION *buffer,int maxsize,int *neededsize,char *errmsg);
726 
727 
728 /*****************************************************************************
729  Function:
730  YRETCODE yGetFunctionInfo(YAPI_FUNCTION fundesc,YAPI_DEVICE *devdesc,char *serial,char *funcId,char *funcName,char *funcVal,char *errmsg)
731 
732  Description:
733  Get all yellow-page information about a single function given by its descriptor,
734  as returned by yGetFunction, yGetFunctionsByClass or yGetFunctionsByDevice.
735 
736  Parameters:
737  fundesc : function descriptor returned by yGetFunction or yGetFunctionsByXXX
738  devdesc : a pointer to a device descriptor to be filled with the device hosting the function
739  serial : a pointer to a buffer of YOCTO_SERIAL_LEN characters, or NULL
740  funcId : a pointer to a buffer of YOCTO_FUNCTION_LEN characters, or NULL
741  funcName: a pointer to a buffer of YOCTO_LOGICAL_LEN characters, or NULL
742  funcVal : a pointer to a buffer of 7 characters, or NULL
743  errmsg : a pointer to a buffer of YOCTO_ERRMSG_LEN bytes to store any error message
744 
745  Returns:
746  on ERROR : error code
747  on SUCCESS : YAPI_SUCCESS
748 
749  Remarks:
750 
751  ***************************************************************************/
752 YRETCODE YAPI_FUNCTION_EXPORT yapiGetFunctionInfo(YAPI_FUNCTION fundesc,YAPI_DEVICE *devdesc,char *serial,char *funcId,char *funcName,char *funcVal,char *errmsg);
753 
754 /*****************************************************************************
755  Function:
756  YRETCODE yGetFunctionInfo(YAPI_FUNCTION fundesc,YAPI_DEVICE *devdesc,char *serial,char *funcId,char *funcName,char *funcVal,char *errmsg)
757 
758  Description:
759  Get all yellow-page information about a single function given by its descriptor,
760  as returned by yGetFunction, yGetFunctionsByClass or yGetFunctionsByDevice.
761 
762  Parameters:
763  fundesc : function descriptor returned by yGetFunction or yGetFunctionsByXXX
764  devdesc : a pointer to a device descriptor to be filled with the device hosting the function
765  serial : a pointer to a buffer of YOCTO_SERIAL_LEN characters, or NULL
766  funcId : a pointer to a buffer of YOCTO_FUNCTION_LEN characters, or NULL
767  baseType: a pointer to a buffer of YOCTO_FUNCTION_LEN characters, or NULL
768  funcName: a pointer to a buffer of YOCTO_LOGICAL_LEN characters, or NULL
769  funcVal : a pointer to a buffer of 7 characters, or NULL
770  errmsg : a pointer to a buffer of YOCTO_ERRMSG_LEN bytes to store any error message
771 
772  Returns:
773  on ERROR : error code
774  on SUCCESS : YAPI_SUCCESS
775 
776  Remarks:
777 
778  ***************************************************************************/
779 YRETCODE YAPI_FUNCTION_EXPORT yapiGetFunctionInfoEx(YAPI_FUNCTION fundesc, YAPI_DEVICE *devdesc, char *serial, char *funcId, char *baseType, char *funcName, char *funcVal, char *errmsg);
780 
781 
782  /*****************************************************************************
783  Function:
784  int yapiHTTPRequestSyncStartEx(YIOHDL *iohdl, const char *device, const char *request, int requestsize, char **reply, int *replysize, char *errmsg);
785 
786  Description:
787  Open a HTTP request to a given device, send a query and receive the HTTP header and
788  page content into the buffer. The buffer with result will be returned by reference,
789  so that the caller can use it or copy it. Do not free reply buffer manually, but
790  always call yapiHTTPRequestSyncDone when finished.
791 
792  Parameters:
793  iohdl : the request handle that will be initialized
794  device : a string that contain one of the flowing value: serial, logicalname, url
795  request : the HTTP request (HTTP header + body, in case of POST) of the page/file to retreive
796  requestsize: the length of the HTTP request
797  reply : a pointer to the reply buffer, returned by reference
798  replysize : the length of the reply buffer, returned by reference
799  errmsg : a pointer to a buffer of YOCTO_ERRMSG_LEN bytes to store any error message
800 
801  Returns:
802  on SUCCESS : YAPI_SUCCESS
803  on ERROR : return the YRETCODE
804 
805  ***************************************************************************/
806 YRETCODE YAPI_FUNCTION_EXPORT yapiHTTPRequestSyncStartEx(YIOHDL *iohdl, const char *device, const char *request, int requestsize, char **reply, int *replysize, char *errmsg);
807 
808 /*****************************************************************************
809 Function:
810 int yapiHTTPRequestSyncStartOutOfBand(YIOHDL *iohdl, const char *device, const char *request, int requestsize, char **reply, int *replysize, yapiRequestProgressCallback progress_cb, void *progress_ctx, char *errmsg);
811 
812 Description:
813 Open a HTTP request to a given device, send a query and receive the HTTP header and
814 page content into the buffer. The buffer with result will be returned by reference,
815 so that the caller can use it or copy it. Do not free reply buffer manually, but
816 always call yapiHTTPRequestSyncDone when finished.
817 
818 Parameters:
819 iohdl : the request handle that will be initialized
820 channel : channel to use for the request
821 device : a string that contain one of the flowing value: serial, logicalname, url
822 request : the HTTP request (HTTP header + body, in case of POST) of the page/file to retreive
823 requestsize : the length of the HTTP request
824 reply : a pointer to the reply buffer, returned by reference
825 replysize : the length of the reply buffer, returned by reference
826 progress_cb : a callback that is called to report progress
827 progress_ctx : context passed to progress_cb
828 errmsg : a pointer to a buffer of YOCTO_ERRMSG_LEN bytes to store any error message
829 
830 Returns:
831 on SUCCESS : YAPI_SUCCESS
832 on ERROR : return the YRETCODE
833 
834 ***************************************************************************/
835 YRETCODE YAPI_FUNCTION_EXPORT yapiHTTPRequestSyncStartOutOfBand(YIOHDL *iohdl, int channel, const char *device, const char *request, int requestsize, char **reply, int *replysize, yapiRequestProgressCallback progress_cb, void *progress_ctx, char *errmsg);
836 
837 
838 /*****************************************************************************
839  Function:
840  int yapiHTTPRequestSyncStart(YIOHDL *iohdl, const char *device, const char *request, char **reply, int *replysize, char *errmsg);
841 
842  Description:
843  Open a HTTP request to a given device, send a query and receive the HTTP header and
844  page content into the buffer. The buffer with result will be returned by reference,
845  so that the caller can use it or copy it. Do not free reply buffer manually, but
846  always call yapiHTTPRequestSyncDone when finished.
847 
848  Parameters:
849  iohdl : the request handle that will be initialized
850  device : a string that contain one of the flowing value: serial, logicalname, url
851  request : the HTTP request (HTTP header) of the page/file to retreive
852  reply : a pointer to the reply buffer, returned by reference
853  replysize : the length of the reply buffer, returned by reference
854  errmsg : a pointer to a buffer of YOCTO_ERRMSG_LEN bytes to store any error message
855 
856  Returns:
857  on SUCCESS : YAPI_SUCCESS
858  on ERROR : return the YRETCODE
859 
860  ***************************************************************************/
861 YRETCODE YAPI_FUNCTION_EXPORT yapiHTTPRequestSyncStart(YIOHDL *iohdl, const char *device, const char *request, char **reply, int *replysize, char *errmsg);
862 
863 
864 /*****************************************************************************
865  Function:
866  int yapiHTTPRequestSyncDone(YIOHDL *iohdl, char *errmsg)
867 
868  Description:
869  Terminate a call to yapiHTTPRequestSyncStart and free corresponding ressources.
870  No other request can take place to the device until this function is called.
871 
872  Parameters:
873  iohdl : the request handle returned by yapiHTTPRequestSyncStart
874  errmsg : a pointer to a buffer of YOCTO_ERRMSG_LEN bytes to store any error message
875 
876  Returns:
877  on SUCCESS : YAPI_SUCCESS
878  on ERROR : return the YRETCODE
879 
880  ***************************************************************************/
882 
883 
884 /*****************************************************************************
885  Function:
886  YRETCODE yapiHTTPRequestAsync(const char *device, const char *request, yapiRequestAsyncCallback callback, void *context, char *errmsg);
887 
888  Description:
889  Execute a HTTP request to a given device, and leave it to the API to complete the request.
890 
891  Parameters:
892  device : a string that contain one of the flowing value: serial, logicalname, url
893  request : the HTTP request (HTTP hreader) of the page/file to retreive
894  callback : RESERVED FOR FUTURE USE
895  context : RESERVED FOR FUTURE USE
896  errmsg : a pointer to a buffer of YOCTO_ERRMSG_LEN bytes to store any error message
897 
898  Returns:
899  on ERROR : an error code
900  on SUCCESS : YAPI_SUCCESS
901 
902  Remarks:
903  we match the device string in this order: serial,logicalname,url
904 
905  ***************************************************************************/
906 YRETCODE YAPI_FUNCTION_EXPORT yapiHTTPRequestAsync(const char *device, const char *request, yapiRequestAsyncCallback callback, void *context, char *errmsg);
907 
908 /*****************************************************************************
909  Function:
910  YRETCODE yapiHTTPRequestAsync(const char *device, const char *request, yapiRequestAsyncCallback callback, void *context, char *errmsg);
911 
912  Description:
913  Execute a HTTP request to a given device, and leave it to the API to complete the request.
914 
915  Parameters:
916  device : a string that contain one of the flowing value: serial, logicalname, url
917  request : the HTTP request (HTTP header + body, in case of POST) of the page/file to retreive
918  requestsize: the length of the HTTP request
919  callback : RESERVED FOR FUTURE USE
920  context : RESERVED FOR FUTURE USE
921  errmsg : a pointer to a buffer of YOCTO_ERRMSG_LEN bytes to store any error message
922 
923  Returns:
924  on ERROR : an error code
925  on SUCCESS : YAPI_SUCCESS
926 
927  Remarks:
928  we match the device string in this order: serial,logicalname,url
929 
930  ***************************************************************************/
931 YRETCODE YAPI_FUNCTION_EXPORT yapiHTTPRequestAsyncEx(const char *device, const char *request, int requestsize, yapiRequestAsyncCallback callback, void *context, char *errmsg);
932 
933 
934 /*****************************************************************************
935 Function:
936 YRETCODE yapiHTTPRequestAsync(const char *device, const char *request, yapiRequestAsyncCallback callback, void *context, char *errmsg);
937 
938 Description:
939 Execute a HTTP request to a given device, and leave it to the API to complete the request.
940 
941 Parameters:
942 channel : channel to use for the request
943 device : a string that contain one of the flowing value: serial, logicalname, url
944 request : the HTTP request (HTTP header + body, in case of POST) of the page/file to retreive
945 requestsize: the length of the HTTP request
946 callback : RESERVED FOR FUTURE USE
947 context : RESERVED FOR FUTURE USE
948 errmsg : a pointer to a buffer of YOCTO_ERRMSG_LEN bytes to store any error message
949 
950 Returns:
951 on ERROR : an error code
952 on SUCCESS : YAPI_SUCCESS
953 
954 Remarks:
955 we match the device string in this order: serial,logicalname,url
956 
957 ***************************************************************************/
958 YRETCODE YAPI_FUNCTION_EXPORT yapiHTTPRequestAsyncOutOfBand(int channel, const char *device, const char *request, int requestsize, yapiRequestAsyncCallback callback, void *context, char *errmsg);
959 
960 
961 
962 
963 /*****************************************************************************
964  Function:
965  int yHTTPRequest(char *device,char *request, char* buffer,int buffsize,int *fullsize,char *errmsg)
966 
967  Description:
968  Open a HTTP request to a given device, send a query and receive the HTTP header and
969  page content into the buffer. If the content is bigger than buffsize, buffer will contain
970  no more than buffsize. If not NULL fullsize will be updated with the size of the full content.
971 
972  Parameters:
973  device : a string that contain one of the flowing value: serial, logicalname, url
974  request : the HTTP request (HTTP hreader) of the page/file to retreive
975  buffer : a buffer to fill with result
976  buffsize : the size of the buffer
977  fullsize : (optional) an integer to update with the full size of the data
978  errmsg : a pointer to a buffer of YOCTO_ERRMSG_LEN bytes to store any error message
979 
980  Returns:
981  check the result with the YISERR(retcode)
982  on SUCCESS : return the number of byte written into buffer (excluding the terminating '\0' character)
983  on ERROR : return the YRETCODE
984 
985  Remarks:
986  we always null terminate the returning buffer
987 
988  ***************************************************************************/
989 int YAPI_FUNCTION_EXPORT yapiHTTPRequest(const char *device, const char *request, char* buffer,int buffsize,int *fullsize, char *errmsg);
990 
991 /*****************************************************************************
992  Function:
993  void yapiRegisterHubDiscoveryCallback(yapiHubDiscoveryCallback hubDiscoveryCallback);
994 
995  Description:
996  register a callback function that will be called on every network hub (or VirtualHub)
997  that send an SSDP annouce or respond to a SSDP search
998 
999  Parameters:
1000  hubDiscoveryCallback : the function to call when an network hub his detected by ssdp or null to
1001  unregister the prĂ©vious callback
1002 
1003  Returns:
1004 
1005  Remarks:
1006 
1007  ***************************************************************************/
1009 
1010 /*****************************************************************************
1011  Function:
1012  YRETCODE YAPI_FUNCTION_EXPORT yapiTriggerHubDiscovery(char *errmsg);
1013 
1014  Description:
1015  Send an SSDP Msearch Request to force all online hub to annouce itself again.
1016 
1017  Parameters:
1018  errmsg : a pointer to a buffer of YOCTO_ERRMSG_LEN bytes to store any error message
1019 
1020  Returns:
1021  check the result with the YISERR(retcode)
1022  on ERROR : return the YRETCODE
1023 
1024  Remarks:
1025 
1026  ***************************************************************************/
1028 
1029 
1030 
1031 YRETCODE YAPI_FUNCTION_EXPORT yapiGetSubdevices(const char *serial, char *buffer, int buffersize, int *fullsize, char *errmsg);
1032 
1033 /*****************************************************************************
1034  Flash API
1035  ***************************************************************************/
1036 
1037 YRETCODE YAPI_FUNCTION_EXPORT yapiGetAllJsonKeys(const char *jsonbuffer, char *out_buffer, int out_buffersize, int *fullsize, char *errmsg);
1038 YRETCODE YAPI_FUNCTION_EXPORT yapiCheckFirmware(const char *serial, const char *rev, const char *path, char *buffer, int buffersize, int *fullsize, char *errmsg);
1039 YRETCODE YAPI_FUNCTION_EXPORT yapiGetBootloaders(char *buffer, int buffersize, int *fullsize, char *errmsg);
1040 YRETCODE YAPI_FUNCTION_EXPORT yapiUpdateFirmware(const char *serial, const char *firmwarePath, const char *settings, int startUpdate, char *errmsg);
1041 YRETCODE YAPI_FUNCTION_EXPORT yapiUpdateFirmwareEx(const char *serial, const char *firmwarePath, const char *settings, int force, int startUpdate, char *errmsg);
1042 
1043 int YAPI_FUNCTION_EXPORT yapiJsonDecodeString(const char *json_string, char *output);
1044 int YAPI_FUNCTION_EXPORT yapiJsonGetPath(const char *path, const char *json_data, int json_size, const char **result, char *errmsg);
1045 
1046 
1047 /*****************************************************************************
1048  helper for delphi
1049  ***************************************************************************/
1050 YAPI_FUNCTION_EXPORT void* yapiGetMem(int size);
1051 YAPI_FUNCTION_EXPORT void yapiFreeMem(void *ptr);
1052 
1053 
1055 typedef void (*yRawReportCb)(YAPI_DEVICE serialref, USB_Report_Pkt_V1 *report, int pktsize);
1056 typedef void (*yRawReportV2Cb)(YAPI_DEVICE serialref, USB_Report_Pkt_V2 *report, int pktsize);
1058 void yapiRegisterRawReportCb(yRawReportCb callback);
1060 
1061 
1062 
1063 
1064 #ifdef __cplusplus
1065 }
1066 #endif
1067 #endif
1068 
1069 
void yapiRegisterRawNotificationCb(yRawNotificationCb callback)
Definition: yapi.c:4093
void YAPI_FUNCTION_EXPORT yapiFreeAPI(void)
Definition: yapi.c:4304
int YAPI_FUNCTION_EXPORT yapiGetFunctionsByDevice(YAPI_DEVICE devdesc, YAPI_FUNCTION prevfundesc, YAPI_FUNCTION *buffer, int maxsize, int *neededsize, char *errmsg)
Definition: yapi.c:4552
YRETCODE YAPI_FUNCTION_EXPORT yapiGetDevicePathEx(const char *serial, char *rootdevice, char *request, int requestsize, int *neededsize, char *errmsg)
Definition: yapi.c:4524
YRETCODE YAPI_FUNCTION_EXPORT yapiTriggerHubDiscovery(char *errmsg)
Definition: yapi.c:4664
YAPI_FUNCTION YAPI_FUNCTION_EXPORT yapiGetFunction(const char *class_str, const char *function_str, char *errmsg)
Definition: yapi.c:4533
void YAPI_FUNCTION_EXPORT(* yapiDeviceUpdateCallback)(YAPI_DEVICE devdescr)
Definition: yapi.h:68
YRETCODE YAPI_FUNCTION_EXPORT yapiGetDeviceInfo(YAPI_DEVICE devdesc, yDeviceSt *infos, char *errmsg)
Definition: yapi.c:4506
void YAPI_FUNCTION_EXPORT yapiRegisterFunctionUpdateCallback(yapiFunctionUpdateCallback updateCallback)
Definition: yapi.c:4353
u16 YAPI_FUNCTION_EXPORT yapiGetAPIVersion(const char **version, const char **apidate)
Definition: yapi.c:4472
YRETCODE YAPI_FUNCTION_EXPORT yapiGetFunctionInfo(YAPI_FUNCTION fundesc, YAPI_DEVICE *devdesc, char *serial, char *funcId, char *funcName, char *funcVal, char *errmsg)
Definition: yapi.c:4562
void * YIOHDL
Definition: ydef.h:260
YRETCODE YAPI_FUNCTION_EXPORT yapiGetDevicePath(YAPI_DEVICE devdesc, char *rootdevice, char *path, int pathsize, int *neededsize, char *errmsg)
Definition: yapi.c:4515
YRETCODE YAPI_FUNCTION_EXPORT yapiHTTPRequestAsyncEx(const char *device, const char *request, int requestsize, yapiRequestAsyncCallback callback, void *context, char *errmsg)
Definition: yapi.c:4620
s32 YAPI_FUNCTION
Definition: ydef.h:217
YRETCODE YAPI_FUNCTION_EXPORT yapiSleep(int duration_ms, char *errmsg)
Definition: yapi.c:4455
YRETCODE YAPI_FUNCTION_EXPORT yapiUpdateFirmware(const char *serial, const char *firmwarePath, const char *settings, int startUpdate, char *errmsg)
Definition: yapi.c:4739
YRETCODE YAPI_FUNCTION_EXPORT yapiUnlockFunctionCallBack(char *errmsg)
Definition: yapi.c:4376
YRETCODE YAPI_FUNCTION_EXPORT yapiLockFunctionCallBack(char *errmsg)
Definition: yapi.c:4367
YRETCODE YAPI_FUNCTION_EXPORT yapiTestHub(const char *rooturl, int mstimeout, char *errmsg)
Definition: yapi.c:4403
int YAPI_FUNCTION_EXPORT yapiGetAllDevices(YAPI_DEVICE *buffer, int maxsize, int *neededsize, char *errmsg)
Definition: yapi.c:4497
void(* yapiRequestProgressCallback)(void *context, u32 acked, u32 totalbytes)
Definition: ydef.h:866
YRETCODE YAPI_FUNCTION_EXPORT yapiHTTPRequestSyncStartEx(YIOHDL *iohdl, const char *device, const char *request, int requestsize, char **reply, int *replysize, char *errmsg)
Definition: yapi.c:4582
YRETCODE YAPI_FUNCTION_EXPORT yapiUpdateDeviceList(u32 forceupdate, char *errmsg)
Definition: yapi.c:4437
YRETCODE YAPI_FUNCTION_EXPORT yapiGetFunctionInfoEx(YAPI_FUNCTION fundesc, YAPI_DEVICE *devdesc, char *serial, char *funcId, char *baseType, char *funcName, char *funcVal, char *errmsg)
Definition: yapi.c:4572
int YAPI_FUNCTION_EXPORT yapiHTTPRequest(const char *device, const char *request, char *buffer, int buffsize, int *fullsize, char *errmsg)
Definition: yapi.c:4648
YRETCODE YAPI_FUNCTION_EXPORT yapiUnlockDeviceCallBack(char *errmsg)
Definition: yapi.c:4394
void YAPI_FUNCTION_EXPORT yapiRegisterLogFunction(yapiLogFunction logfun)
Definition: yapi.c:4311
void yapiRegisterRawReportV2Cb(yRawReportV2Cb callback)
Definition: yapi.c:4113
void YAPI_FUNCTION_EXPORT yapiStartStopDeviceLogCallback(const char *serial, int start)
Definition: yapi.c:4325
int YAPI_FUNCTION_EXPORT yapiGetFunctionsByClass(const char *class_str, YAPI_FUNCTION prevfundesc, YAPI_FUNCTION *buffer, int maxsize, int *neededsize, char *errmsg)
Definition: yapi.c:4542
YRETCODE
Definition: ydef.h:376
YRETCODE YAPI_FUNCTION_EXPORT yapiHTTPRequestSyncDone(YIOHDL *iohdl, char *errmsg)
Definition: yapi.c:4611
YRETCODE YAPI_FUNCTION_EXPORT yapiHTTPRequestSyncStartOutOfBand(YIOHDL *iohdl, int channel, const char *device, const char *request, int requestsize, char **reply, int *replysize, yapiRequestProgressCallback progress_cb, void *progress_ctx, char *errmsg)
Definition: yapi.c:4601
void YAPI_FUNCTION_EXPORT yapiRegisterDeviceLogCallback(yapiDeviceLogCallback logCallback)
Definition: yapi.c:4318
u64 YAPI_FUNCTION_EXPORT yapiGetTickCount(void)
Definition: yapi.c:2713
void YAPI_FUNCTION_EXPORT(* yapiTimedReportCallback)(YAPI_FUNCTION fundesc, double timestamp, const u8 *bytes, u32 len)
Definition: yapi.h:78
void YAPI_FUNCTION_EXPORT(* yapiFunctionUpdateCallback)(YAPI_FUNCTION fundescr, const char *value)
Definition: yapi.h:75
void YAPI_FUNCTION_EXPORT yapiRegisterDeviceChangeCallback(yapiDeviceUpdateCallback changeCallback)
Definition: yapi.c:4346
YRETCODE YAPI_FUNCTION_EXPORT yapiPreregisterHub(const char *rooturl, char *errmsg)
Definition: yapi.c:4421
int YAPI_FUNCTION_EXPORT yapiJsonDecodeString(const char *json_string, char *output)
Definition: yapi.c:4683
void(* yRawNotificationCb)(USB_Notify_Pkt *)
Definition: yapi.h:1054
YRETCODE YAPI_FUNCTION_EXPORT yapiUpdateFirmwareEx(const char *serial, const char *firmwarePath, const char *settings, int force, int startUpdate, char *errmsg)
Definition: yapi.c:4748
void(* yRawReportV2Cb)(YAPI_DEVICE serialref, USB_Report_Pkt_V2 *report, int pktsize)
Definition: yapi.h:1056
YRETCODE YAPI_FUNCTION_EXPORT yapiGetBootloaders(char *buffer, int buffersize, int *fullsize, char *errmsg)
Definition: yapi.c:4673
void YAPI_FUNCTION_EXPORT yapiRegisterDeviceArrivalCallback(yapiDeviceUpdateCallback arrivalCallback)
Definition: yapi.c:4332
#define YAPI_FUNCTION_EXPORT
Definition: yapi.h:52
void YAPI_FUNCTION_EXPORT yapiRegisterHubDiscoveryCallback(yapiHubDiscoveryCallback hubDiscoveryCallback)
Definition: yapi.c:4657
void(* yapiRequestAsyncCallback)(void *context, const u8 *result, u32 resultlen, int retcode, const char *errmsg)
Definition: ydef.h:864
YAPI_FUNCTION_EXPORT void * yapiGetMem(int size)
Definition: yapi.c:4715
YAPI_FUNCTION_EXPORT void yapiFreeMem(void *ptr)
Definition: yapi.c:4724
void(* yRawReportCb)(YAPI_DEVICE serialref, USB_Report_Pkt_V1 *report, int pktsize)
Definition: yapi.h:1055
void YAPI_FUNCTION_EXPORT yapiRegisterTimedReportCallback(yapiTimedReportCallback timedReportCallback)
Definition: yapi.c:4360
int YAPI_FUNCTION_EXPORT yapiJsonGetPath(const char *path, const char *json_data, int json_size, const char **result, char *errmsg)
Definition: yapi.c:4691
void YAPI_FUNCTION_EXPORT yapiUnregisterHub(const char *url)
Definition: yapi.c:4430
YRETCODE YAPI_FUNCTION_EXPORT yapiInitAPI(int type, char *errmsg)
Definition: yapi.c:4295
void YAPI_FUNCTION_EXPORT(* yapiDeviceLogCallback)(YAPI_FUNCTION fundescr, const char *line)
Definition: yapi.h:83
YRETCODE YAPI_FUNCTION_EXPORT yapiGetSubdevices(const char *serial, char *buffer, int buffersize, int *fullsize, char *errmsg)
Definition: yapi.c:4758
void YAPI_FUNCTION_EXPORT(* yapiLogFunction)(const char *log, u32 loglen)
Definition: yapi.h:65
YRETCODE YAPI_FUNCTION_EXPORT yapiLockDeviceCallBack(char *errmsg)
Definition: yapi.c:4385
YRETCODE YAPI_FUNCTION_EXPORT yapiHTTPRequestSyncStart(YIOHDL *iohdl, const char *device, const char *request, char **reply, int *replysize, char *errmsg)
Definition: yapi.c:4591
YRETCODE YAPI_FUNCTION_EXPORT yapiGetAllJsonKeys(const char *jsonbuffer, char *out_buffer, int out_buffersize, int *fullsize, char *errmsg)
Definition: yapi.c:4706
YRETCODE YAPI_FUNCTION_EXPORT yapiHandleEvents(char *errmsg)
Definition: yapi.c:4446
YRETCODE YAPI_FUNCTION_EXPORT yapiRegisterHub(const char *rooturl, char *errmsg)
Definition: yapi.c:4412
YRETCODE YAPI_FUNCTION_EXPORT yapiHTTPRequestAsyncOutOfBand(int channel, const char *device, const char *request, int requestsize, yapiRequestAsyncCallback callback, void *context, char *errmsg)
Definition: yapi.c:4638
s32 YAPI_DEVICE
Definition: ydef.h:216
void YAPI_FUNCTION_EXPORT(* yapiHubDiscoveryCallback)(const char *serial, const char *url)
Definition: yapi.h:81
YRETCODE YAPI_FUNCTION_EXPORT yapiCheckFirmware(const char *serial, const char *rev, const char *path, char *buffer, int buffersize, int *fullsize, char *errmsg)
Definition: yapi.c:4730
YAPI_DEVICE YAPI_FUNCTION_EXPORT yapiGetDevice(const char *device_str, char *errmsg)
Definition: yapi.c:4488
int YAPI_FUNCTION_EXPORT yapiCheckLogicalName(const char *name)
Definition: yapi.c:4464
void yapiRegisterRawReportCb(yRawReportCb callback)
Definition: yapi.c:4103
void YAPI_FUNCTION_EXPORT yapiRegisterDeviceRemovalCallback(yapiDeviceUpdateCallback removalCallback)
Definition: yapi.c:4339
YRETCODE YAPI_FUNCTION_EXPORT yapiHTTPRequestAsync(const char *device, const char *request, yapiRequestAsyncCallback callback, void *context, char *errmsg)
Definition: yapi.c:4629
void YAPI_FUNCTION_EXPORT yapiSetTraceFile(const char *file)
Definition: yapi.c:4481


yoctopuce_altimeter
Author(s): Anja Sheppard
autogenerated on Mon Jun 10 2019 15:49:10