#include "ydef.h"
Go to the source code of this file.
Macros | |
#define | Y_DEFAULT_PKT_RESEND_DELAY 50 |
#define | Y_DETECT_ALL (Y_DETECT_USB | Y_DETECT_NET) |
#define | Y_DETECT_NET 2 |
#define | Y_DETECT_NONE 0 |
#define | Y_DETECT_USB 1 |
#define | Y_RESEND_MISSING_PKT 4 |
#define | YAPI_BLOCKING_NET_REQUEST_TIMEOUT 30000 |
#define | YAPI_BLOCKING_USBOPEN_REQUEST_TIMEOUT 2000 |
#define | YAPI_BLOCKING_USBREAD_REQUEST_TIMEOUT 8000 |
#define | YAPI_FUNCTION_EXPORT |
Typedefs | |
typedef void YAPI_FUNCTION_EXPORT(* | yapiDeviceLogCallback) (YAPI_FUNCTION fundescr, const char *line) |
typedef void YAPI_FUNCTION_EXPORT(* | yapiDeviceUpdateCallback) (YAPI_DEVICE devdescr) |
typedef void YAPI_FUNCTION_EXPORT(* | yapiFunctionUpdateCallback) (YAPI_FUNCTION fundescr, const char *value) |
typedef void YAPI_FUNCTION_EXPORT(* | yapiHubDiscoveryCallback) (const char *serial, const char *url) |
typedef void YAPI_FUNCTION_EXPORT(* | yapiLogFunction) (const char *log, u32 loglen) |
typedef void YAPI_FUNCTION_EXPORT(* | yapiTimedReportCallback) (YAPI_FUNCTION fundesc, double timestamp, const u8 *bytes, u32 len) |
typedef void(* | yRawNotificationCb) (USB_Notify_Pkt *) |
typedef void(* | yRawReportCb) (YAPI_DEVICE serialref, USB_Report_Pkt_V1 *report, int pktsize) |
typedef void(* | yRawReportV2Cb) (YAPI_DEVICE serialref, USB_Report_Pkt_V2 *report, int pktsize) |
Functions | |
YRETCODE YAPI_FUNCTION_EXPORT | yapiCheckFirmware (const char *serial, const char *rev, const char *path, char *buffer, int buffersize, int *fullsize, char *errmsg) |
int YAPI_FUNCTION_EXPORT | yapiCheckLogicalName (const char *name) |
void YAPI_FUNCTION_EXPORT | yapiFreeAPI (void) |
YAPI_FUNCTION_EXPORT void | yapiFreeMem (void *ptr) |
int YAPI_FUNCTION_EXPORT | yapiGetAllDevices (YAPI_DEVICE *buffer, int maxsize, int *neededsize, char *errmsg) |
YRETCODE YAPI_FUNCTION_EXPORT | yapiGetAllJsonKeys (const char *jsonbuffer, char *out_buffer, int out_buffersize, int *fullsize, char *errmsg) |
u16 YAPI_FUNCTION_EXPORT | yapiGetAPIVersion (const char **version, const char **apidate) |
YRETCODE YAPI_FUNCTION_EXPORT | yapiGetBootloaders (char *buffer, int buffersize, int *fullsize, char *errmsg) |
YAPI_DEVICE YAPI_FUNCTION_EXPORT | yapiGetDevice (const char *device_str, char *errmsg) |
YRETCODE YAPI_FUNCTION_EXPORT | yapiGetDeviceInfo (YAPI_DEVICE devdesc, yDeviceSt *infos, char *errmsg) |
YRETCODE YAPI_FUNCTION_EXPORT | yapiGetDevicePath (YAPI_DEVICE devdesc, char *rootdevice, char *path, int pathsize, int *neededsize, char *errmsg) |
YRETCODE YAPI_FUNCTION_EXPORT | yapiGetDevicePathEx (const char *serial, char *rootdevice, char *request, int requestsize, int *neededsize, char *errmsg) |
YAPI_FUNCTION YAPI_FUNCTION_EXPORT | yapiGetFunction (const char *class_str, const char *function_str, char *errmsg) |
YRETCODE YAPI_FUNCTION_EXPORT | yapiGetFunctionInfo (YAPI_FUNCTION fundesc, YAPI_DEVICE *devdesc, char *serial, char *funcId, char *funcName, char *funcVal, char *errmsg) |
YRETCODE YAPI_FUNCTION_EXPORT | yapiGetFunctionInfoEx (YAPI_FUNCTION fundesc, YAPI_DEVICE *devdesc, char *serial, char *funcId, char *baseType, char *funcName, char *funcVal, char *errmsg) |
int YAPI_FUNCTION_EXPORT | yapiGetFunctionsByClass (const char *class_str, YAPI_FUNCTION prevfundesc, YAPI_FUNCTION *buffer, int maxsize, int *neededsize, char *errmsg) |
int YAPI_FUNCTION_EXPORT | yapiGetFunctionsByDevice (YAPI_DEVICE devdesc, YAPI_FUNCTION prevfundesc, YAPI_FUNCTION *buffer, int maxsize, int *neededsize, char *errmsg) |
YAPI_FUNCTION_EXPORT void * | yapiGetMem (int size) |
YRETCODE YAPI_FUNCTION_EXPORT | yapiGetSubdevices (const char *serial, char *buffer, int buffersize, int *fullsize, char *errmsg) |
u64 YAPI_FUNCTION_EXPORT | yapiGetTickCount (void) |
YRETCODE YAPI_FUNCTION_EXPORT | yapiHandleEvents (char *errmsg) |
int YAPI_FUNCTION_EXPORT | yapiHTTPRequest (const char *device, const char *request, char *buffer, int buffsize, int *fullsize, char *errmsg) |
YRETCODE YAPI_FUNCTION_EXPORT | yapiHTTPRequestAsync (const char *device, const char *request, yapiRequestAsyncCallback callback, void *context, char *errmsg) |
YRETCODE YAPI_FUNCTION_EXPORT | yapiHTTPRequestAsyncEx (const char *device, const char *request, int requestsize, yapiRequestAsyncCallback callback, void *context, char *errmsg) |
YRETCODE YAPI_FUNCTION_EXPORT | yapiHTTPRequestAsyncOutOfBand (int channel, const char *device, const char *request, int requestsize, yapiRequestAsyncCallback callback, void *context, char *errmsg) |
YRETCODE YAPI_FUNCTION_EXPORT | yapiHTTPRequestSyncDone (YIOHDL *iohdl, char *errmsg) |
YRETCODE YAPI_FUNCTION_EXPORT | yapiHTTPRequestSyncStart (YIOHDL *iohdl, const char *device, const char *request, char **reply, int *replysize, char *errmsg) |
YRETCODE YAPI_FUNCTION_EXPORT | yapiHTTPRequestSyncStartEx (YIOHDL *iohdl, const char *device, const char *request, int requestsize, char **reply, int *replysize, char *errmsg) |
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) |
YRETCODE YAPI_FUNCTION_EXPORT | yapiInitAPI (int type, char *errmsg) |
int YAPI_FUNCTION_EXPORT | yapiJsonDecodeString (const char *json_string, char *output) |
int YAPI_FUNCTION_EXPORT | yapiJsonGetPath (const char *path, const char *json_data, int json_size, const char **result, char *errmsg) |
YRETCODE YAPI_FUNCTION_EXPORT | yapiLockDeviceCallBack (char *errmsg) |
YRETCODE YAPI_FUNCTION_EXPORT | yapiLockFunctionCallBack (char *errmsg) |
YRETCODE YAPI_FUNCTION_EXPORT | yapiPreregisterHub (const char *rooturl, char *errmsg) |
void YAPI_FUNCTION_EXPORT | yapiRegisterDeviceArrivalCallback (yapiDeviceUpdateCallback arrivalCallback) |
void YAPI_FUNCTION_EXPORT | yapiRegisterDeviceChangeCallback (yapiDeviceUpdateCallback changeCallback) |
void YAPI_FUNCTION_EXPORT | yapiRegisterDeviceLogCallback (yapiDeviceLogCallback logCallback) |
void YAPI_FUNCTION_EXPORT | yapiRegisterDeviceRemovalCallback (yapiDeviceUpdateCallback removalCallback) |
void YAPI_FUNCTION_EXPORT | yapiRegisterFunctionUpdateCallback (yapiFunctionUpdateCallback updateCallback) |
YRETCODE YAPI_FUNCTION_EXPORT | yapiRegisterHub (const char *rooturl, char *errmsg) |
void YAPI_FUNCTION_EXPORT | yapiRegisterHubDiscoveryCallback (yapiHubDiscoveryCallback hubDiscoveryCallback) |
void YAPI_FUNCTION_EXPORT | yapiRegisterLogFunction (yapiLogFunction logfun) |
void | yapiRegisterRawNotificationCb (yRawNotificationCb callback) |
void | yapiRegisterRawReportCb (yRawReportCb callback) |
void | yapiRegisterRawReportV2Cb (yRawReportV2Cb callback) |
void YAPI_FUNCTION_EXPORT | yapiRegisterTimedReportCallback (yapiTimedReportCallback timedReportCallback) |
void YAPI_FUNCTION_EXPORT | yapiSetTraceFile (const char *file) |
YRETCODE YAPI_FUNCTION_EXPORT | yapiSleep (int duration_ms, char *errmsg) |
void YAPI_FUNCTION_EXPORT | yapiStartStopDeviceLogCallback (const char *serial, int start) |
YRETCODE YAPI_FUNCTION_EXPORT | yapiTestHub (const char *rooturl, int mstimeout, char *errmsg) |
YRETCODE YAPI_FUNCTION_EXPORT | yapiTriggerHubDiscovery (char *errmsg) |
YRETCODE YAPI_FUNCTION_EXPORT | yapiUnlockDeviceCallBack (char *errmsg) |
YRETCODE YAPI_FUNCTION_EXPORT | yapiUnlockFunctionCallBack (char *errmsg) |
void YAPI_FUNCTION_EXPORT | yapiUnregisterHub (const char *url) |
YRETCODE YAPI_FUNCTION_EXPORT | yapiUpdateDeviceList (u32 forceupdate, char *errmsg) |
YRETCODE YAPI_FUNCTION_EXPORT | yapiUpdateFirmware (const char *serial, const char *firmwarePath, const char *settings, int startUpdate, char *errmsg) |
YRETCODE YAPI_FUNCTION_EXPORT | yapiUpdateFirmwareEx (const char *serial, const char *firmwarePath, const char *settings, int force, int startUpdate, char *errmsg) |
#define Y_DETECT_ALL (Y_DETECT_USB | Y_DETECT_NET) |
typedef void YAPI_FUNCTION_EXPORT(* yapiDeviceLogCallback) (YAPI_FUNCTION fundescr, const char *line) |
typedef void YAPI_FUNCTION_EXPORT(* yapiDeviceUpdateCallback) (YAPI_DEVICE devdescr) |
typedef void YAPI_FUNCTION_EXPORT(* yapiFunctionUpdateCallback) (YAPI_FUNCTION fundescr, const char *value) |
typedef void YAPI_FUNCTION_EXPORT(* yapiHubDiscoveryCallback) (const char *serial, const char *url) |
typedef void YAPI_FUNCTION_EXPORT(* yapiLogFunction) (const char *log, u32 loglen) |
typedef void YAPI_FUNCTION_EXPORT(* yapiTimedReportCallback) (YAPI_FUNCTION fundesc, double timestamp, const u8 *bytes, u32 len) |
typedef void(* yRawNotificationCb) (USB_Notify_Pkt *) |
typedef void(* yRawReportCb) (YAPI_DEVICE serialref, USB_Report_Pkt_V1 *report, int pktsize) |
typedef void(* yRawReportV2Cb) (YAPI_DEVICE serialref, USB_Report_Pkt_V2 *report, int pktsize) |
YRETCODE YAPI_FUNCTION_EXPORT yapiCheckFirmware | ( | const char * | serial, |
const char * | rev, | ||
const char * | path, | ||
char * | buffer, | ||
int | buffersize, | ||
int * | fullsize, | ||
char * | errmsg | ||
) |
int YAPI_FUNCTION_EXPORT yapiCheckLogicalName | ( | const char * | name | ) |
void YAPI_FUNCTION_EXPORT yapiFreeAPI | ( | void | ) |
YAPI_FUNCTION_EXPORT void yapiFreeMem | ( | void * | ptr | ) |
int YAPI_FUNCTION_EXPORT yapiGetAllDevices | ( | YAPI_DEVICE * | buffer, |
int | maxsize, | ||
int * | neededsize, | ||
char * | errmsg | ||
) |
YRETCODE YAPI_FUNCTION_EXPORT yapiGetAllJsonKeys | ( | const char * | jsonbuffer, |
char * | out_buffer, | ||
int | out_buffersize, | ||
int * | fullsize, | ||
char * | errmsg | ||
) |
u16 YAPI_FUNCTION_EXPORT yapiGetAPIVersion | ( | const char ** | version, |
const char ** | apidate | ||
) |
YRETCODE YAPI_FUNCTION_EXPORT yapiGetBootloaders | ( | char * | buffer, |
int | buffersize, | ||
int * | fullsize, | ||
char * | errmsg | ||
) |
YAPI_DEVICE YAPI_FUNCTION_EXPORT yapiGetDevice | ( | const char * | device_str, |
char * | errmsg | ||
) |
YRETCODE YAPI_FUNCTION_EXPORT yapiGetDeviceInfo | ( | YAPI_DEVICE | devdesc, |
yDeviceSt * | infos, | ||
char * | errmsg | ||
) |
YRETCODE YAPI_FUNCTION_EXPORT yapiGetDevicePath | ( | YAPI_DEVICE | devdesc, |
char * | rootdevice, | ||
char * | path, | ||
int | pathsize, | ||
int * | neededsize, | ||
char * | errmsg | ||
) |
YRETCODE YAPI_FUNCTION_EXPORT yapiGetDevicePathEx | ( | const char * | serial, |
char * | rootdevice, | ||
char * | request, | ||
int | requestsize, | ||
int * | neededsize, | ||
char * | errmsg | ||
) |
YAPI_FUNCTION YAPI_FUNCTION_EXPORT yapiGetFunction | ( | const char * | class_str, |
const char * | function_str, | ||
char * | errmsg | ||
) |
YRETCODE YAPI_FUNCTION_EXPORT yapiGetFunctionInfo | ( | YAPI_FUNCTION | fundesc, |
YAPI_DEVICE * | devdesc, | ||
char * | serial, | ||
char * | funcId, | ||
char * | funcName, | ||
char * | funcVal, | ||
char * | errmsg | ||
) |
YRETCODE YAPI_FUNCTION_EXPORT yapiGetFunctionInfoEx | ( | YAPI_FUNCTION | fundesc, |
YAPI_DEVICE * | devdesc, | ||
char * | serial, | ||
char * | funcId, | ||
char * | baseType, | ||
char * | funcName, | ||
char * | funcVal, | ||
char * | errmsg | ||
) |
int YAPI_FUNCTION_EXPORT yapiGetFunctionsByClass | ( | const char * | class_str, |
YAPI_FUNCTION | prevfundesc, | ||
YAPI_FUNCTION * | buffer, | ||
int | maxsize, | ||
int * | neededsize, | ||
char * | errmsg | ||
) |
int YAPI_FUNCTION_EXPORT yapiGetFunctionsByDevice | ( | YAPI_DEVICE | devdesc, |
YAPI_FUNCTION | prevfundesc, | ||
YAPI_FUNCTION * | buffer, | ||
int | maxsize, | ||
int * | neededsize, | ||
char * | errmsg | ||
) |
YAPI_FUNCTION_EXPORT void* yapiGetMem | ( | int | size | ) |
YRETCODE YAPI_FUNCTION_EXPORT yapiGetSubdevices | ( | const char * | serial, |
char * | buffer, | ||
int | buffersize, | ||
int * | fullsize, | ||
char * | errmsg | ||
) |
u64 YAPI_FUNCTION_EXPORT yapiGetTickCount | ( | void | ) |
YRETCODE YAPI_FUNCTION_EXPORT yapiHandleEvents | ( | char * | errmsg | ) |
int YAPI_FUNCTION_EXPORT yapiHTTPRequest | ( | const char * | device, |
const char * | request, | ||
char * | buffer, | ||
int | buffsize, | ||
int * | fullsize, | ||
char * | errmsg | ||
) |
YRETCODE YAPI_FUNCTION_EXPORT yapiHTTPRequestAsync | ( | const char * | device, |
const char * | request, | ||
yapiRequestAsyncCallback | callback, | ||
void * | context, | ||
char * | errmsg | ||
) |
YRETCODE YAPI_FUNCTION_EXPORT yapiHTTPRequestAsyncEx | ( | const char * | device, |
const char * | request, | ||
int | requestsize, | ||
yapiRequestAsyncCallback | callback, | ||
void * | context, | ||
char * | errmsg | ||
) |
YRETCODE YAPI_FUNCTION_EXPORT yapiHTTPRequestAsyncOutOfBand | ( | int | channel, |
const char * | device, | ||
const char * | request, | ||
int | requestsize, | ||
yapiRequestAsyncCallback | callback, | ||
void * | context, | ||
char * | errmsg | ||
) |
YRETCODE YAPI_FUNCTION_EXPORT yapiHTTPRequestSyncDone | ( | YIOHDL * | iohdl, |
char * | errmsg | ||
) |
YRETCODE YAPI_FUNCTION_EXPORT yapiHTTPRequestSyncStart | ( | YIOHDL * | iohdl, |
const char * | device, | ||
const char * | request, | ||
char ** | reply, | ||
int * | replysize, | ||
char * | errmsg | ||
) |
YRETCODE YAPI_FUNCTION_EXPORT yapiHTTPRequestSyncStartEx | ( | YIOHDL * | iohdl, |
const char * | device, | ||
const char * | request, | ||
int | requestsize, | ||
char ** | reply, | ||
int * | replysize, | ||
char * | errmsg | ||
) |
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 | ||
) |
YRETCODE YAPI_FUNCTION_EXPORT yapiInitAPI | ( | int | type, |
char * | errmsg | ||
) |
int YAPI_FUNCTION_EXPORT yapiJsonDecodeString | ( | const char * | json_string, |
char * | output | ||
) |
int YAPI_FUNCTION_EXPORT yapiJsonGetPath | ( | const char * | path, |
const char * | json_data, | ||
int | json_size, | ||
const char ** | result, | ||
char * | errmsg | ||
) |
YRETCODE YAPI_FUNCTION_EXPORT yapiLockDeviceCallBack | ( | char * | errmsg | ) |
YRETCODE YAPI_FUNCTION_EXPORT yapiLockFunctionCallBack | ( | char * | errmsg | ) |
YRETCODE YAPI_FUNCTION_EXPORT yapiPreregisterHub | ( | const char * | rooturl, |
char * | errmsg | ||
) |
void YAPI_FUNCTION_EXPORT yapiRegisterDeviceArrivalCallback | ( | yapiDeviceUpdateCallback | arrivalCallback | ) |
void YAPI_FUNCTION_EXPORT yapiRegisterDeviceChangeCallback | ( | yapiDeviceUpdateCallback | changeCallback | ) |
void YAPI_FUNCTION_EXPORT yapiRegisterDeviceLogCallback | ( | yapiDeviceLogCallback | logCallback | ) |
void YAPI_FUNCTION_EXPORT yapiRegisterDeviceRemovalCallback | ( | yapiDeviceUpdateCallback | removalCallback | ) |
void YAPI_FUNCTION_EXPORT yapiRegisterFunctionUpdateCallback | ( | yapiFunctionUpdateCallback | updateCallback | ) |
YRETCODE YAPI_FUNCTION_EXPORT yapiRegisterHub | ( | const char * | rooturl, |
char * | errmsg | ||
) |
void YAPI_FUNCTION_EXPORT yapiRegisterHubDiscoveryCallback | ( | yapiHubDiscoveryCallback | hubDiscoveryCallback | ) |
void YAPI_FUNCTION_EXPORT yapiRegisterLogFunction | ( | yapiLogFunction | logfun | ) |
void yapiRegisterRawNotificationCb | ( | yRawNotificationCb | callback | ) |
void yapiRegisterRawReportCb | ( | yRawReportCb | callback | ) |
void yapiRegisterRawReportV2Cb | ( | yRawReportV2Cb | callback | ) |
void YAPI_FUNCTION_EXPORT yapiRegisterTimedReportCallback | ( | yapiTimedReportCallback | timedReportCallback | ) |
void YAPI_FUNCTION_EXPORT yapiSetTraceFile | ( | const char * | file | ) |
YRETCODE YAPI_FUNCTION_EXPORT yapiSleep | ( | int | duration_ms, |
char * | errmsg | ||
) |
void YAPI_FUNCTION_EXPORT yapiStartStopDeviceLogCallback | ( | const char * | serial, |
int | start | ||
) |
YRETCODE YAPI_FUNCTION_EXPORT yapiTestHub | ( | const char * | rooturl, |
int | mstimeout, | ||
char * | errmsg | ||
) |
YRETCODE YAPI_FUNCTION_EXPORT yapiTriggerHubDiscovery | ( | char * | errmsg | ) |
YRETCODE YAPI_FUNCTION_EXPORT yapiUnlockDeviceCallBack | ( | char * | errmsg | ) |
YRETCODE YAPI_FUNCTION_EXPORT yapiUnlockFunctionCallBack | ( | char * | errmsg | ) |
void YAPI_FUNCTION_EXPORT yapiUnregisterHub | ( | const char * | url | ) |
YRETCODE YAPI_FUNCTION_EXPORT yapiUpdateDeviceList | ( | u32 | forceupdate, |
char * | errmsg | ||
) |
YRETCODE YAPI_FUNCTION_EXPORT yapiUpdateFirmware | ( | const char * | serial, |
const char * | firmwarePath, | ||
const char * | settings, | ||
int | startUpdate, | ||
char * | errmsg | ||
) |
YRETCODE YAPI_FUNCTION_EXPORT yapiUpdateFirmwareEx | ( | const char * | serial, |
const char * | firmwarePath, | ||
const char * | settings, | ||
int | force, | ||
int | startUpdate, | ||
char * | errmsg | ||
) |