system/bt
Revision | 5f9c140d094ebf4a269cdc6ae083900bf25f7fae (tree) |
---|---|
Zeit | 2013-08-14 11:13:09 |
Autor | Andre Eisenbach <andre@broa...> |
Commiter | Matthew Xie |
LE: Add instance ID to descriptors (2/4)
If a remote devices offers multiple descriptors with the same UUID, the
instance ID is used to differentiate between them.
Change-Id: I1f3c284d714719fe9fb9cbb297c70a061c62a96d
@@ -21,13 +21,13 @@ | ||
21 | 21 | #define BTIF_GATT_UTIL_H |
22 | 22 | |
23 | 23 | void btif_to_bta_uuid(tBT_UUID *p_dest, bt_uuid_t *p_src); |
24 | -void btif_to_bta_char_id(tBTA_GATT_ID *p_dest, btgatt_char_id_t *p_src); | |
24 | +void btif_to_bta_gatt_id(tBTA_GATT_ID *p_dest, btgatt_gatt_id_t *p_src); | |
25 | 25 | void btif_to_bta_srvc_id(tBTA_GATT_SRVC_ID *p_dest, btgatt_srvc_id_t *p_src); |
26 | 26 | void btif_to_bta_response(tBTA_GATTS_RSP *p_dest, btgatt_response_t* p_src); |
27 | 27 | |
28 | 28 | void bta_to_btif_uuid(bt_uuid_t *p_dest, tBT_UUID *p_src); |
29 | 29 | void bta_to_btif_srvc_id(btgatt_srvc_id_t *p_dest, tBTA_GATT_SRVC_ID *p_src); |
30 | -void bta_to_btif_char_id(btgatt_char_id_t *p_dest, tBTA_GATT_ID *p_src); | |
30 | +void bta_to_btif_gatt_id(btgatt_gatt_id_t *p_dest, tBTA_GATT_ID *p_src); | |
31 | 31 | |
32 | 32 | uint16_t set_read_value(btgatt_read_params_t *p_dest, tBTA_GATTC_READ *p_src); |
33 | 33 | uint16_t get_uuid16(tBT_UUID *p_uuid); |
@@ -104,7 +104,8 @@ typedef struct | ||
104 | 104 | bt_bdaddr_t bd_addr; |
105 | 105 | btgatt_srvc_id_t srvc_id; |
106 | 106 | btgatt_srvc_id_t incl_srvc_id; |
107 | - btgatt_char_id_t char_id; | |
107 | + btgatt_gatt_id_t char_id; | |
108 | + btgatt_gatt_id_t descr_id; | |
108 | 109 | bt_uuid_t uuid; |
109 | 110 | uint16_t conn_id; |
110 | 111 | uint16_t len; |
@@ -339,7 +340,7 @@ static void btif_gattc_upstreams_evt(uint16_t event, char* p_param) | ||
339 | 340 | { |
340 | 341 | btgatt_write_params_t data; |
341 | 342 | bta_to_btif_srvc_id(&data.srvc_id, &p_data->write.srvc_id); |
342 | - bta_to_btif_char_id(&data.char_id, &p_data->write.char_id); | |
343 | + bta_to_btif_gatt_id(&data.char_id, &p_data->write.char_id); | |
343 | 344 | |
344 | 345 | HAL_CBACK(bt_gatt_callbacks, client->write_characteristic_cb |
345 | 346 | , p_data->write.conn_id, p_data->write.status, &data |
@@ -385,8 +386,8 @@ static void btif_gattc_upstreams_evt(uint16_t event, char* p_param) | ||
385 | 386 | { |
386 | 387 | btgatt_write_params_t data; |
387 | 388 | bta_to_btif_srvc_id(&data.srvc_id, &p_data->write.srvc_id); |
388 | - bta_to_btif_char_id(&data.char_id, &p_data->write.char_id); | |
389 | - bta_to_btif_uuid(&data.descr_id, &p_data->write.descr_type.uuid); | |
389 | + bta_to_btif_gatt_id(&data.char_id, &p_data->write.char_id); | |
390 | + bta_to_btif_gatt_id(&data.descr_id, &p_data->write.descr_type); | |
390 | 391 | |
391 | 392 | HAL_CBACK(bt_gatt_callbacks, client->write_descriptor_cb |
392 | 393 | , p_data->write.conn_id, p_data->write.status, &data); |
@@ -400,7 +401,7 @@ static void btif_gattc_upstreams_evt(uint16_t event, char* p_param) | ||
400 | 401 | bdcpy(data.bda.address, p_data->notify.bda); |
401 | 402 | |
402 | 403 | bta_to_btif_srvc_id(&data.srvc_id, &p_data->notify.char_id.srvc_id); |
403 | - bta_to_btif_char_id(&data.char_id, &p_data->notify.char_id.char_id); | |
404 | + bta_to_btif_gatt_id(&data.char_id, &p_data->notify.char_id.char_id); | |
404 | 405 | memcpy(data.value, p_data->notify.value, p_data->notify.len); |
405 | 406 | |
406 | 407 | data.is_notify = p_data->notify.is_notify; |
@@ -552,7 +553,6 @@ static void btgattc_handle_event(uint16_t event, char* p_param) | ||
552 | 553 | tBTA_GATTC_INCL_SVC_ID in_incl_svc_id; |
553 | 554 | tBTA_GATTC_INCL_SVC_ID out_incl_svc_id; |
554 | 555 | tBTA_GATT_UNFMT descr_val; |
555 | - static UINT8 descr_inst = 0; | |
556 | 556 | |
557 | 557 | btif_gattc_cb_t* p_cb = (btif_gattc_cb_t*)p_param; |
558 | 558 | if (!p_cb) return; |
@@ -611,13 +611,13 @@ static void btgattc_handle_event(uint16_t event, char* p_param) | ||
611 | 611 | |
612 | 612 | case BTIF_GATTC_GET_FIRST_CHAR: |
613 | 613 | { |
614 | - btgatt_char_id_t char_id; | |
614 | + btgatt_gatt_id_t char_id; | |
615 | 615 | btif_to_bta_srvc_id(&srvc_id, &p_cb->srvc_id); |
616 | 616 | status = BTA_GATTC_GetFirstChar(p_cb->conn_id, &srvc_id, NULL, |
617 | 617 | &out_char_id, &out_char_prop); |
618 | 618 | |
619 | 619 | if (status == 0) |
620 | - bta_to_btif_char_id(&char_id, &out_char_id.char_id); | |
620 | + bta_to_btif_gatt_id(&char_id, &out_char_id.char_id); | |
621 | 621 | |
622 | 622 | HAL_CBACK(bt_gatt_callbacks, client->get_characteristic_cb, |
623 | 623 | p_cb->conn_id, status, &p_cb->srvc_id, |
@@ -627,15 +627,15 @@ static void btgattc_handle_event(uint16_t event, char* p_param) | ||
627 | 627 | |
628 | 628 | case BTIF_GATTC_GET_NEXT_CHAR: |
629 | 629 | { |
630 | - btgatt_char_id_t char_id; | |
630 | + btgatt_gatt_id_t char_id; | |
631 | 631 | btif_to_bta_srvc_id(&in_char_id.srvc_id, &p_cb->srvc_id); |
632 | - btif_to_bta_char_id(&in_char_id.char_id, &p_cb->char_id); | |
632 | + btif_to_bta_gatt_id(&in_char_id.char_id, &p_cb->char_id); | |
633 | 633 | |
634 | 634 | status = BTA_GATTC_GetNextChar(p_cb->conn_id, &in_char_id, NULL, |
635 | 635 | &out_char_id, &out_char_prop); |
636 | 636 | |
637 | 637 | if (status == 0) |
638 | - bta_to_btif_char_id(&char_id, &out_char_id.char_id); | |
638 | + bta_to_btif_gatt_id(&char_id, &out_char_id.char_id); | |
639 | 639 | |
640 | 640 | HAL_CBACK(bt_gatt_callbacks, client->get_characteristic_cb, |
641 | 641 | p_cb->conn_id, status, &p_cb->srvc_id, |
@@ -645,16 +645,15 @@ static void btgattc_handle_event(uint16_t event, char* p_param) | ||
645 | 645 | |
646 | 646 | case BTIF_GATTC_GET_FIRST_CHAR_DESCR: |
647 | 647 | { |
648 | - bt_uuid_t descr_id; | |
648 | + btgatt_gatt_id_t descr_id; | |
649 | 649 | btif_to_bta_srvc_id(&in_char_id.srvc_id, &p_cb->srvc_id); |
650 | - btif_to_bta_char_id(&in_char_id.char_id, &p_cb->char_id); | |
651 | - descr_inst = 0; | |
650 | + btif_to_bta_gatt_id(&in_char_id.char_id, &p_cb->char_id); | |
652 | 651 | |
653 | 652 | status = BTA_GATTC_GetFirstCharDescr(p_cb->conn_id, &in_char_id, NULL, |
654 | 653 | &out_char_descr_id); |
655 | 654 | |
656 | 655 | if (status == 0) |
657 | - bta_to_btif_uuid(&descr_id, &out_char_descr_id.descr_id.uuid); | |
656 | + bta_to_btif_gatt_id(&descr_id, &out_char_descr_id.descr_id); | |
658 | 657 | |
659 | 658 | HAL_CBACK(bt_gatt_callbacks, client->get_descriptor_cb, |
660 | 659 | p_cb->conn_id, status, &p_cb->srvc_id, |
@@ -664,18 +663,16 @@ static void btgattc_handle_event(uint16_t event, char* p_param) | ||
664 | 663 | |
665 | 664 | case BTIF_GATTC_GET_NEXT_CHAR_DESCR: |
666 | 665 | { |
667 | - bt_uuid_t descr_id; | |
666 | + btgatt_gatt_id_t descr_id; | |
668 | 667 | btif_to_bta_srvc_id(&in_char_descr_id.char_id.srvc_id, &p_cb->srvc_id); |
669 | - btif_to_bta_char_id(&in_char_descr_id.char_id.char_id, &p_cb->char_id); | |
670 | - btif_to_bta_uuid(&in_char_descr_id.descr_id.uuid, &p_cb->uuid); | |
671 | - in_char_descr_id.descr_id.inst_id = descr_inst; /* TODO: need app layer input */ | |
672 | - descr_inst ++; | |
668 | + btif_to_bta_gatt_id(&in_char_descr_id.char_id.char_id, &p_cb->char_id); | |
669 | + btif_to_bta_gatt_id(&in_char_descr_id.descr_id, &p_cb->descr_id); | |
673 | 670 | |
674 | 671 | status = BTA_GATTC_GetNextCharDescr(p_cb->conn_id, &in_char_descr_id |
675 | 672 | , NULL, &out_char_descr_id); |
676 | 673 | |
677 | 674 | if (status == 0) |
678 | - bta_to_btif_uuid(&descr_id, &out_char_descr_id.descr_id.uuid); | |
675 | + bta_to_btif_gatt_id(&descr_id, &out_char_descr_id.descr_id); | |
679 | 676 | |
680 | 677 | HAL_CBACK(bt_gatt_callbacks, client->get_descriptor_cb, |
681 | 678 | p_cb->conn_id, status, &p_cb->srvc_id, |
@@ -718,23 +715,22 @@ static void btgattc_handle_event(uint16_t event, char* p_param) | ||
718 | 715 | |
719 | 716 | case BTIF_GATTC_READ_CHAR: |
720 | 717 | btif_to_bta_srvc_id(&in_char_id.srvc_id, &p_cb->srvc_id); |
721 | - btif_to_bta_char_id(&in_char_id.char_id, &p_cb->char_id); | |
718 | + btif_to_bta_gatt_id(&in_char_id.char_id, &p_cb->char_id); | |
722 | 719 | |
723 | 720 | BTA_GATTC_ReadCharacteristic(p_cb->conn_id, &in_char_id, p_cb->auth_req); |
724 | 721 | break; |
725 | 722 | |
726 | 723 | case BTIF_GATTC_READ_CHAR_DESCR: |
727 | 724 | btif_to_bta_srvc_id(&in_char_descr_id.char_id.srvc_id, &p_cb->srvc_id); |
728 | - btif_to_bta_char_id(&in_char_descr_id.char_id.char_id, &p_cb->char_id); | |
729 | - btif_to_bta_uuid(&in_char_descr_id.descr_id.uuid, &p_cb->uuid); | |
730 | - in_char_descr_id.descr_id.inst_id = 0; /* TODO: need app layer input */ | |
725 | + btif_to_bta_gatt_id(&in_char_descr_id.char_id.char_id, &p_cb->char_id); | |
726 | + btif_to_bta_gatt_id(&in_char_descr_id.descr_id, &p_cb->descr_id); | |
731 | 727 | |
732 | 728 | BTA_GATTC_ReadCharDescr(p_cb->conn_id, &in_char_descr_id, p_cb->auth_req); |
733 | 729 | break; |
734 | 730 | |
735 | 731 | case BTIF_GATTC_WRITE_CHAR: |
736 | 732 | btif_to_bta_srvc_id(&in_char_id.srvc_id, &p_cb->srvc_id); |
737 | - btif_to_bta_char_id(&in_char_id.char_id, &p_cb->char_id); | |
733 | + btif_to_bta_gatt_id(&in_char_id.char_id, &p_cb->char_id); | |
738 | 734 | |
739 | 735 | BTA_GATTC_WriteCharValue(p_cb->conn_id, &in_char_id, |
740 | 736 | p_cb->write_type, |
@@ -745,9 +741,8 @@ static void btgattc_handle_event(uint16_t event, char* p_param) | ||
745 | 741 | |
746 | 742 | case BTIF_GATTC_WRITE_CHAR_DESCR: |
747 | 743 | btif_to_bta_srvc_id(&in_char_descr_id.char_id.srvc_id, &p_cb->srvc_id); |
748 | - btif_to_bta_char_id(&in_char_descr_id.char_id.char_id, &p_cb->char_id); | |
749 | - btif_to_bta_uuid(&in_char_descr_id.descr_id.uuid, &p_cb->uuid); | |
750 | - in_char_descr_id.descr_id.inst_id = 0; /* TODO: need app layer input */ | |
744 | + btif_to_bta_gatt_id(&in_char_descr_id.char_id.char_id, &p_cb->char_id); | |
745 | + btif_to_bta_gatt_id(&in_char_descr_id.descr_id, &p_cb->descr_id); | |
751 | 746 | |
752 | 747 | descr_val.len = p_cb->len; |
753 | 748 | descr_val.p_value = p_cb->value; |
@@ -763,7 +758,7 @@ static void btgattc_handle_event(uint16_t event, char* p_param) | ||
763 | 758 | |
764 | 759 | case BTIF_GATTC_REG_FOR_NOTIFICATION: |
765 | 760 | btif_to_bta_srvc_id(&in_char_id.srvc_id, &p_cb->srvc_id); |
766 | - btif_to_bta_char_id(&in_char_id.char_id, &p_cb->char_id); | |
761 | + btif_to_bta_gatt_id(&in_char_id.char_id, &p_cb->char_id); | |
767 | 762 | |
768 | 763 | status = BTA_GATTC_RegisterForNotifications(p_cb->client_if, |
769 | 764 | p_cb->bd_addr.address, &in_char_id); |
@@ -775,7 +770,7 @@ static void btgattc_handle_event(uint16_t event, char* p_param) | ||
775 | 770 | |
776 | 771 | case BTIF_GATTC_DEREG_FOR_NOTIFICATION: |
777 | 772 | btif_to_bta_srvc_id(&in_char_id.srvc_id, &p_cb->srvc_id); |
778 | - btif_to_bta_char_id(&in_char_id.char_id, &p_cb->char_id); | |
773 | + btif_to_bta_gatt_id(&in_char_id.char_id, &p_cb->char_id); | |
779 | 774 | |
780 | 775 | status = BTA_GATTC_DeregisterForNotifications(p_cb->client_if, |
781 | 776 | p_cb->bd_addr.address, &in_char_id); |
@@ -876,7 +871,7 @@ static bt_status_t btif_gattc_search_service(int conn_id, bt_uuid_t *filter_uuid | ||
876 | 871 | } |
877 | 872 | |
878 | 873 | static bt_status_t btif_gattc_get_characteristic( int conn_id |
879 | - , btgatt_srvc_id_t *srvc_id, btgatt_char_id_t *start_char_id) | |
874 | + , btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *start_char_id) | |
880 | 875 | { |
881 | 876 | CHECK_BTGATT_INIT(); |
882 | 877 | btif_gattc_cb_t btif_cb; |
@@ -884,7 +879,7 @@ static bt_status_t btif_gattc_get_characteristic( int conn_id | ||
884 | 879 | memcpy(&btif_cb.srvc_id, srvc_id, sizeof(btgatt_srvc_id_t)); |
885 | 880 | if (start_char_id) |
886 | 881 | { |
887 | - memcpy(&btif_cb.char_id, start_char_id, sizeof(btgatt_char_id_t)); | |
882 | + memcpy(&btif_cb.char_id, start_char_id, sizeof(btgatt_gatt_id_t)); | |
888 | 883 | return btif_transfer_context(btgattc_handle_event, BTIF_GATTC_GET_NEXT_CHAR, |
889 | 884 | (char*) &btif_cb, sizeof(btif_gattc_cb_t), NULL); |
890 | 885 | } |
@@ -893,17 +888,17 @@ static bt_status_t btif_gattc_get_characteristic( int conn_id | ||
893 | 888 | } |
894 | 889 | |
895 | 890 | static bt_status_t btif_gattc_get_descriptor( int conn_id |
896 | - , btgatt_srvc_id_t *srvc_id, btgatt_char_id_t *char_id | |
897 | - , bt_uuid_t *start_descr_id) | |
891 | + , btgatt_srvc_id_t *srvc_id, btgatt_gatt_id_t *char_id | |
892 | + , btgatt_gatt_id_t *start_descr_id) | |
898 | 893 | { |
899 | 894 | CHECK_BTGATT_INIT(); |
900 | 895 | btif_gattc_cb_t btif_cb; |
901 | 896 | btif_cb.conn_id = (uint16_t) conn_id; |
902 | 897 | memcpy(&btif_cb.srvc_id, srvc_id, sizeof(btgatt_srvc_id_t)); |
903 | - memcpy(&btif_cb.char_id, char_id, sizeof(btgatt_char_id_t)); | |
898 | + memcpy(&btif_cb.char_id, char_id, sizeof(btgatt_gatt_id_t)); | |
904 | 899 | if (start_descr_id) |
905 | 900 | { |
906 | - memcpy(&btif_cb.uuid, start_descr_id, sizeof(bt_uuid_t)); | |
901 | + memcpy(&btif_cb.descr_id, start_descr_id, sizeof(btgatt_gatt_id_t)); | |
907 | 902 | return btif_transfer_context(btgattc_handle_event, BTIF_GATTC_GET_NEXT_CHAR_DESCR, |
908 | 903 | (char*) &btif_cb, sizeof(btif_gattc_cb_t), NULL); |
909 | 904 | } |
@@ -930,20 +925,21 @@ static bt_status_t btif_gattc_get_included_service(int conn_id, btgatt_srvc_id_t | ||
930 | 925 | } |
931 | 926 | |
932 | 927 | static bt_status_t btif_gattc_read_char(int conn_id, btgatt_srvc_id_t* srvc_id, |
933 | - btgatt_char_id_t* char_id, int auth_req ) | |
928 | + btgatt_gatt_id_t* char_id, int auth_req ) | |
934 | 929 | { |
935 | 930 | CHECK_BTGATT_INIT(); |
936 | 931 | btif_gattc_cb_t btif_cb; |
937 | 932 | btif_cb.conn_id = (uint16_t) conn_id; |
938 | 933 | btif_cb.auth_req = (uint8_t) auth_req; |
939 | 934 | memcpy(&btif_cb.srvc_id, srvc_id, sizeof(btgatt_srvc_id_t)); |
940 | - memcpy(&btif_cb.char_id, char_id, sizeof(btgatt_char_id_t)); | |
935 | + memcpy(&btif_cb.char_id, char_id, sizeof(btgatt_gatt_id_t)); | |
941 | 936 | return btif_transfer_context(btgattc_handle_event, BTIF_GATTC_READ_CHAR, |
942 | 937 | (char*) &btif_cb, sizeof(btif_gattc_cb_t), NULL); |
943 | 938 | } |
944 | 939 | |
945 | 940 | static bt_status_t btif_gattc_read_char_descr(int conn_id, btgatt_srvc_id_t* srvc_id, |
946 | - btgatt_char_id_t* char_id, bt_uuid_t* descr_id, | |
941 | + btgatt_gatt_id_t* char_id, | |
942 | + btgatt_gatt_id_t* descr_id, | |
947 | 943 | int auth_req ) |
948 | 944 | { |
949 | 945 | CHECK_BTGATT_INIT(); |
@@ -951,14 +947,14 @@ static bt_status_t btif_gattc_read_char_descr(int conn_id, btgatt_srvc_id_t* srv | ||
951 | 947 | btif_cb.conn_id = (uint16_t) conn_id; |
952 | 948 | btif_cb.auth_req = (uint8_t) auth_req; |
953 | 949 | memcpy(&btif_cb.srvc_id, srvc_id, sizeof(btgatt_srvc_id_t)); |
954 | - memcpy(&btif_cb.char_id, char_id, sizeof(btgatt_char_id_t)); | |
955 | - memcpy(&btif_cb.uuid, descr_id, sizeof(bt_uuid_t)); | |
950 | + memcpy(&btif_cb.char_id, char_id, sizeof(btgatt_gatt_id_t)); | |
951 | + memcpy(&btif_cb.descr_id, descr_id, sizeof(btgatt_gatt_id_t)); | |
956 | 952 | return btif_transfer_context(btgattc_handle_event, BTIF_GATTC_READ_CHAR_DESCR, |
957 | 953 | (char*) &btif_cb, sizeof(btif_gattc_cb_t), NULL); |
958 | 954 | } |
959 | 955 | |
960 | 956 | static bt_status_t btif_gattc_write_char(int conn_id, btgatt_srvc_id_t* srvc_id, |
961 | - btgatt_char_id_t* char_id, int write_type, | |
957 | + btgatt_gatt_id_t* char_id, int write_type, | |
962 | 958 | int len, int auth_req, char* p_value) |
963 | 959 | { |
964 | 960 | CHECK_BTGATT_INIT(); |
@@ -968,14 +964,15 @@ static bt_status_t btif_gattc_write_char(int conn_id, btgatt_srvc_id_t* srvc_id, | ||
968 | 964 | btif_cb.write_type = (uint8_t) write_type; |
969 | 965 | btif_cb.len = len > BTGATT_MAX_ATTR_LEN ? BTGATT_MAX_ATTR_LEN : len; |
970 | 966 | memcpy(&btif_cb.srvc_id, srvc_id, sizeof(btgatt_srvc_id_t)); |
971 | - memcpy(&btif_cb.char_id, char_id, sizeof(btgatt_char_id_t)); | |
967 | + memcpy(&btif_cb.char_id, char_id, sizeof(btgatt_gatt_id_t)); | |
972 | 968 | memcpy(btif_cb.value, p_value, btif_cb.len); |
973 | 969 | return btif_transfer_context(btgattc_handle_event, BTIF_GATTC_WRITE_CHAR, |
974 | 970 | (char*) &btif_cb, sizeof(btif_gattc_cb_t), NULL); |
975 | 971 | } |
976 | 972 | |
977 | 973 | static bt_status_t btif_gattc_write_char_descr(int conn_id, btgatt_srvc_id_t* srvc_id, |
978 | - btgatt_char_id_t* char_id, bt_uuid_t* descr_id, | |
974 | + btgatt_gatt_id_t* char_id, | |
975 | + btgatt_gatt_id_t* descr_id, | |
979 | 976 | int write_type, int len, int auth_req, |
980 | 977 | char* p_value) |
981 | 978 | { |
@@ -986,8 +983,8 @@ static bt_status_t btif_gattc_write_char_descr(int conn_id, btgatt_srvc_id_t* sr | ||
986 | 983 | btif_cb.write_type = (uint8_t) write_type; |
987 | 984 | btif_cb.len = len > BTGATT_MAX_ATTR_LEN ? BTGATT_MAX_ATTR_LEN : len; |
988 | 985 | memcpy(&btif_cb.srvc_id, srvc_id, sizeof(btgatt_srvc_id_t)); |
989 | - memcpy(&btif_cb.char_id, char_id, sizeof(btgatt_char_id_t)); | |
990 | - memcpy(&btif_cb.uuid, descr_id, sizeof(bt_uuid_t)); | |
986 | + memcpy(&btif_cb.char_id, char_id, sizeof(btgatt_gatt_id_t)); | |
987 | + memcpy(&btif_cb.descr_id, descr_id, sizeof(btgatt_gatt_id_t)); | |
991 | 988 | memcpy(btif_cb.value, p_value, btif_cb.len); |
992 | 989 | return btif_transfer_context(btgattc_handle_event, BTIF_GATTC_WRITE_CHAR_DESCR, |
993 | 990 | (char*) &btif_cb, sizeof(btif_gattc_cb_t), NULL); |
@@ -1005,28 +1002,28 @@ static bt_status_t btif_gattc_execute_write(int conn_id, int execute) | ||
1005 | 1002 | |
1006 | 1003 | static bt_status_t btif_gattc_reg_for_notification(int client_if, const bt_bdaddr_t *bd_addr, |
1007 | 1004 | btgatt_srvc_id_t* srvc_id, |
1008 | - btgatt_char_id_t* char_id) | |
1005 | + btgatt_gatt_id_t* char_id) | |
1009 | 1006 | { |
1010 | 1007 | CHECK_BTGATT_INIT(); |
1011 | 1008 | btif_gattc_cb_t btif_cb; |
1012 | 1009 | btif_cb.client_if = (uint8_t) client_if; |
1013 | 1010 | bdcpy(btif_cb.bd_addr.address, bd_addr->address); |
1014 | 1011 | memcpy(&btif_cb.srvc_id, srvc_id, sizeof(btgatt_srvc_id_t)); |
1015 | - memcpy(&btif_cb.char_id, char_id, sizeof(btgatt_char_id_t)); | |
1012 | + memcpy(&btif_cb.char_id, char_id, sizeof(btgatt_gatt_id_t)); | |
1016 | 1013 | return btif_transfer_context(btgattc_handle_event, BTIF_GATTC_REG_FOR_NOTIFICATION, |
1017 | 1014 | (char*) &btif_cb, sizeof(btif_gattc_cb_t), NULL); |
1018 | 1015 | } |
1019 | 1016 | |
1020 | 1017 | static bt_status_t btif_gattc_dereg_for_notification(int client_if, const bt_bdaddr_t *bd_addr, |
1021 | 1018 | btgatt_srvc_id_t* srvc_id, |
1022 | - btgatt_char_id_t* char_id) | |
1019 | + btgatt_gatt_id_t* char_id) | |
1023 | 1020 | { |
1024 | 1021 | CHECK_BTGATT_INIT(); |
1025 | 1022 | btif_gattc_cb_t btif_cb; |
1026 | 1023 | btif_cb.client_if = (uint8_t) client_if; |
1027 | 1024 | bdcpy(btif_cb.bd_addr.address, bd_addr->address); |
1028 | 1025 | memcpy(&btif_cb.srvc_id, srvc_id, sizeof(btgatt_srvc_id_t)); |
1029 | - memcpy(&btif_cb.char_id, char_id, sizeof(btgatt_char_id_t)); | |
1026 | + memcpy(&btif_cb.char_id, char_id, sizeof(btgatt_gatt_id_t)); | |
1030 | 1027 | return btif_transfer_context(btgattc_handle_event, BTIF_GATTC_DEREG_FOR_NOTIFICATION, |
1031 | 1028 | (char*) &btif_cb, sizeof(btif_gattc_cb_t), NULL); |
1032 | 1029 | } |
@@ -117,7 +117,7 @@ void btif_to_bta_uuid(tBT_UUID *p_dest, bt_uuid_t *p_src) | ||
117 | 117 | } |
118 | 118 | } |
119 | 119 | |
120 | -void btif_to_bta_char_id(tBTA_GATT_ID *p_dest, btgatt_char_id_t *p_src) | |
120 | +void btif_to_bta_gatt_id(tBTA_GATT_ID *p_dest, btgatt_gatt_id_t *p_src) | |
121 | 121 | { |
122 | 122 | p_dest->inst_id = p_src->inst_id; |
123 | 123 | btif_to_bta_uuid(&p_dest->uuid, &p_src->uuid); |
@@ -182,7 +182,7 @@ void bta_to_btif_uuid(bt_uuid_t *p_dest, tBT_UUID *p_src) | ||
182 | 182 | } |
183 | 183 | |
184 | 184 | |
185 | -void bta_to_btif_char_id(btgatt_char_id_t *p_dest, tBTA_GATT_ID *p_src) | |
185 | +void bta_to_btif_gatt_id(btgatt_gatt_id_t *p_dest, tBTA_GATT_ID *p_src) | |
186 | 186 | { |
187 | 187 | p_dest->inst_id = p_src->inst_id; |
188 | 188 | bta_to_btif_uuid(&p_dest->uuid, &p_src->uuid); |
@@ -227,8 +227,8 @@ uint16_t set_read_value(btgatt_read_params_t *p_dest, tBTA_GATTC_READ *p_src) | ||
227 | 227 | |
228 | 228 | p_dest->status = p_src->status; |
229 | 229 | bta_to_btif_srvc_id(&p_dest->srvc_id, &p_src->srvc_id); |
230 | - bta_to_btif_char_id(&p_dest->char_id, &p_src->char_id); | |
231 | - bta_to_btif_uuid(&p_dest->descr_id, &p_src->descr_type.uuid); | |
230 | + bta_to_btif_gatt_id(&p_dest->char_id, &p_src->char_id); | |
231 | + bta_to_btif_gatt_id(&p_dest->descr_id, &p_src->descr_type); | |
232 | 232 | |
233 | 233 | descr_type = get_uuid16(&p_src->descr_type.uuid); |
234 | 234 |