summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorh.sandeep <h.sandeep@samsung.com>2016-04-07 09:39:01 +0530
committerSandeep Hattiholi <h.sandeep@samsung.com>2016-04-12 01:16:48 -0700
commit9cc0d447358bad2c1be6e5c51d477d938e7ecbf5 (patch)
treef9849cf199e3b962a9e8d5f99826bc9def18fe85 /lib
parent1b52151f0a5f30794e939592489a259808b4ba5a (diff)
downloadbluez-9cc0d447358bad2c1be6e5c51d477d938e7ecbf5.tar.gz
bluez-9cc0d447358bad2c1be6e5c51d477d938e7ecbf5.tar.bz2
bluez-9cc0d447358bad2c1be6e5c51d477d938e7ecbf5.zip
branch:devel/bluetooth/master ================================================ commit 81e16d9fa48dc40f2dcb15aca9ce87ea50d9a85e Author: Injun Yang <injun.yang@samsung.com> Date: Thu Mar 31 17:05:06 2016 +0900 GATT Server : Handle property and write type ============================================== Change-Id: I0d2b69488337b1f393fba43dc1268bd92ea6b6ac Signed-off-by: h.sandeep <h.sandeep@samsung.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/bluetooth.c486
-rw-r--r--lib/bluetooth.h10
-rw-r--r--lib/bnep.h2
-rw-r--r--lib/hci.c36
-rw-r--r--[-rwxr-xr-x]lib/hci.h1
-rw-r--r--lib/hci_lib.h3
-rw-r--r--[-rwxr-xr-x]lib/mgmt.h28
-rw-r--r--lib/sdp.c9
-rw-r--r--lib/uuid.c65
-rw-r--r--lib/uuid.h6
10 files changed, 600 insertions, 46 deletions
diff --git a/lib/bluetooth.c b/lib/bluetooth.c
index 91e714e7..4a569c0f 100644
--- a/lib/bluetooth.c
+++ b/lib/bluetooth.c
@@ -810,7 +810,7 @@ const char *bt_compidtostr(int compid)
case 273:
return "Steelseries ApS";
case 274:
- return "vyzybl Inc.";
+ return "Visybl Inc.";
case 275:
return "Openbrain Technologies, Co., Ltd.";
case 276:
@@ -1082,7 +1082,7 @@ const char *bt_compidtostr(int compid)
case 409:
return "SALTO SYSTEMS S.L.";
case 410:
- return "T-Engine Forum";
+ return "TRON Forum (formerly T-Engine Forum)";
case 411:
return "CUBETECH s.r.o.";
case 412:
@@ -1263,6 +1263,488 @@ const char *bt_compidtostr(int compid)
return "The University of Tokyo";
case 500:
return "UTC Fire and Security";
+ case 501:
+ return "Cool Webthings Limited";
+ case 502:
+ return "DJO Global";
+ case 503:
+ return "Gelliner Limited";
+ case 504:
+ return "Anyka (Guangzhou) Microelectronics Technology Co, LTD";
+ case 505:
+ return "Medtronic, Inc.";
+ case 506:
+ return "Gozio, Inc.";
+ case 507:
+ return "Form Lifting, LLC";
+ case 508:
+ return "Wahoo Fitness, LLC";
+ case 509:
+ return "Kontakt Micro-Location Sp. z o.o.";
+ case 510:
+ return "Radio System Corporation";
+ case 511:
+ return "Freescale Semiconductor, Inc.";
+ case 512:
+ return "Verifone Systems PTe Ltd. Taiwan Branch";
+ case 513:
+ return "AR Timing";
+ case 514:
+ return "Rigado LLC";
+ case 515:
+ return "Kemppi Oy";
+ case 516:
+ return "Tapcentive Inc.";
+ case 517:
+ return "Smartbotics Inc.";
+ case 518:
+ return "Otter Products, LLC";
+ case 519:
+ return "STEMP Inc.";
+ case 520:
+ return "LumiGeek LLC";
+ case 521:
+ return "InvisionHeart Inc.";
+ case 522:
+ return "Macnica Inc.";
+ case 523:
+ return "Jaguar Land Rover Limited";
+ case 524:
+ return "CoroWare Technologies, Inc";
+ case 525:
+ return "Simplo Technology Co., LTD";
+ case 526:
+ return "Omron Healthcare Co., LTD";
+ case 527:
+ return "Comodule GMBH";
+ case 528:
+ return "ikeGPS";
+ case 529:
+ return "Telink Semiconductor Co. Ltd";
+ case 530:
+ return "Interplan Co., Ltd";
+ case 531:
+ return "Wyler AG";
+ case 532:
+ return "IK Multimedia Production srl";
+ case 533:
+ return "Lukoton Experience Oy";
+ case 534:
+ return "MTI Ltd";
+ case 535:
+ return "Tech4home, Lda";
+ case 536:
+ return "Hiotech AB";
+ case 537:
+ return "DOTT Limited";
+ case 538:
+ return "Blue Speck Labs, LLC";
+ case 539:
+ return "Cisco Systems Inc";
+ case 540:
+ return "Mobicomm Inc";
+ case 541:
+ return "Edamic";
+ case 542:
+ return "Goodnet Ltd";
+ case 543:
+ return "Luster Leaf Products Inc";
+ case 544:
+ return "Manus Machina BV";
+ case 545:
+ return "Mobiquity Networks Inc";
+ case 546:
+ return "Praxis Dynamics";
+ case 547:
+ return "Philip Morris Products S.A.";
+ case 548:
+ return "Comarch SA";
+ case 549:
+ return "Nestlé Nespresso S.A.";
+ case 550:
+ return "Merlinia A/S";
+ case 551:
+ return "LifeBEAM Technologies";
+ case 552:
+ return "Twocanoes Labs, LLC";
+ case 553:
+ return "Muoverti Limited";
+ case 554:
+ return "Stamer Musikanlagen GMBH";
+ case 555:
+ return "Tesla Motors";
+ case 556:
+ return "Pharynks Corporation";
+ case 557:
+ return "Lupine";
+ case 558:
+ return "Siemens AG";
+ case 559:
+ return "Huami (Shanghai) Culture Communication CO., LTD";
+ case 560:
+ return "Foster Electric Company, Ltd";
+ case 561:
+ return "ETA SA";
+ case 562:
+ return "x-Senso Solutions Kft";
+ case 563:
+ return "Shenzhen SuLong Communication Ltd";
+ case 564:
+ return "FengFan (BeiJing) Technology Co, Ltd";
+ case 565:
+ return "Qrio Inc";
+ case 566:
+ return "Pitpatpet Ltd";
+ case 567:
+ return "MSHeli s.r.l.";
+ case 568:
+ return "Trakm8 Ltd";
+ case 569:
+ return "JIN CO, Ltd";
+ case 570:
+ return "Alatech Technology";
+ case 571:
+ return "Beijing CarePulse Electronic Technology Co, Ltd";
+ case 572:
+ return "Awarepoint";
+ case 573:
+ return "ViCentra B.V.";
+ case 574:
+ return "Raven Industries";
+ case 575:
+ return "WaveWare Technologies";
+ case 576:
+ return "Argenox Technologies";
+ case 577:
+ return "Bragi GmbH";
+ case 578:
+ return "16Lab Inc";
+ case 579:
+ return "Masimo Corp";
+ case 580:
+ return "Iotera Inc.";
+ case 581:
+ return "Endress+Hauser";
+ case 582:
+ return "ACKme Networks, Inc.";
+ case 583:
+ return "FiftyThree Inc.";
+ case 584:
+ return "Parker Hannifin Corp";
+ case 585:
+ return "Transcranial Ltd";
+ case 586:
+ return "Uwatec AG";
+ case 587:
+ return "Orlan LLC";
+ case 588:
+ return "Blue Clover Devices";
+ case 589:
+ return "M-Way Solutions GmbH";
+ case 590:
+ return "Microtronics Engineering GmbH";
+ case 591:
+ return "Schneider Schreibgeräte GmbH";
+ case 592:
+ return "Sapphire Circuits LLC";
+ case 593:
+ return "Lumo Bodytech Inc.";
+ case 594:
+ return "UKC Technosolution";
+ case 595:
+ return "Xicato Inc.";
+ case 596:
+ return "Playbrush";
+ case 597:
+ return "Dai Nippon Printing Co., Ltd.";
+ case 598:
+ return "G24 Power Limited";
+ case 599:
+ return "AdBabble Local Commerce Inc.";
+ case 600:
+ return "Devialet SA";
+ case 601:
+ return "ALTYOR";
+ case 602:
+ return "University of Applied Sciences Valais/Haute Ecole Valaisanne";
+ case 603:
+ return "Five Interactive, LLC dba Zendo";
+ case 604:
+ return "NetEase (Hangzhou) Network co.Ltd.";
+ case 605:
+ return "Lexmark International Inc.";
+ case 606:
+ return "Fluke Corporation";
+ case 607:
+ return "Yardarm Technologies";
+ case 608:
+ return "SensaRx";
+ case 609:
+ return "SECVRE GmbH";
+ case 610:
+ return "Glacial Ridge Technologies";
+ case 611:
+ return "Identiv, Inc.";
+ case 612:
+ return "DDS, Inc.";
+ case 613:
+ return "SMK Corporation";
+ case 614:
+ return "Schawbel Technologies LLC";
+ case 615:
+ return "XMI Systems SA";
+ case 616:
+ return "Cerevo";
+ case 617:
+ return "Torrox GmbH & Co KG";
+ case 618:
+ return "Gemalto";
+ case 619:
+ return "DEKA Research & Development Corp.";
+ case 620:
+ return "Domster Tadeusz Szydlowski";
+ case 621:
+ return "Technogym SPA";
+ case 622:
+ return "FLEURBAEY BVBA";
+ case 623:
+ return "Aptcode Solutions";
+ case 624:
+ return "LSI ADL Technology";
+ case 625:
+ return "Animas Corp";
+ case 626:
+ return "Alps Electric Co., Ltd.";
+ case 627:
+ return "OCEASOFT";
+ case 628:
+ return "Motsai Research";
+ case 629:
+ return "Geotab";
+ case 630:
+ return "E.G.O. Elektro-Gerätebau GmbH";
+ case 631:
+ return "bewhere inc";
+ case 632:
+ return "Johnson Outdoors Inc";
+ case 633:
+ return "steute Schaltgerate GmbH & Co. KG";
+ case 634:
+ return "Ekomini inc.";
+ case 635:
+ return "DEFA AS";
+ case 636:
+ return "Aseptika Ltd";
+ case 637:
+ return "HUAWEI Technologies Co., Ltd. ( 华为技术有限公司 )";
+ case 638:
+ return "HabitAware, LLC";
+ case 639:
+ return "ruwido austria gmbh";
+ case 640:
+ return "ITEC corporation";
+ case 641:
+ return "StoneL";
+ case 642:
+ return "Sonova AG";
+ case 643:
+ return "Maven Machines, Inc.";
+ case 644:
+ return "Synapse Electronics";
+ case 645:
+ return "Standard Innovation Inc.";
+ case 646:
+ return "RF Code, Inc.";
+ case 647:
+ return "Wally Ventures S.L.";
+ case 648:
+ return "Willowbank Electronics Ltd";
+ case 649:
+ return "SK Telecom";
+ case 650:
+ return "Jetro AS";
+ case 651:
+ return "Code Gears LTD";
+ case 652:
+ return "NANOLINK APS";
+ case 653:
+ return "IF, LLC";
+ case 654:
+ return "RF Digital Corp";
+ case 655:
+ return "Church & Dwight Co., Inc";
+ case 656:
+ return "Multibit Oy";
+ case 657:
+ return "CliniCloud Inc";
+ case 658:
+ return "SwiftSensors";
+ case 659:
+ return "Blue Bite";
+ case 660:
+ return "ELIAS GmbH";
+ case 661:
+ return "Sivantos GmbH";
+ case 662:
+ return "Petzl";
+ case 663:
+ return "storm power ltd";
+ case 664:
+ return "EISST Ltd";
+ case 665:
+ return "Inexess Technology Simma KG";
+ case 666:
+ return "Currant, Inc.";
+ case 667:
+ return "C2 Development, Inc.";
+ case 668:
+ return "Blue Sky Scientific, LLC";
+ case 669:
+ return "ALOTTAZS LABS, LLC";
+ case 670:
+ return "Kupson spol. s r.o.";
+ case 671:
+ return "Areus Engineering GmbH";
+ case 672:
+ return "Impossible Camera GmbH";
+ case 673:
+ return "InventureTrack Systems";
+ case 674:
+ return "LockedUp";
+ case 675:
+ return "Itude";
+ case 676:
+ return "Pacific Lock Company";
+ case 677:
+ return "Tendyron Corporation ( 天地融科技股份有限公司 )";
+ case 678:
+ return "Robert Bosch GmbH";
+ case 679:
+ return "Illuxtron international B.V.";
+ case 680:
+ return "miSport Ltd.";
+ case 681:
+ return "Chargelib";
+ case 682:
+ return "Doppler Lab";
+ case 683:
+ return "BBPOS Limited";
+ case 684:
+ return "RTB Elektronik GmbH & Co. KG";
+ case 685:
+ return "Rx Networks, Inc.";
+ case 686:
+ return "WeatherFlow, Inc.";
+ case 687:
+ return "Technicolor USA Inc.";
+ case 688:
+ return "Bestechnic(Shanghai),Ltd";
+ case 689:
+ return "Raden Inc";
+ case 690:
+ return "JouZen Oy";
+ case 691:
+ return "CLABER S.P.A.";
+ case 692:
+ return "Hyginex, Inc.";
+ case 693:
+ return "HANSHIN ELECTRIC RAILWAY CO.,LTD.";
+ case 694:
+ return "Schneider Electric";
+ case 695:
+ return "Oort Technologies LLC";
+ case 696:
+ return "Chrono Therapeutics";
+ case 697:
+ return "Rinnai Corporation";
+ case 698:
+ return "Swissprime Technologies AG";
+ case 699:
+ return "Koha.,Co.Ltd";
+ case 700:
+ return "Genevac Ltd";
+ case 701:
+ return "Chemtronics";
+ case 702:
+ return "Seguro Technology Sp. z o.o.";
+ case 703:
+ return "Redbird Flight Simulations";
+ case 704:
+ return "Dash Robotics";
+ case 705:
+ return "LINE Corporation";
+ case 706:
+ return "Guillemot Corporation";
+ case 707:
+ return "Techtronic Power Tools Technology Limited";
+ case 708:
+ return "Wilson Sporting Goods";
+ case 709:
+ return "Lenovo (Singapore) Pte Ltd. ( 联想(新加坡) )";
+ case 710:
+ return "Ayatan Sensors";
+ case 711:
+ return "Electronics Tomorrow Limited";
+ case 712:
+ return "VASCO Data Security International, Inc.";
+ case 713:
+ return "PayRange Inc.";
+ case 714:
+ return "ABOV Semiconductor";
+ case 715:
+ return "AINA-Wireless Inc.";
+ case 716:
+ return "Eijkelkamp Soil & Water";
+ case 717:
+ return "BMA ergonomics b.v.";
+ case 718:
+ return "Teva Branded Pharmaceutical Products R&D, Inc.";
+ case 719:
+ return "Anima";
+ case 720:
+ return "3M";
+ case 721:
+ return "Empatica Srl";
+ case 722:
+ return "Afero, Inc.";
+ case 723:
+ return "Powercast Corporation";
+ case 724:
+ return "Secuyou ApS";
+ case 725:
+ return "OMRON Corporation";
+ case 726:
+ return "Send Solutions";
+ case 727:
+ return "NIPPON SYSTEMWARE CO.,LTD.";
+ case 728:
+ return "Neosfar";
+ case 729:
+ return "Fliegl Agrartechnik GmbH";
+ case 730:
+ return "Gilvader";
+ case 731:
+ return "Digi International Inc (R)";
+ case 732:
+ return "DeWalch Technologies, Inc.";
+ case 733:
+ return "Flint Rehabilitation Devices, LLC";
+ case 734:
+ return "Samsung SDS Co., Ltd.";
+ case 735:
+ return "Blur Product Development";
+ case 736:
+ return "University of Michigan";
+ case 737:
+ return "Victron Energy BV";
+ case 738:
+ return "NTT docomo";
+ case 739:
+ return "Carmanah Technologies Corp.";
+ case 740:
+ return "Bytestorm Ltd.";
+ case 741:
+ return "Espressif Incorporated ( 乐鑫信息科技(上海)有限公司 )";
case 65535:
return "internal use";
default:
diff --git a/lib/bluetooth.h b/lib/bluetooth.h
index 852a6b23..3acee0fe 100644
--- a/lib/bluetooth.h
+++ b/lib/bluetooth.h
@@ -119,6 +119,16 @@ struct bt_voice {
#define BT_SNDMTU 12
#define BT_RCVMTU 13
+#ifdef __TIZEN_PATCH__
+#define BT_LE_CONN_PARAM 14
+struct le_conn_param {
+ uint16_t min;
+ uint16_t max;
+ uint16_t latency;
+ uint16_t to_multiplier;
+};
+#endif
+
#define BT_VOICE_TRANSPARENT 0x0003
#define BT_VOICE_CVSD_16BIT 0x0060
diff --git a/lib/bnep.h b/lib/bnep.h
index 0a748361..e7c2c87c 100644
--- a/lib/bnep.h
+++ b/lib/bnep.h
@@ -126,11 +126,9 @@ struct bnep_ext_hdr {
#define BNEPCONNDEL _IOW('B', 201, int)
#define BNEPGETCONNLIST _IOR('B', 210, int)
#define BNEPGETCONNINFO _IOR('B', 211, int)
-#ifdef __TIZEN_PATCH__
#define BNEPGETSUPPFEAT _IOR('B', 212, int)
#define BNEP_SETUP_RESPONSE 0
-#endif
struct bnep_connadd_req {
int sock; /* Connected socket */
diff --git a/lib/hci.c b/lib/hci.c
index c6cc7fc3..70f4cd40 100644
--- a/lib/hci.c
+++ b/lib/hci.c
@@ -592,8 +592,12 @@ static hci_map commands_map[] = {
{ "LE Receiver Test", 228 },
{ "LE Transmitter Test", 229 },
{ "LE Test End", 230 },
+#ifdef __TIZEN_PATCH__
{ "LE Read Maximum Data Length", 231 },
{ "Reserved", 232 },
+#else
+ { "Reserved", 231 },
+#endif
{ NULL }
};
@@ -1085,6 +1089,38 @@ int hci_close_dev(int dd)
/* HCI functions that require open device
* dd - Device descriptor returned by hci_open_dev. */
+#ifdef __TIZEN_PATCH__
+int hci_send_data(int dd, uint16_t handle, uint8_t len, void *data)
+{
+ uint8_t type = HCI_ACLDATA_PKT;
+ hci_acl_hdr ac;
+ struct iovec iv[3];
+ int ivn;
+
+ ac.handle = htobs(handle);
+ ac.dlen= htobs(len);
+
+ iv[0].iov_base = &type;
+ iv[0].iov_len = 1;
+ iv[1].iov_base = &ac;
+ iv[1].iov_len = HCI_ACL_HDR_SIZE;
+ ivn = 2;
+
+ if (len) {
+ iv[2].iov_base = data;
+ iv[2].iov_len = len;
+ ivn = 3;
+ }
+
+ while (writev(dd, iv, ivn) < 0) {
+ if (errno == EAGAIN || errno == EINTR)
+ continue;
+ return -1;
+ }
+ return 0;
+}
+#endif
+
int hci_send_cmd(int dd, uint16_t ogf, uint16_t ocf, uint8_t plen, void *param)
{
uint8_t type = HCI_COMMAND_PKT;
diff --git a/lib/hci.h b/lib/hci.h
index ae7be46d..edc59c07 100755..100644
--- a/lib/hci.h
+++ b/lib/hci.h
@@ -2411,6 +2411,7 @@ struct sockaddr_hci {
#define HCI_CHANNEL_USER 1
#define HCI_CHANNEL_MONITOR 2
#define HCI_CHANNEL_CONTROL 3
+#define HCI_CHANNEL_LOGGING 4
struct hci_filter {
uint32_t type_mask;
diff --git a/lib/hci_lib.h b/lib/hci_lib.h
index c766f118..0febe8ea 100644
--- a/lib/hci_lib.h
+++ b/lib/hci_lib.h
@@ -50,6 +50,9 @@ struct hci_version {
int hci_open_dev(int dev_id);
int hci_close_dev(int dd);
+#ifdef __TIZEN_PATCH__
+int hci_send_data(int dd, uint16_t handle, uint8_t len, void *data);
+#endif
int hci_send_cmd(int dd, uint16_t ogf, uint16_t ocf, uint8_t plen, void *param);
int hci_send_req(int dd, struct hci_request *req, int timeout);
diff --git a/lib/mgmt.h b/lib/mgmt.h
index 09448f56..d55c8b2a 100755..100644
--- a/lib/mgmt.h
+++ b/lib/mgmt.h
@@ -515,6 +515,21 @@ struct mgmt_rp_remove_advertising {
uint8_t instance;
} __packed;
+#define MGMT_OP_GET_ADV_SIZE_INFO 0x0040
+struct mgmt_cp_get_adv_size_info {
+ uint8_t instance;
+ uint32_t flags;
+} __packed;
+#define MGMT_GET_ADV_SIZE_INFO_SIZE 5
+struct mgmt_rp_get_adv_size_info {
+ uint8_t instance;
+ uint32_t flags;
+ uint8_t max_adv_data_len;
+ uint8_t max_scan_rsp_len;
+} __packed;
+
+#define MGMT_OP_START_LIMITED_DISCOVERY 0x0041
+
#define MGMT_EV_CMD_COMPLETE 0x0001
struct mgmt_ev_cmd_complete {
uint16_t opcode;
@@ -792,6 +807,8 @@ static const char *mgmt_op[] = {
"Read Advertising Features",
"Add Advertising",
"Remove Advertising",
+ "Get Advertising Size Information", /* 0x0040 */
+ "Start Limited Discovery",
};
static const char *mgmt_ev[] = {
@@ -803,7 +820,7 @@ static const char *mgmt_ev[] = {
"Index Removed",
"New Settings",
"Class of Device Changed",
- "Local Name Changed", /* 0x0008 */
+ "Local Name Changed", /* 0x0008 */
"New Link Key",
"New Long Term Key",
"Device Connected",
@@ -811,7 +828,7 @@ static const char *mgmt_ev[] = {
"Connect Failed",
"PIN Code Request",
"User Confirm Request",
- "User Passkey Request", /* 0x0010 */
+ "User Passkey Request", /* 0x0010 */
"Authentication Failed",
"Device Found",
"Discovering",
@@ -819,7 +836,7 @@ static const char *mgmt_ev[] = {
"Device Unblocked",
"Device Unpaired",
"Passkey Notify",
- "New Identity Resolving Key",
+ "New Identity Resolving Key", /* 0x0018 */
"New Signature Resolving Key",
"Device Added",
"Device Removed",
@@ -827,7 +844,7 @@ static const char *mgmt_ev[] = {
"Unconfigured Index Added",
"Unconfigured Index Removed",
"New Configuration Options",
- "Extended Index Added",
+ "Extended Index Added", /* 0x0020 */
"Extended Index Removed",
"Local Out Of Band Extended Data Updated",
"Advertising Added",
@@ -1211,8 +1228,10 @@ static const char *mgmt_tizen_op[] = {
"LE Set Scan Parameters",
"Set Voice Setting",
"Get Adv Tx Power",
+#ifdef __TIZEN_PATCH__
"Connect BT 6LOWPAN",
"Disconnect BT 6LOWPAN"
+#endif
};
static const char *mgmt_tizen_ev[] = {
@@ -1228,7 +1247,6 @@ static const char *mgmt_tizen_ev[] = {
"LE Connection Update Failed",
"LE Device Found",
"Multi Adv State Change",
- "BT 6LOWPAN state Change"
};
#endif /* End of __TIZEN_PATCH__ */
diff --git a/lib/sdp.c b/lib/sdp.c
index 2107e288..eb408a94 100644
--- a/lib/sdp.c
+++ b/lib/sdp.c
@@ -932,8 +932,12 @@ int sdp_gen_record_pdu(const sdp_record_t *rec, sdp_buf_t *buf)
void sdp_attr_replace(sdp_record_t *rec, uint16_t attr, sdp_data_t *d)
{
- sdp_data_t *p = sdp_data_get(rec, attr);
+ sdp_data_t *p;
+
+ if (!rec)
+ return;
+ p = sdp_data_get(rec, attr);
if (p) {
rec->attrlist = sdp_list_remove(rec->attrlist, p);
sdp_data_free(p);
@@ -1667,7 +1671,7 @@ void sdp_data_print(sdp_data_t *d)
sdp_data_t *sdp_data_get(const sdp_record_t *rec, uint16_t attrId)
{
- if (rec->attrlist) {
+ if (rec && rec->attrlist) {
sdp_data_t sdpTemplate;
sdp_list_t *p;
@@ -4906,6 +4910,7 @@ int sdp_get_supp_feat(const sdp_record_t *rec, sdp_list_t **seqp)
length = 0;
break;
default:
+ sdp_list_free(subseq, free);
goto fail;
}
diff --git a/lib/uuid.c b/lib/uuid.c
index 4f34b17f..20b67d03 100644
--- a/lib/uuid.c
+++ b/lib/uuid.c
@@ -138,46 +138,35 @@ int bt_uuid_cmp(const bt_uuid_t *uuid1, const bt_uuid_t *uuid2)
*/
int bt_uuid_to_string(const bt_uuid_t *uuid, char *str, size_t n)
{
- if (!uuid) {
+ bt_uuid_t tmp;
+ unsigned int data0;
+ unsigned short data1;
+ unsigned short data2;
+ unsigned short data3;
+ unsigned int data4;
+ unsigned short data5;
+ const uint8_t *data;
+
+ if (!uuid || uuid->type == BT_UUID_UNSPEC) {
snprintf(str, n, "NULL");
return -EINVAL;
}
- switch (uuid->type) {
- case BT_UUID16:
- snprintf(str, n, "%.4x", uuid->value.u16);
- break;
- case BT_UUID32:
- snprintf(str, n, "%.8x", uuid->value.u32);
- break;
- case BT_UUID128: {
- unsigned int data0;
- unsigned short data1;
- unsigned short data2;
- unsigned short data3;
- unsigned int data4;
- unsigned short data5;
-
- const uint8_t *data = (uint8_t *) &uuid->value.u128;
-
- memcpy(&data0, &data[0], 4);
- memcpy(&data1, &data[4], 2);
- memcpy(&data2, &data[6], 2);
- memcpy(&data3, &data[8], 2);
- memcpy(&data4, &data[10], 4);
- memcpy(&data5, &data[14], 2);
-
- snprintf(str, n, "%.8x-%.4x-%.4x-%.4x-%.8x%.4x",
+ /* Convert to 128 Bit format */
+ bt_uuid_to_uuid128(uuid, &tmp);
+ data = (uint8_t *) &tmp.value.u128;
+
+ memcpy(&data0, &data[0], 4);
+ memcpy(&data1, &data[4], 2);
+ memcpy(&data2, &data[6], 2);
+ memcpy(&data3, &data[8], 2);
+ memcpy(&data4, &data[10], 4);
+ memcpy(&data5, &data[14], 2);
+
+ snprintf(str, n, "%.8x-%.4x-%.4x-%.4x-%.8x%.4x",
ntohl(data0), ntohs(data1),
ntohs(data2), ntohs(data3),
ntohl(data4), ntohs(data5));
- }
- break;
- case BT_UUID_UNSPEC:
- default:
- snprintf(str, n, "Type of UUID (%x) unknown.", uuid->type);
- return -EINVAL; /* Enum type of UUID not set */
- }
return 0;
}
@@ -289,7 +278,12 @@ int bt_string_to_uuid(bt_uuid_t *uuid, const char *string)
int bt_uuid_strcmp(const void *a, const void *b)
{
- return strcasecmp(a, b);
+ bt_uuid_t u1, u2;
+
+ bt_string_to_uuid(&u1, a);
+ bt_string_to_uuid(&u2, b);
+
+ return bt_uuid_cmp(&u1, &u2);
}
int bt_uuid_to_le(const bt_uuid_t *src, void *dst)
@@ -301,7 +295,8 @@ int bt_uuid_to_le(const bt_uuid_t *src, void *dst)
bt_put_le16(src->value.u16, dst);
return 0;
case BT_UUID32:
- bt_uuid_to_uuid128(src, &uuid);
+ bt_uuid32_to_uuid128(src, &uuid);
+ src = &uuid;
/* Fallthrough */
case BT_UUID128:
/* Convert from 128-bit BE to LE */
diff --git a/lib/uuid.h b/lib/uuid.h
index 98e96276..542ef606 100644
--- a/lib/uuid.h
+++ b/lib/uuid.h
@@ -109,6 +109,12 @@ extern "C" {
#define OBEX_MNS_UUID "00001133-0000-1000-8000-00805f9b34fb"
#define OBEX_MAP_UUID "00001134-0000-1000-8000-00805f9b34fb"
+#ifdef __TIZEN_PATCH__
+/* Samsung Accessary Protocol UUIDs */
+#define WEARABLE_OLD_SAP_UUID "a49eb41e-cb06-495c-9f4f-aa80a90cdf4a"
+#define WEARABLE_NEW_SAP_UUID "a49eb41e-cb06-495c-9f4f-bb80a90cdf00"
+#endif
+
/* GATT UUIDs section */
#define GATT_PRIM_SVC_UUID 0x2800
#define GATT_SND_SVC_UUID 0x2801