tizen 2.4 release
[framework/connectivity/bluez.git] / lib / bluetooth.c
1 /*
2  *
3  *  BlueZ - Bluetooth protocol stack for Linux
4  *
5  *  Copyright (C) 2000-2001  Qualcomm Incorporated
6  *  Copyright (C) 2002-2003  Maxim Krasnyansky <maxk@qualcomm.com>
7  *  Copyright (C) 2002-2010  Marcel Holtmann <marcel@holtmann.org>
8  *
9  *
10  *  This program is free software; you can redistribute it and/or modify
11  *  it under the terms of the GNU General Public License as published by
12  *  the Free Software Foundation; either version 2 of the License, or
13  *  (at your option) any later version.
14  *
15  *  This program is distributed in the hope that it will be useful,
16  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  *  GNU General Public License for more details.
19  *
20  *  You should have received a copy of the GNU General Public License
21  *  along with this program; if not, write to the Free Software
22  *  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
23  *
24  */
25
26 #ifdef HAVE_CONFIG_H
27 #include <config.h>
28 #endif
29
30 #include <stdio.h>
31 #include <errno.h>
32 #include <ctype.h>
33 #include <stdarg.h>
34 #include <stdlib.h>
35 #include <string.h>
36 #include <sys/socket.h>
37
38 #include "bluetooth.h"
39 #include "hci.h"
40
41 void baswap(bdaddr_t *dst, const bdaddr_t *src)
42 {
43         register unsigned char *d = (unsigned char *) dst;
44         register const unsigned char *s = (const unsigned char *) src;
45         register int i;
46
47         for (i = 0; i < 6; i++)
48                 d[i] = s[5-i];
49 }
50
51 char *batostr(const bdaddr_t *ba)
52 {
53         char *str = bt_malloc(18);
54         if (!str)
55                 return NULL;
56
57         sprintf(str, "%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X",
58                 ba->b[0], ba->b[1], ba->b[2],
59                 ba->b[3], ba->b[4], ba->b[5]);
60
61         return str;
62 }
63
64 bdaddr_t *strtoba(const char *str)
65 {
66         bdaddr_t b;
67         bdaddr_t *ba = bt_malloc(sizeof(*ba));
68
69         if (ba) {
70                 str2ba(str, &b);
71                 baswap(ba, &b);
72         }
73
74         return ba;
75 }
76
77 int ba2str(const bdaddr_t *ba, char *str)
78 {
79         return sprintf(str, "%2.2X:%2.2X:%2.2X:%2.2X:%2.2X:%2.2X",
80                 ba->b[5], ba->b[4], ba->b[3], ba->b[2], ba->b[1], ba->b[0]);
81 }
82
83 int str2ba(const char *str, bdaddr_t *ba)
84 {
85         int i;
86
87         if (bachk(str) < 0) {
88                 memset(ba, 0, sizeof(*ba));
89                 return -1;
90         }
91
92         for (i = 5; i >= 0; i--, str += 3)
93                 ba->b[i] = strtol(str, NULL, 16);
94
95         return 0;
96 }
97
98 int ba2oui(const bdaddr_t *ba, char *str)
99 {
100         return sprintf(str, "%2.2X-%2.2X-%2.2X", ba->b[5], ba->b[4], ba->b[3]);
101 }
102
103 int bachk(const char *str)
104 {
105         if (!str)
106                 return -1;
107
108         if (strlen(str) != 17)
109                 return -1;
110
111         while (*str) {
112                 if (!isxdigit(*str++))
113                         return -1;
114
115                 if (!isxdigit(*str++))
116                         return -1;
117
118                 if (*str == 0)
119                         break;
120
121                 if (*str++ != ':')
122                         return -1;
123         }
124
125         return 0;
126 }
127
128 int baprintf(const char *format, ...)
129 {
130         va_list ap;
131         int len;
132
133         va_start(ap, format);
134         len = vprintf(format, ap);
135         va_end(ap);
136
137         return len;
138 }
139
140 int bafprintf(FILE *stream, const char *format, ...)
141 {
142         va_list ap;
143         int len;
144
145         va_start(ap, format);
146         len = vfprintf(stream, format, ap);
147         va_end(ap);
148
149         return len;
150 }
151
152 int basprintf(char *str, const char *format, ...)
153 {
154         va_list ap;
155         int len;
156
157         va_start(ap, format);
158         len = vsnprintf(str, (~0U) >> 1, format, ap);
159         va_end(ap);
160
161         return len;
162 }
163
164 int basnprintf(char *str, size_t size, const char *format, ...)
165 {
166         va_list ap;
167         int len;
168
169         va_start(ap, format);
170         len = vsnprintf(str, size, format, ap);
171         va_end(ap);
172
173         return len;
174 }
175
176 void *bt_malloc(size_t size)
177 {
178         return malloc(size);
179 }
180
181 void bt_free(void *ptr)
182 {
183         free(ptr);
184 }
185
186 /* Bluetooth error codes to Unix errno mapping */
187 int bt_error(uint16_t code)
188 {
189         switch (code) {
190         case 0:
191                 return 0;
192         case HCI_UNKNOWN_COMMAND:
193                 return EBADRQC;
194         case HCI_NO_CONNECTION:
195                 return ENOTCONN;
196         case HCI_HARDWARE_FAILURE:
197                 return EIO;
198         case HCI_PAGE_TIMEOUT:
199                 return EHOSTDOWN;
200         case HCI_AUTHENTICATION_FAILURE:
201                 return EACCES;
202         case HCI_PIN_OR_KEY_MISSING:
203                 return EINVAL;
204         case HCI_MEMORY_FULL:
205                 return ENOMEM;
206         case HCI_CONNECTION_TIMEOUT:
207                 return ETIMEDOUT;
208         case HCI_MAX_NUMBER_OF_CONNECTIONS:
209         case HCI_MAX_NUMBER_OF_SCO_CONNECTIONS:
210                 return EMLINK;
211         case HCI_ACL_CONNECTION_EXISTS:
212                 return EALREADY;
213         case HCI_COMMAND_DISALLOWED:
214         case HCI_TRANSACTION_COLLISION:
215         case HCI_ROLE_SWITCH_PENDING:
216                 return EBUSY;
217         case HCI_REJECTED_LIMITED_RESOURCES:
218         case HCI_REJECTED_PERSONAL:
219         case HCI_QOS_REJECTED:
220                 return ECONNREFUSED;
221         case HCI_HOST_TIMEOUT:
222                 return ETIMEDOUT;
223         case HCI_UNSUPPORTED_FEATURE:
224         case HCI_QOS_NOT_SUPPORTED:
225         case HCI_PAIRING_NOT_SUPPORTED:
226         case HCI_CLASSIFICATION_NOT_SUPPORTED:
227         case HCI_UNSUPPORTED_LMP_PARAMETER_VALUE:
228         case HCI_PARAMETER_OUT_OF_RANGE:
229         case HCI_QOS_UNACCEPTABLE_PARAMETER:
230                 return EOPNOTSUPP;
231         case HCI_INVALID_PARAMETERS:
232         case HCI_SLOT_VIOLATION:
233                 return EINVAL;
234         case HCI_OE_USER_ENDED_CONNECTION:
235         case HCI_OE_LOW_RESOURCES:
236         case HCI_OE_POWER_OFF:
237                 return ECONNRESET;
238         case HCI_CONNECTION_TERMINATED:
239                 return ECONNABORTED;
240         case HCI_REPEATED_ATTEMPTS:
241                 return ELOOP;
242         case HCI_REJECTED_SECURITY:
243         case HCI_PAIRING_NOT_ALLOWED:
244         case HCI_INSUFFICIENT_SECURITY:
245                 return EACCES;
246         case HCI_UNSUPPORTED_REMOTE_FEATURE:
247                 return EPROTONOSUPPORT;
248         case HCI_SCO_OFFSET_REJECTED:
249                 return ECONNREFUSED;
250         case HCI_UNKNOWN_LMP_PDU:
251         case HCI_INVALID_LMP_PARAMETERS:
252         case HCI_LMP_ERROR_TRANSACTION_COLLISION:
253         case HCI_LMP_PDU_NOT_ALLOWED:
254         case HCI_ENCRYPTION_MODE_NOT_ACCEPTED:
255                 return EPROTO;
256         default:
257                 return ENOSYS;
258         }
259 }
260
261 const char *bt_compidtostr(int compid)
262 {
263         switch (compid) {
264         case 0:
265                 return "Ericsson Technology Licensing";
266         case 1:
267                 return "Nokia Mobile Phones";
268         case 2:
269                 return "Intel Corp.";
270         case 3:
271                 return "IBM Corp.";
272         case 4:
273                 return "Toshiba Corp.";
274         case 5:
275                 return "3Com";
276         case 6:
277                 return "Microsoft";
278         case 7:
279                 return "Lucent";
280         case 8:
281                 return "Motorola";
282         case 9:
283                 return "Infineon Technologies AG";
284         case 10:
285                 return "Cambridge Silicon Radio";
286         case 11:
287                 return "Silicon Wave";
288         case 12:
289                 return "Digianswer A/S";
290         case 13:
291                 return "Texas Instruments Inc.";
292         case 14:
293                 return "Ceva, Inc. (formerly Parthus Technologies, Inc.)";
294         case 15:
295                 return "Broadcom Corporation";
296         case 16:
297                 return "Mitel Semiconductor";
298         case 17:
299                 return "Widcomm, Inc";
300         case 18:
301                 return "Zeevo, Inc.";
302         case 19:
303                 return "Atmel Corporation";
304         case 20:
305                 return "Mitsubishi Electric Corporation";
306         case 21:
307                 return "RTX Telecom A/S";
308         case 22:
309                 return "KC Technology Inc.";
310         case 23:
311                 return "NewLogic";
312         case 24:
313                 return "Transilica, Inc.";
314         case 25:
315                 return "Rohde & Schwarz GmbH & Co. KG";
316         case 26:
317                 return "TTPCom Limited";
318         case 27:
319                 return "Signia Technologies, Inc.";
320         case 28:
321                 return "Conexant Systems Inc.";
322         case 29:
323                 return "Qualcomm";
324         case 30:
325                 return "Inventel";
326         case 31:
327                 return "AVM Berlin";
328         case 32:
329                 return "BandSpeed, Inc.";
330         case 33:
331                 return "Mansella Ltd";
332         case 34:
333                 return "NEC Corporation";
334         case 35:
335                 return "WavePlus Technology Co., Ltd.";
336         case 36:
337                 return "Alcatel";
338         case 37:
339                 return "NXP Semiconductors (formerly Philips Semiconductors)";
340         case 38:
341                 return "C Technologies";
342         case 39:
343                 return "Open Interface";
344         case 40:
345                 return "R F Micro Devices";
346         case 41:
347                 return "Hitachi Ltd";
348         case 42:
349                 return "Symbol Technologies, Inc.";
350         case 43:
351                 return "Tenovis";
352         case 44:
353                 return "Macronix International Co. Ltd.";
354         case 45:
355                 return "GCT Semiconductor";
356         case 46:
357                 return "Norwood Systems";
358         case 47:
359                 return "MewTel Technology Inc.";
360         case 48:
361                 return "ST Microelectronics";
362         case 49:
363                 return "Synopsis";
364         case 50:
365                 return "Red-M (Communications) Ltd";
366         case 51:
367                 return "Commil Ltd";
368         case 52:
369                 return "Computer Access Technology Corporation (CATC)";
370         case 53:
371                 return "Eclipse (HQ Espana) S.L.";
372         case 54:
373                 return "Renesas Electronics Corporation";
374         case 55:
375                 return "Mobilian Corporation";
376         case 56:
377                 return "Terax";
378         case 57:
379                 return "Integrated System Solution Corp.";
380         case 58:
381                 return "Matsushita Electric Industrial Co., Ltd.";
382         case 59:
383                 return "Gennum Corporation";
384         case 60:
385                 return "BlackBerry Limited (formerly Research In Motion)";
386         case 61:
387                 return "IPextreme, Inc.";
388         case 62:
389                 return "Systems and Chips, Inc.";
390         case 63:
391                 return "Bluetooth SIG, Inc.";
392         case 64:
393                 return "Seiko Epson Corporation";
394         case 65:
395                 return "Integrated Silicon Solution Taiwan, Inc.";
396         case 66:
397                 return "CONWISE Technology Corporation Ltd";
398         case 67:
399                 return "PARROT SA";
400         case 68:
401                 return "Socket Mobile";
402         case 69:
403                 return "Atheros Communications, Inc.";
404         case 70:
405                 return "MediaTek, Inc.";
406         case 71:
407                 return "Bluegiga";
408         case 72:
409                 return "Marvell Technology Group Ltd.";
410         case 73:
411                 return "3DSP Corporation";
412         case 74:
413                 return "Accel Semiconductor Ltd.";
414         case 75:
415                 return "Continental Automotive Systems";
416         case 76:
417                 return "Apple, Inc.";
418         case 77:
419                 return "Staccato Communications, Inc.";
420         case 78:
421                 return "Avago Technologies";
422         case 79:
423                 return "APT Licensing Ltd.";
424         case 80:
425                 return "SiRF Technology";
426         case 81:
427                 return "Tzero Technologies, Inc.";
428         case 82:
429                 return "J&M Corporation";
430         case 83:
431                 return "Free2move AB";
432         case 84:
433                 return "3DiJoy Corporation";
434         case 85:
435                 return "Plantronics, Inc.";
436         case 86:
437                 return "Sony Ericsson Mobile Communications";
438         case 87:
439                 return "Harman International Industries, Inc.";
440         case 88:
441                 return "Vizio, Inc.";
442         case 89:
443                 return "Nordic Semiconductor ASA";
444         case 90:
445                 return "EM Microelectronic-Marin SA";
446         case 91:
447                 return "Ralink Technology Corporation";
448         case 92:
449                 return "Belkin International, Inc.";
450         case 93:
451                 return "Realtek Semiconductor Corporation";
452         case 94:
453                 return "Stonestreet One, LLC";
454         case 95:
455                 return "Wicentric, Inc.";
456         case 96:
457                 return "RivieraWaves S.A.S";
458         case 97:
459                 return "RDA Microelectronics";
460         case 98:
461                 return "Gibson Guitars";
462         case 99:
463                 return "MiCommand Inc.";
464         case 100:
465                 return "Band XI International, LLC";
466         case 101:
467                 return "Hewlett-Packard Company";
468         case 102:
469                 return "9Solutions Oy";
470         case 103:
471                 return "GN Netcom A/S";
472         case 104:
473                 return "General Motors";
474         case 105:
475                 return "A&D Engineering, Inc.";
476         case 106:
477                 return "MindTree Ltd.";
478         case 107:
479                 return "Polar Electro OY";
480         case 108:
481                 return "Beautiful Enterprise Co., Ltd.";
482         case 109:
483                 return "BriarTek, Inc.";
484         case 110:
485                 return "Summit Data Communications, Inc.";
486         case 111:
487                 return "Sound ID";
488         case 112:
489                 return "Monster, LLC";
490         case 113:
491                 return "connectBlue AB";
492         case 114:
493                 return "ShangHai Super Smart Electronics Co. Ltd.";
494         case 115:
495                 return "Group Sense Ltd.";
496         case 116:
497                 return "Zomm, LLC";
498         case 117:
499                 return "Samsung Electronics Co. Ltd.";
500         case 118:
501                 return "Creative Technology Ltd.";
502         case 119:
503                 return "Laird Technologies";
504         case 120:
505                 return "Nike, Inc.";
506         case 121:
507                 return "lesswire AG";
508         case 122:
509                 return "MStar Semiconductor, Inc.";
510         case 123:
511                 return "Hanlynn Technologies";
512         case 124:
513                 return "A & R Cambridge";
514         case 125:
515                 return "Seers Technology Co. Ltd";
516         case 126:
517                 return "Sports Tracking Technologies Ltd.";
518         case 127:
519                 return "Autonet Mobile";
520         case 128:
521                 return "DeLorme Publishing Company, Inc.";
522         case 129:
523                 return "WuXi Vimicro";
524         case 130:
525                 return "Sennheiser Communications A/S";
526         case 131:
527                 return "TimeKeeping Systems, Inc.";
528         case 132:
529                 return "Ludus Helsinki Ltd.";
530         case 133:
531                 return "BlueRadios, Inc.";
532         case 134:
533                 return "equinox AG";
534         case 135:
535                 return "Garmin International, Inc.";
536         case 136:
537                 return "Ecotest";
538         case 137:
539                 return "GN ReSound A/S";
540         case 138:
541                 return "Jawbone";
542         case 139:
543                 return "Topcorn Positioning Systems, LLC";
544         case 140:
545                 return "Gimbal Inc. (formerly Qualcomm Labs, Inc. and Qualcomm Retail Solutions, Inc.)";
546         case 141:
547                 return "Zscan Software";
548         case 142:
549                 return "Quintic Corp.";
550         case 143:
551                 return "Stollman E+V GmbH";
552         case 144:
553                 return "Funai Electric Co., Ltd.";
554         case 145:
555                 return "Advanced PANMOBIL Systems GmbH & Co. KG";
556         case 146:
557                 return "ThinkOptics, Inc.";
558         case 147:
559                 return "Universal Electronics, Inc.";
560         case 148:
561                 return "Airoha Technology Corp.";
562         case 149:
563                 return "NEC Lighting, Ltd.";
564         case 150:
565                 return "ODM Technology, Inc.";
566         case 151:
567                 return "ConnecteDevice Ltd.";
568         case 152:
569                 return "zer01.tv GmbH";
570         case 153:
571                 return "i.Tech Dynamic Global Distribution Ltd.";
572         case 154:
573                 return "Alpwise";
574         case 155:
575                 return "Jiangsu Toppower Automotive Electronics Co., Ltd.";
576         case 156:
577                 return "Colorfy, Inc.";
578         case 157:
579                 return "Geoforce Inc.";
580         case 158:
581                 return "Bose Corporation";
582         case 159:
583                 return "Suunto Oy";
584         case 160:
585                 return "Kensington Computer Products Group";
586         case 161:
587                 return "SR-Medizinelektronik";
588         case 162:
589                 return "Vertu Corporation Limited";
590         case 163:
591                 return "Meta Watch Ltd.";
592         case 164:
593                 return "LINAK A/S";
594         case 165:
595                 return "OTL Dynamics LLC";
596         case 166:
597                 return "Panda Ocean Inc.";
598         case 167:
599                 return "Visteon Corporation";
600         case 168:
601                 return "ARP Devices Limited";
602         case 169:
603                 return "Magneti Marelli S.p.A";
604         case 170:
605                 return "CAEN RFID srl";
606         case 171:
607                 return "Ingenieur-Systemgruppe Zahn GmbH";
608         case 172:
609                 return "Green Throttle Games";
610         case 173:
611                 return "Peter Systemtechnik GmbH";
612         case 174:
613                 return "Omegawave Oy";
614         case 175:
615                 return "Cinetix";
616         case 176:
617                 return "Passif Semiconductor Corp";
618         case 177:
619                 return "Saris Cycling Group, Inc";
620         case 178:
621                 return "Bekey A/S";
622         case 179:
623                 return "Clarinox Technologies Pty. Ltd.";
624         case 180:
625                 return "BDE Technology Co., Ltd.";
626         case 181:
627                 return "Swirl Networks";
628         case 182:
629                 return "Meso international";
630         case 183:
631                 return "TreLab Ltd";
632         case 184:
633                 return "Qualcomm Innovation Center, Inc. (QuIC)";
634         case 185:
635                 return "Johnson Controls, Inc.";
636         case 186:
637                 return "Starkey Laboratories Inc.";
638         case 187:
639                 return "S-Power Electronics Limited";
640         case 188:
641                 return "Ace Sensor Inc";
642         case 189:
643                 return "Aplix Corporation";
644         case 190:
645                 return "AAMP of America";
646         case 191:
647                 return "Stalmart Technology Limited";
648         case 192:
649                 return "AMICCOM Electronics Corporation";
650         case 193:
651                 return "Shenzhen Excelsecu Data Technology Co.,Ltd";
652         case 194:
653                 return "Geneq Inc.";
654         case 195:
655                 return "adidas AG";
656         case 196:
657                 return "LG Electronics";
658         case 197:
659                 return "Onset Computer Corporation";
660         case 198:
661                 return "Selfly BV";
662         case 199:
663                 return "Quuppa Oy.";
664         case 200:
665                 return "GeLo Inc";
666         case 201:
667                 return "Evluma";
668         case 202:
669                 return "MC10";
670         case 203:
671                 return "Binauric SE";
672         case 204:
673                 return "Beats Electronics";
674         case 205:
675                 return "Microchip Technology Inc.";
676         case 206:
677                 return "Elgato Systems GmbH";
678         case 207:
679                 return "ARCHOS SA";
680         case 208:
681                 return "Dexcom, Inc.";
682         case 209:
683                 return "Polar Electro Europe B.V.";
684         case 210:
685                 return "Dialog Semiconductor B.V.";
686         case 211:
687                 return "Taixingbang Technology (HK) Co,. LTD.";
688         case 212:
689                 return "Kawantech";
690         case 213:
691                 return "Austco Communication Systems";
692         case 214:
693                 return "Timex Group USA, Inc.";
694         case 215:
695                 return "Qualcomm Technologies, Inc.";
696         case 216:
697                 return "Qualcomm Connected Experiences, Inc.";
698         case 217:
699                 return "Voyetra Turtle Beach";
700         case 218:
701                 return "txtr GmbH";
702         case 219:
703                 return "Biosentronics";
704         case 220:
705                 return "Procter & Gamble";
706         case 221:
707                 return "Hosiden Corporation";
708         case 222:
709                 return "Muzik LLC";
710         case 223:
711                 return "Misfit Wearables Corp";
712         case 224:
713                 return "Google";
714         case 225:
715                 return "Danlers Ltd";
716         case 226:
717                 return "Semilink Inc";
718         case 227:
719                 return "inMusic Brands, Inc";
720         case 228:
721                 return "L.S. Research Inc.";
722         case 229:
723                 return "Eden Software Consultants Ltd.";
724         case 230:
725                 return "Freshtemp";
726         case 231:
727                 return "KS Technologies";
728         case 232:
729                 return "ACTS Technologies";
730         case 233:
731                 return "Vtrack Systems";
732         case 234:
733                 return "Nielsen-Kellerman Company";
734         case 235:
735                 return "Server Technology, Inc.";
736         case 236:
737                 return "BioResearch Associates";
738         case 237:
739                 return "Jolly Logic, LLC";
740         case 238:
741                 return "Above Average Outcomes, Inc.";
742         case 239:
743                 return "Bitsplitters GmbH";
744         case 240:
745                 return "PayPal, Inc.";
746         case 241:
747                 return "Witron Technology Limited";
748         case 242:
749                 return "Aether Things Inc. (formerly Morse Project Inc.)";
750         case 243:
751                 return "Kent Displays Inc.";
752         case 244:
753                 return "Nautilus Inc.";
754         case 245:
755                 return "Smartifier Oy";
756         case 246:
757                 return "Elcometer Limited";
758         case 247:
759                 return "VSN Technologies Inc.";
760         case 248:
761                 return "AceUni Corp., Ltd.";
762         case 249:
763                 return "StickNFind";
764         case 250:
765                 return "Crystal Code AB";
766         case 251:
767                 return "KOUKAAM a.s.";
768         case 252:
769                 return "Delphi Corporation";
770         case 253:
771                 return "ValenceTech Limited";
772         case 254:
773                 return "Reserved";
774         case 255:
775                 return "Typo Products, LLC";
776         case 256:
777                 return "TomTom International BV";
778         case 257:
779                 return "Fugoo, Inc";
780         case 258:
781                 return "Keiser Corporation";
782         case 259:
783                 return "Bang & Olufsen A/S";
784         case 260:
785                 return "PLUS Locations Systems Pty Ltd";
786         case 261:
787                 return "Ubiquitous Computing Technology Corporation";
788         case 262:
789                 return "Innovative Yachtter Solutions";
790         case 263:
791                 return "William Demant Holding A/S";
792         case 264:
793                 return "Chicony Electronics Co., Ltd.";
794         case 265:
795                 return "Atus BV";
796         case 266:
797                 return "Codegate Ltd.";
798         case 267:
799                 return "ERi, Inc.";
800         case 268:
801                 return "Transducers Direct, LLC";
802         case 269:
803                 return "Fujitsu Ten Limited";
804         case 270:
805                 return "Audi AG";
806         case 271:
807                 return "HiSilicon Technologies Co., Ltd.";
808         case 272:
809                 return "Nippon Seiki Co., Ltd.";
810         case 273:
811                 return "Steelseries ApS";
812         case 274:
813                 return "vyzybl Inc.";
814         case 275:
815                 return "Openbrain Technologies, Co., Ltd.";
816         case 276:
817                 return "Xensr";
818         case 277:
819                 return "e.solutions";
820         case 278:
821                 return "1OAK Technologies";
822         case 279:
823                 return "Wimoto Technologies Inc";
824         case 280:
825                 return "Radius Networks, Inc.";
826         case 281:
827                 return "Wize Technology Co., Ltd.";
828         case 282:
829                 return "Qualcomm Labs, Inc.";
830         case 283:
831                 return "Aruba Networks";
832         case 284:
833                 return "Baidu";
834         case 285:
835                 return "Arendi AG";
836         case 286:
837                 return "Skoda Auto a.s.";
838         case 287:
839                 return "Volkswagon AG";
840         case 288:
841                 return "Porsche AG";
842         case 289:
843                 return "Sino Wealth Electronic Ltd.";
844         case 290:
845                 return "AirTurn, Inc.";
846         case 291:
847                 return "Kinsa, Inc.";
848         case 292:
849                 return "HID Global";
850         case 293:
851                 return "SEAT es";
852         case 294:
853                 return "Promethean Ltd.";
854         case 295:
855                 return "Salutica Allied Solutions";
856         case 296:
857                 return "GPSI Group Pty Ltd";
858         case 297:
859                 return "Nimble Devices Oy";
860         case 298:
861                 return "Changzhou Yongse Infotech Co., Ltd";
862         case 299:
863                 return "SportIQ";
864         case 300:
865                 return "TEMEC Instruments B.V.";
866         case 301:
867                 return "Sony Corporation";
868         case 302:
869                 return "ASSA ABLOY";
870         case 303:
871                 return "Clarion Co., Ltd.";
872         case 304:
873                 return "Warehouse Innovations";
874         case 305:
875                 return "Cypress Semiconductor Corporation";
876         case 306:
877                 return "MADS Inc";
878         case 307:
879                 return "Blue Maestro Limited";
880         case 308:
881                 return "Resolution Products, Inc.";
882         case 309:
883                 return "Airewear LLC";
884         case 310:
885                 return "Seed Labs, Inc. (formerly ETC sp. z.o.o.)";
886         case 311:
887                 return "Prestigio Plaza Ltd.";
888         case 312:
889                 return "NTEO Inc.";
890         case 313:
891                 return "Focus Systems Corporation";
892         case 314:
893                 return "Tencent Holdings Limited";
894         case 315:
895                 return "Allegion";
896         case 316:
897                 return "Murata Manufacuring Co., Ltd.";
898         case 317:
899                 return "WirelessWERX";
900         case 318:
901                 return "Nod, Inc.";
902         case 319:
903                 return "B&B Manufacturing Company";
904         case 320:
905                 return "Alpine Electronics (China) Co., Ltd";
906         case 321:
907                 return "FedEx Services";
908         case 322:
909                 return "Grape Systems Inc.";
910         case 323:
911                 return "Bkon Connect";
912         case 324:
913                 return "Lintech GmbH";
914         case 325:
915                 return "Novatel Wireless";
916         case 326:
917                 return "Ciright";
918         case 327:
919                 return "Mighty Cast, Inc.";
920         case 328:
921                 return "Ambimat Electronics";
922         case 329:
923                 return "Perytons Ltd.";
924         case 330:
925                 return "Tivoli Audio, LLC";
926         case 331:
927                 return "Master Lock";
928         case 332:
929                 return "Mesh-Net Ltd";
930         case 333:
931                 return "Huizhou Desay SV Automotive CO., LTD.";
932         case 334:
933                 return "Tangerine, Inc.";
934         case 335:
935                 return "B&W Group Ltd.";
936         case 336:
937                 return "Pioneer Corporation";
938         case 337:
939                 return "OnBeep";
940         case 338:
941                 return "Vernier Software & Technology";
942         case 339:
943                 return "ROL Ergo";
944         case 340:
945                 return "Pebble Technology";
946         case 341:
947                 return "NETATMO";
948         case 342:
949                 return "Accumulate AB";
950         case 343:
951                 return "Anhui Huami Information Technology Co., Ltd.";
952         case 344:
953                 return "Inmite s.r.o.";
954         case 345:
955                 return "ChefSteps, Inc.";
956         case 346:
957                 return "micas AG";
958         case 347:
959                 return "Biomedical Research Ltd.";
960         case 348:
961                 return "Pitius Tec S.L.";
962         case 349:
963                 return "Estimote, Inc.";
964         case 350:
965                 return "Unikey Technologies, Inc.";
966         case 351:
967                 return "Timer Cap Co.";
968         case 352:
969                 return "AwoX";
970         case 353:
971                 return "yikes";
972         case 354:
973                 return "MADSGlobal NZ Ltd.";
974         case 355:
975                 return "PCH International";
976         case 356:
977                 return "Qingdao Yeelink Information Technology Co., Ltd.";
978         case 357:
979                 return "Milwaukee Tool (formerly Milwaukee Electric Tools)";
980         case 358:
981                 return "MISHIK Pte Ltd";
982         case 359:
983                 return "Bayer HealthCare";
984         case 360:
985                 return "Spicebox LLC";
986         case 361:
987                 return "emberlight";
988         case 362:
989                 return "Cooper-Atkins Corporation";
990         case 363:
991                 return "Qblinks";
992         case 364:
993                 return "MYSPHERA";
994         case 365:
995                 return "LifeScan Inc";
996         case 366:
997                 return "Volantic AB";
998         case 367:
999                 return "Podo Labs, Inc";
1000         case 368:
1001                 return "Roche Diabetes Care AG";
1002         case 369:
1003                 return "Amazon Fulfillment Service";
1004         case 370:
1005                 return "Connovate Technology Private Limited";
1006         case 371:
1007                 return "Kocomojo, LLC";
1008         case 372:
1009                 return "Everykey LLC";
1010         case 373:
1011                 return "Dynamic Controls";
1012         case 374:
1013                 return "SentriLock";
1014         case 375:
1015                 return "I-SYST inc.";
1016         case 376:
1017                 return "CASIO COMPUTER CO., LTD.";
1018         case 377:
1019                 return "LAPIS Semiconductor Co., Ltd.";
1020         case 378:
1021                 return "Telemonitor, Inc.";
1022         case 379:
1023                 return "taskit GmbH";
1024         case 380:
1025                 return "Daimler AG";
1026         case 381:
1027                 return "BatAndCat";
1028         case 382:
1029                 return "BluDotz Ltd";
1030         case 383:
1031                 return "XTel ApS";
1032         case 384:
1033                 return "Gigaset Communications GmbH";
1034         case 385:
1035                 return "Gecko Health Innovations, Inc.";
1036         case 386:
1037                 return "HOP Ubiquitous";
1038         case 387:
1039                 return "To Be Assigned";
1040         case 388:
1041                 return "Nectar";
1042         case 389:
1043                 return "bel'apps LLC";
1044         case 390:
1045                 return "CORE Lighting Ltd";
1046         case 391:
1047                 return "Seraphim Sense Ltd";
1048         case 392:
1049                 return "Unico RBC";
1050         case 393:
1051                 return "Physical Enterprises Inc.";
1052         case 394:
1053                 return "Able Trend Technology Limited";
1054         case 395:
1055                 return "Konica Minolta, Inc.";
1056         case 396:
1057                 return "Wilo SE";
1058         case 397:
1059                 return "Extron Design Services";
1060         case 398:
1061                 return "Fitbit, Inc.";
1062         case 399:
1063                 return "Fireflies Systems";
1064         case 400:
1065                 return "Intelletto Technologies Inc.";
1066         case 401:
1067                 return "FDK CORPORATION";
1068         case 402:
1069                 return "Cloudleaf, Inc";
1070         case 403:
1071                 return "Maveric Automation LLC";
1072         case 404:
1073                 return "Acoustic Stream Corporation";
1074         case 405:
1075                 return "Zuli";
1076         case 406:
1077                 return "Paxton Access Ltd";
1078         case 407:
1079                 return "WiSilica Inc";
1080         case 408:
1081                 return "Vengit Limited";
1082         case 409:
1083                 return "SALTO SYSTEMS S.L.";
1084         case 410:
1085                 return "T-Engine Forum";
1086         case 411:
1087                 return "CUBETECH s.r.o.";
1088         case 412:
1089                 return "Cokiya Incorporated";
1090         case 413:
1091                 return "CVS Health";
1092         case 414:
1093                 return "Ceruus";
1094         case 415:
1095                 return "Strainstall Ltd";
1096         case 416:
1097                 return "Channel Enterprises (HK) Ltd.";
1098         case 417:
1099                 return "FIAMM";
1100         case 418:
1101                 return "GIGALANE.CO.,LTD";
1102         case 419:
1103                 return "EROAD";
1104         case 420:
1105                 return "Mine Safety Appliances";
1106         case 421:
1107                 return "Icon Health and Fitness";
1108         case 422:
1109                 return "Asandoo GmbH";
1110         case 423:
1111                 return "ENERGOUS CORPORATION";
1112         case 424:
1113                 return "Taobao";
1114         case 425:
1115                 return "Canon Inc.";
1116         case 426:
1117                 return "Geophysical Technology Inc.";
1118         case 427:
1119                 return "Facebook, Inc.";
1120         case 428:
1121                 return "Nipro Diagnostics, Inc.";
1122         case 429:
1123                 return "FlightSafety International";
1124         case 430:
1125                 return "Earlens Corporation";
1126         case 431:
1127                 return "Sunrise Micro Devices, Inc.";
1128         case 432:
1129                 return "Star Micronics Co., Ltd.";
1130         case 433:
1131                 return "Netizens Sp. z o.o.";
1132         case 434:
1133                 return "Nymi Inc.";
1134         case 435:
1135                 return "Nytec, Inc.";
1136         case 436:
1137                 return "Trineo Sp. z o.o.";
1138         case 437:
1139                 return "Nest Labs Inc.";
1140         case 438:
1141                 return "LM Technologies Ltd";
1142         case 439:
1143                 return "General Electric Company";
1144         case 440:
1145                 return "i+D3 S.L.";
1146         case 441:
1147                 return "HANA Micron";
1148         case 442:
1149                 return "Stages Cycling LLC";
1150         case 443:
1151                 return "Cochlear Bone Anchored Solutions AB";
1152         case 444:
1153                 return "SenionLab AB";
1154         case 445:
1155                 return "Syszone Co., Ltd";
1156         case 446:
1157                 return "Pulsate Mobile Ltd.";
1158         case 447:
1159                 return "Hong Kong HunterSun Electronic Limited";
1160         case 448:
1161                 return "pironex GmbH";
1162         case 449:
1163                 return "BRADATECH Corp.";
1164         case 450:
1165                 return "Transenergooil AG";
1166         case 451:
1167                 return "Bunch";
1168         case 452:
1169                 return "DME Microelectronics";
1170         case 453:
1171                 return "Bitcraze AB";
1172         case 454:
1173                 return "HASWARE Inc.";
1174         case 455:
1175                 return "Abiogenix Inc.";
1176         case 456:
1177                 return "Poly-Control ApS";
1178         case 457:
1179                 return "Avi-on";
1180         case 458:
1181                 return "Laerdal Medical AS";
1182         case 459:
1183                 return "Fetch My Pet";
1184         case 460:
1185                 return "Sam Labs Ltd.";
1186         case 461:
1187                 return "Chengdu Synwing Technology Ltd";
1188         case 462:
1189                 return "HOUWA SYSTEM DESIGN, k.k.";
1190         case 463:
1191                 return "BSH";
1192         case 464:
1193                 return "Primus Inter Pares Ltd";
1194         case 465:
1195                 return "August";
1196         case 466:
1197                 return "Gill Electronics";
1198         case 467:
1199                 return "Sky Wave Design";
1200         case 468:
1201                 return "Newlab S.r.l.";
1202         case 469:
1203                 return "ELAD srl";
1204         case 470:
1205                 return "G-wearables inc.";
1206         case 471:
1207                 return "Squadrone Systems Inc.";
1208         case 472:
1209                 return "Code Corporation";
1210         case 473:
1211                 return "Savant Systems LLC";
1212         case 474:
1213                 return "Logitech International SA";
1214         case 475:
1215                 return "Innblue Consulting";
1216         case 476:
1217                 return "iParking Ltd.";
1218         case 477:
1219                 return "Koninklijke Philips Electronics N.V.";
1220         case 478:
1221                 return "Minelab Electronics Pty Limited";
1222         case 479:
1223                 return "Bison Group Ltd.";
1224         case 480:
1225                 return "Widex A/S";
1226         case 481:
1227                 return "Jolla Ltd";
1228         case 482:
1229                 return "Lectronix, Inc.";
1230         case 483:
1231                 return "Caterpillar Inc";
1232         case 484:
1233                 return "Freedom Innovations";
1234         case 485:
1235                 return "Dynamic Devices Ltd";
1236         case 486:
1237                 return "Technology Solutions (UK) Ltd";
1238         case 487:
1239                 return "IPS Group Inc.";
1240         case 488:
1241                 return "STIR";
1242         case 489:
1243                 return "Sano, Inc";
1244         case 490:
1245                 return "Advanced Application Design, Inc.";
1246         case 491:
1247                 return "AutoMap LLC";
1248         case 492:
1249                 return "Spreadtrum Communications Shanghai Ltd";
1250         case 493:
1251                 return "CuteCircuit LTD";
1252         case 494:
1253                 return "Valeo Service";
1254         case 495:
1255                 return "Fullpower Technologies, Inc.";
1256         case 496:
1257                 return "KloudNation";
1258         case 497:
1259                 return "Zebra Technologies Corporation";
1260         case 498:
1261                 return "Itron, Inc.";
1262         case 499:
1263                 return "The University of Tokyo";
1264         case 500:
1265                 return "UTC Fire and Security";
1266         case 65535:
1267                 return "internal use";
1268         default:
1269                 return "not assigned";
1270         }
1271 }