40 #define __FILE_ID__ "yhash" 46 #include <Yocto/yapi_ext.h> 64 #define HLOGF(x) dbglog x; 91 #define BLK(hdl) (yHashTable[(hdl)>>1].blk[(hdl)&1]) 92 #define WP(hdl) (BLK(hdl).wpEntry) 93 #define YC(hdl) (BLK(hdl).ypCateg) 94 #define YP(hdl) (BLK(hdl).ypEntry) 95 #define YA(hdl) (BLK(hdl).ypArray) 106 freeBlks =
BLK(freeBlks).nextPtr;
109 YASSERT(nextHashEntry < NB_MAX_HASH_ENTRIES);
110 res = ((nextHashEntry++) << 1) + 1;
115 HLOGF((
"yBlkAlloc() uses bucket 0x%x\n",nextHashEntry));
117 HLOGF((
"yBlkAlloc() returns blkHdl 0x%x\n",res));
127 HLOGF((
"Free blkHdl 0x%x\n",hdl));
142 hdl =
BLK(hdl).nextPtr;
150 hdl =
BLK(hdl).nextPtr;
162 u16 sum1 = 0xff, sum2 = 0xff - len, plen = 0;
166 u16 tlen = len > 21 ? 21 : len;
173 sum1 = (sum1 & 0xff) + (sum1 >> 8);
174 sum2 = (sum2 & 0xff) + (sum2 >> 8);
177 plen = virtlen - plen;
179 u16 tlen = plen > 21 ? 21 : plen;
182 sum2 = (sum2 & 0xff) + (sum2 >> 8);
184 sum1 = (sum1 & 0xff) + (sum1 >> 8);
185 sum2 = (sum2 & 0xff) + (sum2 >> 8);
186 return ((sum1 & 0xff) << 8) | (sum2 & 0xff);
191 yStrRef empty, Module, module, HubPort,Sensor;
194 HLOGF((
"yHashInit\n"));
195 for(i = 0; i < 256; i++)
196 yHashTable[i].next = 0;
201 #ifndef MICROCHIP_API 202 memset((u8 *)usedDevYdx, 0,
sizeof(usedDevYdx));
233 YC(yYpListHead).catYdx = 0;
239 #ifndef MICROCHIP_API 242 HLOGF((
"yHashFree\n"));
261 if(yHashTable[yhash].next != 0) {
264 if(yHashTable[yhash].hash == hash) {
266 p = yHashTable[yhash].
buff;
267 for(i = 0; i < len; i++)
if(p[i] != buf[i])
break;
273 HLOGF((
"yHash found at 0x%x\n", yhash));
280 yhash = yHashTable[yhash].
next;
281 }
while(yhash != -1);
283 if(testonly)
goto exit_error;
284 YASSERT(nextHashEntry < NB_MAX_HASH_ENTRIES);
285 yhash = nextHashEntry++;
290 HLOGF((
"yHash entry not found\n", yhash));
297 yHashTable[yhash].
hash = hash;
298 yHashTable[yhash].
next = -1;
299 p = yHashTable[yhash].
buff;
300 for(i = 0; i < len; i++) p[i] = buf[i];
303 yHashTable[prevhash].
next = yhash;
305 HLOGF((
"yHash added at 0x%x\n", yhash));
323 HLOGF((
"yHashPutStr('%s'):\n",str));
324 return yHashPut((
const u8 *)str, len, 0);
338 HLOGF((
"yHashTestStr('%s'):\n",str));
339 return yHashPut((
const u8 *)str, len, 1);
346 HLOGF((
"yHashGetBuf(0x%x)\n",yhash));
349 if(yhash >= nextHashEntry || yHashTable[yhash].next == 0) {
351 memset(destbuf, 0, bufsize);
355 YASSERT(yhash < nextHashEntry);
356 YASSERT(yHashTable[yhash].next != 0);
359 p = yHashTable[yhash].
buff;
360 while(bufsize-- > 0) {
367 HLOGF((
"yHashGetStr(0x%x):\n",yhash));
369 destbuf[bufsize-1] = 0;
383 HLOGF((
"yHashGetStrLen(0x%x)\n",yhash));
386 if(yhash >= nextHashEntry || yHashTable[yhash].next == 0) {
391 if(!yHashTable[yhash].buff[i])
break;
395 YASSERT(yhash < nextHashEntry);
396 YASSERT(yHashTable[yhash].next != 0);
397 return (u16)
YSTRLEN((
char *)yHashTable[yhash].buff);
407 HLOGF((
"yHashGetStrPtr(0x%x)\n",yhash));
409 YASSERT(yhash < nextHashEntry);
410 YASSERT(yHashTable[yhash].next != 0);
413 char c = yHashTable[yhash].
buff[i];
415 shared_hashbuf[i] = c;
417 shared_hashbuf[i] = 0;
418 return shared_hashbuf;
420 return (
char *)yHashTable[yhash].
buff;
424 #ifndef MICROCHIP_API 433 while (*rootUrl ==
'/') rootUrl++;
435 for (len = 0; rootUrl[len] && rootUrl[len] !=
'/'; len++);
436 if ((len != 8 || memcmp(rootUrl,
"bySerial", 8) != 0) &&
437 (len != 3 || memcmp(rootUrl,
"api", 3) != 0)) {
438 absurl->
path[i] =
yHashPut((
const u8 *)rootUrl, len, testonly);
443 while (*rootUrl ==
'/') rootUrl++;
445 if (*rootUrl && testonly)
return -1;
459 HLOGF((
"yHashUrlFromRef('%s')\n", rootUrl));
460 yHashGetBuf(urlref, (u8 *)&huburl,
sizeof(huburl));
461 memset(huburl.
path, 0xff,
sizeof(huburl.
path));
466 return yHashPut((
const u8 *)&huburl,
sizeof(huburl), 0);
477 int len,hostlen, domlen,iptest=0;
479 const char *pos,*posplus;
480 const char *host=NULL;
484 HLOGF((
"yHashUrl('%s','%s')\n",url,rootUrl));
485 memset(&huburl, 0xff,
sizeof(huburl));
488 if (
YSTRNCMP(url,
"http://", 7) == 0) {
491 }
else if (
YSTRNCMP(url,
"ws://", 5) == 0) {
496 for (p = url; *p && *p !=
'@' && *p !=
'/'; p++);
498 for (p = url; *p !=
':' && *p !=
'@'; p++);
503 len = (int)(p - url);
510 while (*p !=
'@') p++;
511 len = (int)(p - url);
519 end =strchr(url,
'/');
521 end = url + strlen(url);
522 pos = strchr(url,
':');
524 if(pos && pos < end ){
525 len= (int)(end-posplus);
530 memcpy(buffer,posplus,len);
532 huburl.
byip.port = atoi(buffer);
537 pos = strchr(url,
'.');
539 if(pos && pos < end ){
540 hostlen = (int)(pos-url);
550 if(hostlen && hostlen <= 3){
551 memcpy(buffer,host,hostlen);
555 if(iptest && iptest< 256 && end-host < 16){
559 domlen= (int)(end - url);
575 return yHashPut((
const u8 *)&huburl,
sizeof(huburl), testonly);
584 yHashGetBuf(urlref, (u8 *)&absurl,
sizeof(absurl));
585 if (proto) *proto = absurl.
proto;
586 if (user) *user = absurl.
user;
587 if (password) *password = absurl.
password;
601 if (port) *port = absurl.
byip.port;
614 if(port) *port = absurl.
byname.port;
625 yHashGetBuf(url_a, (u8 *)&absurl_a,
sizeof(absurl_a));
626 yHashGetBuf(url_b, (u8 *)&absurl_b,
sizeof(absurl_b));
627 if (absurl_a.
byname.domaine == absurl_b.
byname.domaine &&
641 memset(&huburl, 0xff,
sizeof(huburl));
645 huburl.
byusb.serial = serial;
646 return yHashPut((
const u8 *)&huburl,
sizeof(huburl), 0);
654 memset(&huburl, 0xff,
sizeof(huburl));
656 return yHashPut((
const u8 *)&huburl,
sizeof(huburl), 0);
679 next =
WP(hdl).nextPtr;
703 WP(prev).nextPtr = next;
705 devYdx =
WP(hdl).devYdx;
706 funHdl = funYdxPtr[devYdx];
709 nextHdl =
YA(funHdl).nextPtr;
715 #ifndef MICROCHIP_API 716 if((
unsigned) nextDevYdx > devYdx) {
719 usedDevYdx[devYdx>>4] &= ~ (u16)(1 << (devYdx&15));
731 #ifndef DEBUG_WP_LOCK 746 if(wpSomethingUnregistered && !wpLockCount) {
748 wpSomethingUnregistered = 0;
755 void wpPreventUnregisterDbg(
const char *file, u32 line)
758 dbglog(
"wpPreventUnregisterDbg: %s:%d\n",file,line);
764 void wpAllowUnregisterDbg(
const char *file, u32 line)
767 dbglog(
"wpAllowUnregisterDbg: %s:%d\n",file,line);
770 if(wpSomethingUnregistered && !wpLockCount) {
795 if(
WP(hdl).serial == serial)
break;
797 hdl =
WP(prev).nextPtr;
802 #ifndef MICROCHIP_API 804 YASSERT(!(usedDevYdx[devYdx>>4] & (1 << (devYdx&15))));
805 usedDevYdx[devYdx>>4] |= 1 << (devYdx&15);
806 if(nextDevYdx == devYdx) {
808 while(usedDevYdx[nextDevYdx>>4] & (1 << (nextDevYdx&15))) {
817 devYdxPtr[devYdx] = hdl;
818 WP(hdl).devYdx = (u8)devYdx;
820 WP(hdl).serial = serial;
823 WP(hdl).url = devUrl;
829 WP(prev).nextPtr = hdl;
832 }
else if(devYdx != -1 &&
WP(hdl).devYdx != devYdx) {
834 u16 oldDevYdx =
WP(hdl).devYdx;
836 funYdxPtr[devYdx] = funYdxPtr[oldDevYdx];
838 devYdxPtr[devYdx] = hdl;
841 WP(hdl).devYdx = (u8)devYdx;
845 if(
WP(hdl).name != logicalName){
846 if(changed==0) changed=1;
847 WP(hdl).name = logicalName;
851 if(productId != 0)
WP(hdl).devid = productId;
852 WP(hdl).url = devUrl;
869 dbglog(
"WP: regiser %s(0x%X) from %s:%u (res=%d)\n",
yHashGetStrPtr(serial),serial,host,port,changed);
928 next =
WP(hdl).nextPtr;
929 if(
WP(hdl).serial == serial) {
932 wpSomethingUnregistered = 1;
951 dbglog(
"WP: mark for unregister %s(0x%X) from %s:%u\n",
yHashGetStrPtr(serial),serial,host,port);
954 dbglog(
"WP: mark for unregister %s(0x%X) witch is unregistred!\n",
yHashGetStrPtr(serial),serial);
977 if(
WP(hdl).serial == serial) {
978 res =
WP(hdl).devYdx;
981 hdl =
WP(hdl).nextPtr;
999 if(
WP(hdl).serial == strref) {
1003 if(
WP(hdl).name == strref) byname = hdl;
1004 hdl =
WP(hdl).nextPtr;
1007 res =
WP(byname).serial;
1035 if(
WP(hdl).name == strref) {
1036 res =
WP(hdl).serial;
1039 hdl =
WP(hdl).nextPtr;
1046 #ifndef MICROCHIP_API 1054 apiref =
yHashUrl(host, rootUrl, 1,NULL);
1061 if(
WP(hdl).url == apiref) {
1062 res =
WP(hdl).serial;
1065 hdl =
WP(hdl).nextPtr;
1077 yHashGetBuf(hubUrl, (u8 *)&hubAbsUrl,
sizeof(hubAbsUrl));
1085 if( absurl.
byname.domaine == hubAbsUrl.
byname.domaine &&
1089 *buffer++ =
WP(hdl).serial;
1094 hdl =
WP(hdl).nextPtr;
1112 if(
WP(hdl).serial == (u16)devdesc) {
1116 hdl =
WP(hdl).nextPtr;
1131 int fullsize, len,idx;
1137 if(
WP(hdl).serial == (u16)devdesc) {
1138 hubref =
WP(hdl).url;
1140 strref =
WP(hdl).serial;
1143 hdl =
WP(hdl).nextPtr;
1149 yHashGetBuf(hubref, (u8 *)&absurl,
sizeof(absurl));
1152 strref = absurl.
byusb.serial;
1153 if(strref == 0) strref = devdesc & 0xffff;
1156 memcpy(&huburl,&absurl,
sizeof(absurl));
1167 if(
WP(hdl).url == hubref) {
1168 strref =
WP(hdl).serial;
1171 hdl =
WP(hdl).nextPtr;
1181 if(!request) requestsize = 0;
1184 if(requestsize > 10) {
1185 memcpy(request,
"/bySerial/",10);
1191 if(requestsize > 1) {
1201 len = (int)strlen(serial)+1;
1203 if(requestsize>0 && requestsize > len) {
1204 memcpy(request, serial, len-1);
1205 request[len-1] =
'/';
1211 if(neededsize != NULL) *neededsize = fullsize;
1213 if(requestsize > 0) *request = 0;
1229 if(
WP(hdl).serial == (u16)devdesc) {
1231 if(deviceid) *deviceid =
WP(hdl).devid;
1238 hdl =
WP(hdl).nextPtr;
1260 int devYdx, changed=0;
1261 const u16 *funcValWords = (
const u16 *)funcVal;
1269 if(
YC(hdl).name == categ)
break;
1271 hdl =
YC(prev).nextPtr;
1275 YC(hdl).catYdx = nextCatYdx++;
1277 YC(hdl).name = categ;
1282 YC(prev).nextPtr = hdl;
1289 hdl =
YC(cat_hdl).entries;
1292 if(
YP(hdl).serialNum == serial &&
YP(hdl).funcId == funcId)
break;
1294 hdl =
YP(prev).nextPtr;
1303 YP(hdl).serialNum = serial;
1304 YP(hdl).funcId = funcId;
1306 YP(hdl).funInfo.raw = 15;
1308 YP(hdl).funcValWords[i] = 0;
1311 YC(cat_hdl).entries = hdl;
1313 YP(prev).nextPtr = hdl;
1317 if(
YP(hdl).funcName != funcName){
1319 YP(hdl).funcName = funcName;
1323 if(funYdx >= 0 && funYdx < 15) {
1324 YP(hdl).funInfo.raw = funYdx;
1326 funYdx =
YP(hdl).funInfo.v2.funydx;
1335 yahdl = funYdxPtr[devYdx];
1345 yahdl =
YA(prev).nextPtr;
1351 for(i = 0; i < 6; i++) {
1355 funYdx = funYdx - 6 + i;
1361 YP(hdl).funInfo.raw = funYdx;
1369 funYdxPtr[devYdx] = yahdl;
1371 YA(prev).nextPtr = yahdl;
1376 yahdl =
YA(prev).nextPtr;
1378 YA(yahdl).entries[cnt] = hdl;
1380 if(funcVal != NULL) {
1382 if(
YP(hdl).funcValWords[i] != funcValWords[i]){
1384 YP(hdl).funcValWords[i] = funcValWords[i];
1401 const u16 *funcValWords = (
const u16 *)funcVal;
1407 hdl = funYdxPtr[devYdx];
1414 hdl =
YA(hdl).nextPtr;
1420 hdl =
YA(hdl).entries[funYdx];
1426 if(
YP(hdl).funcValWords[i] != funcValWords[i]) {
1427 YP(hdl).funcValWords[i] = funcValWords[i];
1431 if(
YP(hdl).funInfo.
raw != funInfo.
raw) {
1432 YP(hdl).funInfo.raw = funInfo.
raw;
1437 *fundesc =
YP(hdl).hwId;
1455 u16 *funcValWords = (u16 *)funcVal;
1462 hdl = devYdxPtr[devYdx];
1463 *logicalName =
WP(hdl).name;
1465 hdl = funYdxPtr[devYdx];
1472 hdl =
YA(hdl).nextPtr;
1478 hdl =
YA(hdl).entries[funYdx];
1482 *serial =
YP(hdl).serialNum;
1485 *funcId =
YP(hdl).funcId;
1488 *funcName =
YP(hdl).funcName;
1491 funcInfo->
raw =
YP(hdl).funInfo.raw;
1496 funcValWords[i] =
YP(hdl).funcValWords[i];
1512 if(entries) *entries =
YC(hdl).entries;
1522 u16 *funcValWords = (u16 *)funcVal;
1526 serialref =
YP(hdl).serialNum;
1527 funcidref =
YP(hdl).funcId;
1528 funcnameref =
YP(hdl).funcName;
1529 if(funcVal != NULL) {
1531 funcValWords[i] =
YP(hdl).funcValWords[i];
1535 *funcInfo =
YP(hdl).funInfo;
1536 res =
YP(hdl).funInfo.v2.funydx;
1540 if (funcVal) *funcVal = 0;
1544 if(serial != NULL) *serial = serialref;
1545 if(funcId != NULL) *funcId = funcidref;
1546 if(funcName != NULL) *funcName = funcnameref;
1575 hdl =
YC(cat_hdl).entries;
1580 next =
YP(hdl).nextPtr;
1581 if(
YP(hdl).serialNum == serial) {
1584 YC(cat_hdl).entries = next;
1586 YP(prev).nextPtr = next;
1595 cat_hdl =
YC(cat_hdl).nextPtr;
1601 #ifndef MICROCHIP_API 1609 const char *dotpos = func_or_name;
1616 if (!strcmp(class_str,
"Function")) {
1618 }
else if (!strcmp(class_str,
"Sensor")) {
1629 if(
YC(cat_hdl).name == categref)
break;
1630 cat_hdl =
YC(cat_hdl).nextPtr;
1638 while(*dotpos && *dotpos !=
'.') dotpos++;
1647 hdl =
YC(cat_hdl).entries;
1649 if(
YP(hdl).funcName == funcref) {
1650 res =
YP(hdl).serialNum + ((u32)(
YP(hdl).funcId) << 16);
1653 hdl =
YP(hdl).nextPtr;
1658 for(cat_hdl = yYpListHead; cat_hdl !=
INVALID_BLK_HDL; cat_hdl =
YC(cat_hdl).nextPtr) {
1660 hdl =
YC(cat_hdl).entries;
1664 res =
YP(hdl).serialNum + ((u32)(
YP(hdl).funcId) << 16);
1667 hdl =
YP(hdl).nextPtr;
1677 categname[0] = class_str[0] | 0x20;
1678 for(i = 1; (categname[i] = class_str[i]) != 0; i++);
1683 if(dotpos==func_or_name){
1688 devref =
yHashTestBuf((u8 *)func_or_name, (u16)( dotpos-func_or_name));
1704 if(
WP(hdl).serial == devref)
break;
1705 if(
WP(hdl).name == devref) byname = hdl;
1706 hdl =
WP(hdl).nextPtr;
1713 devref =
WP(byname).serial;
1720 hdl =
YC(cat_hdl).entries;
1723 if(
YP(hdl).funcId == funcref) {
1724 res =
YP(hdl).serialNum + ((u32)(
YP(hdl).funcId) << 16);
1727 if (best_name != -1 &&
YP(hdl).funcName == funcref) {
1728 best_name =
YP(hdl).serialNum + ((u32)(
YP(hdl).funcId) << 16);
1731 hdl =
YP(hdl).nextPtr;
1735 for(cat_hdl = yYpListHead; cat_hdl !=
INVALID_BLK_HDL; cat_hdl =
YC(cat_hdl).nextPtr) {
1737 hdl =
YC(cat_hdl).entries;
1741 if (
YP(hdl).funcId == funcref) {
1742 res =
YP(hdl).serialNum + ((u32)(
YP(hdl).funcId) << 16);
1745 if (best_name != -1 &&
YP(hdl).funcName == funcref) {
1746 best_name =
YP(hdl).serialNum + ((u32)(
YP(hdl).funcId) << 16);
1749 hdl =
YP(hdl).nextPtr;
1754 if (res == -1 && best_name != -1) {
1769 int maxfun = 0, nbreturned = 0;
1771 int use = (prevfundesc==0);
1774 if (!strcmp(class_str,
"Function")) {
1776 }
else if (!strcmp(class_str,
"Sensor")) {
1781 if(*neededsize) *neededsize = 0;
1787 for(cat_hdl = yYpListHead; cat_hdl !=
INVALID_BLK_HDL; cat_hdl =
YC(cat_hdl).nextPtr) {
1794 if(
YC(cat_hdl).name != categref)
continue;
1796 hdl =
YC(cat_hdl).entries;
1800 hdl =
YP(hdl).nextPtr;
1803 if(devdesc == -1 ||
YP(hdl).serialNum == (u16)devdesc) {
1804 if(!use && prevfundesc == fundescr){
1807 fundescr =
YP(hdl).hwId;
1813 *buffer++ = fundescr;
1819 hdl =
YP(hdl).nextPtr;
1826 if(neededsize) *neededsize =
sizeof(
YAPI_FUNCTION) * maxfun;
1838 funcref = (u16)(fundesc >> 16);
1840 funcname[0] &= ~0x20;
1841 for(p = funcname+1; *p >
'9'; p++);
1850 if(
YC(cat_hdl).name == categref)
break;
1851 cat_hdl =
YC(cat_hdl).nextPtr;
1856 hdl =
YC(cat_hdl).entries;
1858 if(
YP(hdl).hwId == fundesc) {
1861 hdl =
YP(hdl).nextPtr;
1870 u16 *funcValWords = (u16 *)funcVal;
1889 if(funcVal != NULL) {
1891 funcValWords[i] =
YP(hdl).funcValWords[i];
1896 if(funcVal != NULL) funcVal[0] = 0;
1911 int maxfun = 0, nbreturned = 0;
1913 int use = (prevfundesc == 0);
1919 for (cat_hdl = yYpListHead; cat_hdl !=
INVALID_BLK_HDL; cat_hdl =
YC(cat_hdl).nextPtr) {
1926 if (
YC(cat_hdl).name != categref)
continue;
1928 hdl =
YC(cat_hdl).entries;
1932 hdl =
YP(hdl).nextPtr;
1935 if (devdesc == -1 ||
YP(hdl).serialNum == (u16)devdesc) {
1936 if (!use && prevfundesc == fundescr) {
1939 fundescr =
YP(hdl).hwId;
1945 *buffer++ = fundescr;
1951 hdl =
YP(hdl).nextPtr;
1958 if (neededsize) *neededsize =
sizeof(
YAPI_FUNCTION) * maxfun;
1974 cat_hdl =
YC(cat_hdl).nextPtr;
1981 hdl =
YC(cat_hdl).entries;
1984 if(res++ < maxSerials) {
1985 *serials++ =
YP(hdl).funcName;
1988 hdl =
YP(hdl).nextPtr;
1995 #ifdef MICROCHIP_API 2012 cat_hdl =
YC(cat_hdl).nextPtr;
2019 hdl =
YC(cat_hdl).entries;
2021 if(
YP(hdl).funcName == serialRef &&
2026 hdl =
YP(hdl).nextPtr;
2033 if(funcid[7] <
'1' || funcid[7] >
'4')
2036 if(devYdx == hubDevYdx) {
2038 return funcid[7] -
'1';
2042 return devYdx + funcid[7] -
'0';
2061 if(ch < 32 || ch > 32+127) {
2075 if(newCh < 32 || newCh > 32+127) {
2079 ch = (ch << 7) + newCh;
2080 funcVal[len] = (ch >> (5-len));
YAPI_DEVICE wpSearchByNameHash(yStrRef strref)
#define YSTRREF_SENSOR_STRING
yStrRef wpGetAttribute(yBlkHdl hdl, yWPAttribute attridx)
yCRITICAL_SECTION yYpMutex
static void wpExecuteUnregisterUnsec(void)
int decodeNetFuncValV2(const u8 *p, Notification_funydx *funInfo, char *funcVal)
struct yAbsUrl::@53::@55 byname
#define YSTRREF_EMPTY_STRING
int ypGetFunctions(const char *class_str, YAPI_DEVICE devdesc, YAPI_FUNCTION prevfundesc, YAPI_FUNCTION *buffer, int maxsize, int *neededsize)
int yHashSameHub(yUrlRef url_a, yUrlRef url_b)
static yBlkHdl funYdxPtr[NB_MAX_DEVICES]
static yBlkHdl functionSearch(YAPI_FUNCTION fundesc)
void yInitializeCriticalSection(yCRITICAL_SECTION *cs)
#define YOCTO_PRODUCTNAME_LEN
yCRITICAL_SECTION yFreeMutex
#define NOTIFY_V2_TYPEDDATA
yUrlRef yHashUrlAPI(void)
void yHashGetStr(yHash yhash, char *destbuf, u16 bufsize)
int ypRegisterByYdx(u8 devYdx, Notification_funydx funInfo, const char *funcVal, YAPI_FUNCTION *fundesc)
static yBlkHdl devYdxPtr[NB_MAX_DEVICES]
void wpGetSerial(yBlkHdl hdl, char *serial)
#define YSTRREF_mODULE_STRING
yAsbUrlType yHashGetUrlPort(yUrlRef urlref, char *url, u16 *port, yAsbUrlProto *proto, yStrRef *user, yStrRef *password)
int wpGetDevYdx(yStrRef serial)
void yLeaveCriticalSection(yCRITICAL_SECTION *cs)
static yBlkHdl yBlkAlloc(void)
struct yAbsUrl::@53::@56 byip
#define NOTIFY_NETPKT_STOP
char * yHashGetStrPtr(yHash yhash)
static void yBlkFree(yBlkHdl hdl)
yHash yHashTestStr(const char *str)
yCRITICAL_SECTION yWpMutex
yCRITICAL_SECTION yHashMutex
int ypGetBootDevHdl(const char *serial)
int wpGetDeviceUrl(YAPI_DEVICE devdesc, char *roothubserial, char *request, int requestsize, int *neededsize)
yUrlRef yHashUrlUSB(yHash serial)
static int yComputeRelPath(yAbsUrl *absurl, const char *rootUrl, u8 testonly)
int wpGetAllDevUsingHubUrl(yUrlRef hubUrl, yStrRef *buffer, int sizeInStrRef)
void freeDevYdxInfos(int devYdx)
struct Notification_funydx::@10 v2
#define YSTRCPY(dst, dstsize, src)
#define YOCTO_PUBVAL_SIZE
void ypGetCategory(yBlkHdl hdl, char *name, yBlkHdl *entries)
#define YMAX_HUB_URL_DEEP
yHash yHashPutBuf(const u8 *buf, u16 len)
#define YOCTO_FUNCTION_LEN
#define NOTIFY_V2_6RAWBYTES
static u16 usedDevYdx[NB_MAX_DEVICES/16]
YAPI_DEVICE wpSearchByUrl(const char *host, const char *rootUrl)
#define NB_MAX_HASH_ENTRIES
static yHash yHashPut(const u8 *buf, u16 len, u8 testonly)
yHash yHashPutStr(const char *str)
void initDevYdxInfos(int devYdx, yStrRef serial)
int ypGetFunctionInfo(YAPI_FUNCTION fundesc, char *serial, char *funcId, char *baseType, char *funcName, char *funcVal)
YAPI_FUNCTION ypSearch(const char *class_str, const char *func_or_name)
void wpAllowUnregisterEx(void)
int ypGetAttributes(yBlkHdl hdl, yStrRef *serial, yStrRef *funcId, yStrRef *funcName, Notification_funydx *funcInfo, char *funcVal)
int wpMarkForUnregister(yStrRef serial)
void yEnterCriticalSection(yCRITICAL_SECTION *cs)
s16 ypFindBootloaders(yStrRef *serials, u16 maxSerials)
int ypGetType(yBlkHdl hdl)
void yHashGetBuf(yHash yhash, u8 *destbuf, u16 bufsize)
#define YSTRREF_MODULE_STRING
void wpPreventUnregisterEx(void)
#define YOCTO_DEFAULT_PORT
#define YOCTO_AKA_YSENSOR
yBlkHdl yBlkListSeek(yBlkHdl hdl, u16 pos)
u16 yHashGetStrLen(yHash yhash)
int ypGetAttributesByYdx(u8 devYdx, u8 funYdx, yStrRef *serial, yStrRef *logicalName, yStrRef *funcId, yStrRef *funcName, Notification_funydx *funcInfo, char *funcVal)
void wpGetLogicalName(yBlkHdl hdl, char *logicalName)
void yDeleteCriticalSection(yCRITICAL_SECTION *cs)
u16 yBlkListLength(yBlkHdl hdl)
yHash yHashTestBuf(const u8 *buf, u16 len)
struct yAbsUrl::@53::@57 byusb
YAPI_DEVICE wpSearchEx(yStrRef strref)
char SerialNumberStr[YOCTO_SERIAL_LEN]
int wpGetDeviceInfo(YAPI_DEVICE devdesc, u16 *deviceid, char *productname, char *serial, char *logicalname, u8 *beacon)
#define YOCTO_HOSTNAME_NAME
yUrlRef yHashUrlFromRef(yUrlRef urlref, const char *rootUrl)
#define YWP_MARK_FOR_UNREGISTER
static YHashSlot yHashTable[NB_MAX_HASH_ENTRIES]
yUrlRef yHashUrl(const char *url, const char *rootUrl, u8 testonly, char *errmsg)
int ypRegister(yStrRef categ, yStrRef serial, yStrRef funcId, yStrRef funcName, int funClass, int funYdx, const char *funcVal)
YAPI_DEVICE wpSearch(const char *device_str)
static int wpSomethingUnregistered
#define YSTRREF_HUBPORT_STRING
int ypGetFunctionsEx(yStrRef categref, YAPI_DEVICE devdesc, YAPI_FUNCTION prevfundesc, YAPI_FUNCTION *buffer, int maxsize, int *neededsize)
#define YSTRNCMP(A, B, len)
yStrRef path[YMAX_HUB_URL_DEEP]
#define YOCTO_AKA_YFUNCTION
static u16 fletcher16(const u8 *data, u16 len, u16 virtlen)
static void ypUnregister(yStrRef serial)
#define YOCTO_N_BASECLASSES
int wpRegister(int devYdx, yStrRef serial, yStrRef logicalName, yStrRef productName, u16 productId, yUrlRef devUrl, s8 beacon)
#define YOCTO_LOGICAL_LEN
#define YBLKID_YPENTRYEND
yUrlRef wpGetDeviceUrlRef(YAPI_DEVICE devdesc)