BtcmSrvGprot.h 97.7 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 1705 1706 1707 1708 1709 1710 1711 1712 1713 1714 1715 1716 1717 1718 1719 1720 1721 1722 1723 1724 1725 1726 1727 1728 1729 1730 1731 1732 1733 1734 1735 1736 1737 1738 1739 1740 1741 1742 1743 1744 1745 1746 1747 1748 1749 1750 1751 1752 1753 1754 1755 1756 1757 1758 1759 1760 1761 1762 1763 1764 1765 1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 1780 1781 1782 1783 1784 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 1805 1806 1807 1808 1809 1810 1811 1812 1813 1814 1815 1816 1817 1818 1819 1820 1821 1822 1823 1824 1825 1826 1827 1828 1829 1830 1831 1832 1833 1834 1835 1836 1837 1838 1839 1840 1841 1842 1843 1844 1845 1846 1847 1848 1849 1850 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878 1879 1880 1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 1929 1930 1931 1932 1933 1934 1935 1936 1937 1938 1939 1940 1941 1942 1943 1944 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974 1975 1976 1977 1978 1979 1980 1981 1982 1983 1984 1985 1986 1987 1988 1989 1990 1991 1992 1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146 2147 2148 2149 2150 2151 2152 2153 2154 2155 2156 2157 2158 2159 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 2239 2240 2241 2242 2243 2244 2245 2246 2247 2248 2249 2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325 2326 2327 2328 2329 2330 2331 2332 2333 2334 2335 2336 2337 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373 2374 2375 2376 2377 2378 2379 2380 2381 2382 2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446 2447 2448 2449 2450 2451 2452 2453 2454 2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553 2554 2555 2556 2557 2558 2559 2560 2561 2562 2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615 2616 2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637 2638 2639 2640 2641 2642 2643 2644 2645 2646 2647 2648 2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662 2663 2664 2665 2666 2667 2668 2669 2670 2671 2672 2673 2674 2675 2676 2677 2678 2679 2680 2681 2682 2683 2684 2685 2686 2687 2688 2689 2690 2691 2692 2693 2694 2695 2696 2697 2698 2699 2700 2701 2702 2703 2704 2705 2706 2707 2708 2709 2710 2711 2712 2713 2714 2715 2716 2717 2718 2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780
/*****************************************************************************
 *  Copyright Statement:
 *  --------------------
 *  This software is protected by Copyright and the information contained
 *  herein is confidential. The software may not be copied and the information
 *  contained herein may not be used or disclosed except with the written
 *  permission of MediaTek Inc. (C) 2005
 *
 *  BY OPENING THIS FILE, BUYER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
 *  THAT THE SOFTWARE/FIRMWARE AND ITS DOCUMENTATIONS ("MEDIATEK SOFTWARE")
 *  RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES ARE PROVIDED TO BUYER ON
 *  AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES,
 *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
 *  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
 *  NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
 *  SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
 *  SUPPLIED WITH THE MEDIATEK SOFTWARE, AND BUYER AGREES TO LOOK ONLY TO SUCH
 *  THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. MEDIATEK SHALL ALSO
 *  NOT BE RESPONSIBLE FOR ANY MEDIATEK SOFTWARE RELEASES MADE TO BUYER'S
 *  SPECIFICATION OR TO CONFORM TO A PARTICULAR STANDARD OR OPEN FORUM.
 *
 *  BUYER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND CUMULATIVE
 *  LIABILITY WITH RESPECT TO THE MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
 *  AT MEDIATEK'S OPTION, TO REVISE OR REPLACE THE MEDIATEK SOFTWARE AT ISSUE,
 *  OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY BUYER TO
 *  MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE. 
 *
 *  THE TRANSACTION CONTEMPLATED HEREUNDER SHALL BE CONSTRUED IN ACCORDANCE
 *  WITH THE LAWS OF THE STATE OF CALIFORNIA, USA, EXCLUDING ITS CONFLICT OF
 *  LAWS PRINCIPLES.  ANY DISPUTES, CONTROVERSIES OR CLAIMS ARISING THEREOF AND
 *  RELATED THERETO SHALL BE SETTLED BY ARBITRATION IN SAN FRANCISCO, CA, UNDER
 *  THE RULES OF THE INTERNATIONAL CHAMBER OF COMMERCE (ICC).
 *
 *****************************************************************************/
/*****************************************************************************
 *
 * Filename:
 * ---------
 * BtcmSrvGprot.h
 *
 * Project:
 * --------
 *   Maui
 *
 * Description:
 * ------------
 *   This file is the header file for external module to use BT CM related apis
 *
 * Author:
 * -------
 * -------
 * 
 *============================================================================
 *             HISTORY
 * Below this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
 *------------------------------------------------------------------------------
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 * removed!
 * removed!
 * removed!
 *
 *------------------------------------------------------------------------------
 * Upper this line, this part is controlled by PVCS VM. DO NOT MODIFY!!
 *============================================================================
 ****************************************************************************/
#ifndef BT_CM_SRV_GPROT_H
#define BT_CM_SRV_GPROT_H

// RHR: add
#include "MMI_features.h"
#include "kal_public_api.h"
#include "kal_general_types.h"
// RHR: add

#include "app_ltlcom.h"
#include "bluetooth_bm_struct.h"
#include "MMIDataType.h"

#ifdef __cplusplus
extern "C"
{
#endif

//#if (defined(__MMI_BT_SUPPORT__) &&  (defined(__BT_VER_21__) ||  defined(__BT_VER_30__)))
    #if (!defined(__MMI_BT_SIMPLE_PAIR__) && !defined(__BT_DISABLE_SSP_SUPPORT__))
    #define __MMI_BT_SIMPLE_PAIR__
    #endif
//#endif

#if !defined(__BT_BOND_CANCEL__) &&!defined(__MMI_BT_SLIM__)
#define __BT_BOND_CANCEL__
#endif

//#ifdef __MMI_BT_SUPPORT__
#define SRV_BT_CM_MASK_DM_RESET           0x00000008

/* bluetooth device name UTF8 buffen length */
#define SRV_BT_CM_BD_FNAME_LEN                     56 /* 18 * 3 + 2 */

/* bluetooth ucs2 name length */
#define SRV_BT_CM_BD_UCS2_NAME_LEN                 (18 + 1)

/* bluetooth device name UCS2 buffer length */
#define SRV_BT_CM_BD_NAME_UCS2_LEN                 (((SRV_BT_CM_BD_FNAME_LEN - 2) / 3) * ENCODING_LENGTH + ENCODING_LENGTH)

/* max paired device number */
#define SRV_BT_CM_MAX_PAIRED_DEVICE_LIST           10

/* max recent used device number */
#if defined(__PLUTO_MMI_PACKAGE__) && defined(__LOW_COST_SUPPORT_COMMON__) // SLIM:memory reduction
#define SRV_BT_CM_MAX_USED_DEVICE_LIST             1
#else
#define SRV_BT_CM_MAX_USED_DEVICE_LIST             10
#endif  // SLIM:memory reduction
/* max device number */
#define SRV_BT_CM_MAX_DEVICE_LIST                  (SRV_BT_CM_MAX_PAIRED_DEVICE_LIST + SRV_BT_CM_MAX_USED_DEVICE_LIST)

/* max searched device in result */
#ifdef __MMI_BT_SLIM__
#define SRV_BT_CM_MAX_DISCOVERY_RESULTS_IN_LIST    10
#else
#define SRV_BT_CM_MAX_DISCOVERY_RESULTS_IN_LIST    15
#endif
/* max profile number */
#define SRV_BT_CM_NUM_OF_PROFILE_UUID              34

/* supported profile number */
#if defined(__PLUTO_MMI_PACKAGE__) && defined(__LOW_COST_SUPPORT_COMMON__) // SLIM:memory reduction
#ifdef __MMI_BT_DIALER_SUPPORT__
#ifdef __MMI_BT_APPLICATION_BQB__
#define SRV_BT_CM_MAX_HOST_SUPPORTED_PROFILE       20
#else
#define SRV_BT_CM_MAX_HOST_SUPPORTED_PROFILE       12
#endif
#else
#define SRV_BT_CM_MAX_HOST_SUPPORTED_PROFILE       10
    #endif
#else
#define SRV_BT_CM_MAX_HOST_SUPPORTED_PROFILE       23
#endif

/* max connection number */
#if defined(__PLUTO_MMI_PACKAGE__) && defined(__LOW_COST_SUPPORT_COMMON__) // SLIM:memory reduction
#ifdef __MMI_BT_DIALER_SUPPORT__
#define SRV_BT_CM_MAX_CONNECTION                   12
#else
#define SRV_BT_CM_MAX_CONNECTION                   6

#endif
#else
#define SRV_BT_CM_MAX_CONNECTION                   30
#endif  // __LOW_COST_SUPPORT_COMMON__

/* <GROUP Bluetooth Profile Service UUID>
   SPP Profile Service UUID */
#define SRV_BT_CM_SPP_PROFILE_UUID                 (0x1101)
/* <GROUP Bluetooth Profile Service UUID>
   LAP Profile Service UUID */
#define SRV_BT_CM_LAP_PROFILE_UUID                 (0x1102)
/* <GROUP Bluetooth Profile Service UUID>
   DUN Profile Service UUID */
#define SRV_BT_CM_DUN_PROFILE_UUID                 (0x1103)
/* <GROUP Bluetooth Profile Service UUID>
   OBEX IR MC SYNC Profile Service UUID */
#define SRV_BT_CM_OBEX_IR_MC_SYNC_SERVICE_UUID     (0x1104)
/* <GROUP Bluetooth Profile Service UUID>
   OBEX Object push Profile Service UUID */
#define SRV_BT_CM_OBEX_OBJECT_PUSH_SERVICE_UUID    (0x1105)
/* <GROUP Bluetooth Profile Service UUID>
   OBEX file transfer Profile Service UUID */
#define SRV_BT_CM_OBEX_FILE_TRANSFER_UUID          (0x1106)
/* <GROUP Bluetooth Profile Service UUID>
   Headset Profile Service UUID */
#define SRV_BT_CM_HS_PROFILE_UUID                  (0x1108)
/* <GROUP Bluetooth Profile Service UUID>
   CTP Profile Service UUID */
#define SRV_BT_CM_CTP_PROFILE_UUID                 (0x1109)
/* <GROUP Bluetooth Profile Service UUID>
   Audio source Profile Service UUID */
#define SRV_BT_CM_AUDIO_SOURCE_UUID                (0x110A)
/* <GROUP Bluetooth Profile Service UUID>
   Audio sink Profile Service UUID */
#define SRV_BT_CM_AUDIO_SINK_UUID                  (0x110B)
/* <GROUP Bluetooth Profile Service UUID>
   AVRCT Profile Service UUID */
#define SRV_BT_CM_AV_REMOTE_CONTROL_TARGET_UUID    (0x110C)
/* <GROUP Bluetooth Profile Service UUID>
   A2DP Profile Service UUID */
#define SRV_BT_CM_ADVANCED_AUDIO_PROFILE_UUID      (0x110D)
/* <GROUP Bluetooth Profile Service UUID>
   AVRCP Profile Service UUID */
#define SRV_BT_CM_AV_REMOTE_CONTROL_UUID           (0x110E)
/* <GROUP Bluetooth Profile Service UUID>
   ICP Profile Service UUID */
#define SRV_BT_CM_ICP_PROFILE_UUID                 (0x1110)
/* <GROUP Bluetooth Profile Service UUID>
   FAX Profile Service UUID */
#define SRV_BT_CM_FAX_PROFILE_UUID                 (0x1111)
/* <GROUP Bluetooth Profile Service UUID>
   Headset AG Profile Service UUID */
#define SRV_BT_CM_HEADSET_AG_SERVICE_UUID          (0x1112)
/* <GROUP Bluetooth Profile Service UUID>
   PAN PANU Profile Service UUID */
#define SRV_BT_CM_PAN_PANU_PROFILE_UUID            (0x1115)
/* <GROUP Bluetooth Profile Service UUID>
   PAN NAP Profile Service UUID */
#define SRV_BT_CM_PAN_NAP_PROFILE_UUID             (0x1116)
/* <GROUP Bluetooth Profile Service UUID>
   PAN GN Profile Service UUID */
#define SRV_BT_CM_PAN_GN_PROFILE_UUID              (0x1117)
/* <GROUP Bluetooth Profile Service UUID>
   Direct printing Profile Service UUID */
#define SRV_BT_CM_DIRECT_PRINTING                  (0x1118)
/* <GROUP Bluetooth Profile Service UUID>
   OBEX imaging Profile Service UUID */
#define SRV_BT_CM_OBEX_IMAGING_UUID                (0x111A)
/* <GROUP Bluetooth Profile Service UUID>
   OBEX imaging responder Profile Service UUID */
#define SRV_BT_CM_OBEX_IMAGING_RESPONDER_UUID      (0x111B)
/* <GROUP Bluetooth Profile Service UUID>
   Handsfree Profile Service UUID */
#define SRV_BT_CM_HF_PROFILE_UUID                  (0x111E)
/* <GROUP Bluetooth Profile Service UUID>
   HFG Profile Service UUID */
#define SRV_BT_CM_HFG_PROFILE_UUID                 (0x111F)
/* <GROUP Bluetooth Profile Service UUID>
   Basic printing Profile Service UUID */
#define SRV_BT_CM_BASIC_PRINTING                   (0x1122)
/* <GROUP Bluetooth Profile Service UUID>
   HID Profile Service UUID */
#define SRV_BT_CM_HID_PROFILE_UUID                 (0x1124)
/* <GROUP Bluetooth Profile Service UUID>
   SIM Access Profile Service UUID */
#define SRV_BT_CM_SIM_ACCESS_PROFILE_UUID          (0x112D)
/* <GROUP Bluetooth Profile Service UUID>
   Phonebook asscess client Profile Service UUID */
#define SRV_BT_CM_OBEX_PBA_PROFILE_CLIENT_UUID     (0x112E)
/* <GROUP Bluetooth Profile Service UUID>
   Phonebook access  Profile Service UUID */
#define SRV_BT_CM_OBEX_PBA_PROFILE_UUID            (0x112F)
/* <GROUP Bluetooth Profile Service UUID>
   BPP Profile Service UUID */
#define SRV_BT_CM_OBEX_BPPS_PROFILE_UUID           (0x1118)
/* <GROUP Bluetooth Profile Service UUID>
   SyncML Profile Service UUID */
#define SRV_BT_CM_MESSAGE_ACCESS_PROFILE_UUID      (0X1134)

#define SRV_BT_CM_MESSAGE_ACCESS_PROFILE_SERVER_UUID      (0X1132)

#define SRV_BT_CM_MESSAGE_NOTIF_SERVER_UUID      (0x1133)
/*
Message access service profile for message
synchronizing from sever
*/
#define SRV_BT_CM_SYNCML_DEV_PROFILE_UUID          (0x1119) 
/* <GROUP Bluetooth Profile Service UUID>
   Object push client Profile Service UUID */
#define SRV_BT_CM_OBEX_OBJECT_PUSH_CLIENT_UUID     (0xfffd)
/* <GROUP Bluetooth Profile Service UUID>
   OBEX file transfer client Profile Service UUID */
#define SRV_BT_CM_OBEX_FILE_TRANSFER_CLIENT_UUID   (0xfffe)
/* <GROUP Bluetooth Profile Service UUID>
   MAX Profile Service UUID */
#define SRV_BT_CM_MAX_PROFILE_UUID                 (0xffff)

/* class of device bit mask */

/* <GROUP Major Service Mask>
postioning major service mask */
#define SRV_BT_POSTIONING_MAJOR_SERVICE_MASK                            (0x010000)
/* <GROUP Major Service Mask>
networking major service mask */
#define SRV_BT_NETWORKING_MAJOR_SERVICE_MASK                            (0x020000)
/* <GROUP Major Service Mask>
rendering major service mask */
#define SRV_BT_RENDERING_MAJOR_SERVICE_MASK                                (0x040000)
/* <GROUP Major Service Mask>
capturing major service mask */
#define SRV_BT_CAPTURING_MAJOR_SERVICE_MASK                                (0x080000)
/* <GROUP Major Service Mask>
object transfer major service mask */
#define SRV_BT_OBJECT_TRANSFER_MAJOR_SERVICE_MASK                        (0x100000)
/* <GROUP Major Service Mask>
audio major service mask */
#define SRV_BT_AUDIO_MAJOR_SERVICE_MASK                                    (0x200000)
/* <GROUP Major Service Mask>
telephony major service mask */
#define SRV_BT_TELEPHONY_MAJOR_SERVICE_MASK                                (0x400000)
/* <GROUP Major Service Mask>
information major service mask */
#define SRV_BT_INFORMATION_MAJOR_SERVICE_MASK                            (0x800000)


/* <GROUP Major Device Mask>
miscellaneous major device mask */
#define SRV_BT_MISCELLANEOUS_MAJOR_DEVICE_MASK                            (0x000000)
/* <GROUP Major Device Mask>
computer major device mask */
#define SRV_BT_COMPUTER_MAJOR_DEVICE_MASK                                (0x000100)
/* <GROUP Major Device Mask>
phone major device mask */
#define SRV_BT_PHONE_MAJOR_DEVICE_MASK                                    (0x000200)
/* <GROUP Major Device Mask>
LAN major device mask */
#define SRV_BT_LAN_MAJOR_DEVICE_MASK                                    (0x000300)
/* <GROUP Major Device Mask>
AV major device mask */
#define SRV_BT_AV_MAJOR_DEVICE_MASK                                        (0x000400)
/* <GROUP Major Device Mask>
peripheral major device mask */
#define SRV_BT_PERIPHERAL_MAJOR_DEVICE_MASK                                (0x000500)
/* <GROUP Major Device Mask>
imaging major device mask */
#define SRV_BT_IMAGING_MAJOR_DEVICE_MASK                                (0x000600)
/* <GROUP Major Device Mask>
unclassified major device mask */
#define SRV_BT_UNCLASSIFIED_MAJOR_DEVICE_MASK                            (0x001F00)

/* <GROUP Minor Device    Mask under computer major class>
desktop workstation minor device mask */
#define SRV_BT_DESKTOP_WORKSTATION_MINOR_DEVICE_MASK                    (0x000004)
/* <GROUP Minor Device    Mask under computer major class>
server class computer minor device mask */
#define SRV_BT_SERVER_CLASS_COMPUTER_MINOR_DEVICE_MASK                    (0x000008)
/* <GROUP Minor Device    Mask under computer major class>
laptop minor device mask */
#define SRV_BT_LAPTOP_MINOR_DEVICE_MASK                                    (0x00000C)
/* <GROUP Minor Device    Mask under computer major class>
handhelp PC PDA minor device mask */
#define SRV_BT_HANDHELP_PC_PDA_MINOR_DEVICE_MASK                        (0x000010)
/* <GROUP Minor Device    Mask under computer major class>
palm sized PC PDA minor device mask */
#define SRV_BT_PALM_SIZED_PC_PDA_MINOR_DEVICE_MASK                        (0x000014)
/* <GROUP Minor Device    Mask under computer major class>
unclassified computer minor device mask */
#define    SRV_BT_UNCLASSIFIED_COMPUTER_MINOR_DEVICE_MASK                    (0x000000)


/* <GROUP Minor Device    Mask under phone major class>
cellular minor device mask */
#define SRV_BT_CELLULAR_MINOR_DEVICE_MASK                                (0x000004)
/* <GROUP Minor Device    Mask under phone major class>
cordless minor device mask */
#define SRV_BT_CORDLESS_MINOR_DEVICE_MASK                                (0x000008)
/* <GROUP Minor Device    Mask under phone major class>
smart phone minor device mask */
#define SRV_BT_SMART_PHONE_MINOR_DEVICE_MASK                            (0x00000C)
/* <GROUP Minor Device    Mask under phone major class>
wired modem or voice gateway minor device mask */
#define SRV_BT_WIRED_MODEM_OR_VOICE_GATEWAY_MINOR_DEVICE_MASK            (0x000010)    
/* <GROUP Minor Device    Mask under phone major class>
unclassified phone minor device mask */
#define    SRV_BT_UNCLASSIFIED_PHONE_MINOR_DEVICE_MASK                        (0x000000)


/* <GROUP Minor Device    Mask under audio/video major class>
uncategorised AV minor device mask */
#define    SRV_BT_UNCATEGORISED_AV_MINOR_DEVICE_MASK                        (0x000000)
/* <GROUP Minor Device    Mask under audio/video major class>
wearable headset AV minor device mask */
#define SRV_BT_WEARABLE_HEADSET_AV_MINOR_DEVICE_CLASS                    (0x000004)
/* <GROUP Minor Device    Mask under audio/video major class>
handsfree AV minor device mask */
#define SRV_BT_HANDSFREE_AV_MINOR_DEVICE_CLASS                            (0x000008)
/* <GROUP Minor Device    Mask under audio/video major class>
microphone AV minor device mask */
#define SRV_BT_MICROPHONE_AV_MINOR_DEVICE_CLASS                            (0x000010)
/* <GROUP Minor Device    Mask under audio/video major class>
loudspeaker AV minor device mask */
#define SRV_BT_LOUDSPEAKER_AV_MINOR_DEVICE_CLASS                        (0x000014)
/* <GROUP Minor Device    Mask under audio/video major class>
headphone AV minor device mask */
#define SRV_BT_HEADPHONES_AV_MINOR_DEVICE_CLASS                            (0x000018)
/* <GROUP Minor Device    Mask under audio/video major class>
portable audio AV minor device mask */
#define SRV_BT_PORTABLE_AUDIO_AV_MINOR_DEVICE_CLASS                        (0x00001C)
/* <GROUP Minor Device    Mask under audio/video major class>
car audio AV minor device mask */
#define SRV_BT_CAR_AUDIO_AV_MINOR_DEVICE_CLASS                            (0x000020)
/* <GROUP Minor Device    Mask under audio/video major class>
settop box AV minor device mask */
#define SRV_BT_SETTOP_BOX_AV_MINOR_DEVICE_CLASS                            (0x000024)
/* <GROUP Minor Device    Mask under audio/video major class>
hifi audio AV minor device mask */
#define SRV_BT_HIFI_AUDIO_AV_MINOR_DEVICE_CLASS                            (0x000028)
/* <GROUP Minor Device    Mask under audio/video major class>
VCR AV minor device mask */
#define SRV_BT_VCR_AV_MINOR_DEVICE_CLASS                                (0x00002C)
/* <GROUP Minor Device    Mask under audio/video major class>
video camera AV minor device mask */
#define SRV_BT_VIDEO_CAMERA_AV_MINOR_DEVICE_CLASS                        (0x000030)
/* <GROUP Minor Device    Mask under audio/video major class>
camcorder AV minor device mask */
#define SRV_BT_CAMCORDER_AV_MINOR_DEVICE_CLASS                            (0x000034)
/* <GROUP Minor Device    Mask under audio/video major class>
video monitor AV minor device mask */
#define SRV_BT_VIDEO_MONITOR_AV_MINOR_DEVICE_CLASS                        (0x000038)
/* <GROUP Minor Device    Mask under audio/video major class>
video display and loudspeaker AV minor device mask */
#define SRV_BT_VIDEO_DISPLAY_AND_LOUDSPEAKER_AV_MINOR_DEVICE_CLASS        (0x00003C)
/* <GROUP Minor Device    Mask under audio/video major class>
video conferencing AV minor device mask */
#define SRV_BT_VIDEO_CONFERENCING_AV_MINOR_DEVICE_CLASS                    (0x000040)
/* <GROUP Minor Device    Mask under audio/video major class>
game toy AV minor device mask */
#define SRV_BT_GAME_TOY_AV_MINOR_DEVICE_CLASS                            (0x000048)

/* <GROUP Minor Device    Mask under LAN major class>
fully available minor device mask */
#define SRV_BT_FULLY_AVAILABLE_MINOR_DEVICE_MASK                        (0x000000) 
/* <GROUP Minor Device    Mask under LAN major class>
one to seventeen percent minor device mask */
#define SRV_BT_ONE_TO_SEVENTEEN_PERCENT_MINOR_DEVICE_MASK                (0x000020)
/* <GROUP Minor Device    Mask under LAN major class>
seventeen to thirtythree percent minor device mask */
#define SRV_BT_SEVENTEEN_TO_THIRTYTHREE_PERCENT_MINOR_DEVICE_MASK        (0x000040)
/* <GROUP Minor Device    Mask under LAN major class>
thirtythree to fifty percent minor device mask */
#define SRV_BT_THIRTYTHREE_TO_FIFTY_PERCENT_MINOR_DEVICE_MASK            (0x000060)
/* <GROUP Minor Device    Mask under LAN major class>
fifty to sixtyseven percent minor device mask */
#define SRV_BT_FIFTY_TO_SIXTYSEVEN_PERCENT_MINOR_DEVICE_MASK            (0x000080)
/* <GROUP Minor Device    Mask under LAN major class>
sixtyseven to eightythree percent minor device mask */
#define SRV_BT_SIXTYSEVEN_TO_EIGHTYTHREE_PERCENT_MINOR_DEVICE_MASK        (0x0000A0)
/* <GROUP Minor Device    Mask under LAN major class>
eightythree to ninetynine percent minor device mask */
#define SRV_BT_EIGHTYTHREE_TO_NINETYNINE_PERCENT_MINOR_DEVICE_MASK        (0x0000C0)
/* <GROUP Minor Device    Mask under LAN major class>
no service available minor device mask */
#define SRV_BT_NO_SERVICE_AVAILABLE_MINOR_DEVICE_MASK                    (0x0000E0)
/* <GROUP Minor Device    Mask under LAN major class>
unclassified LAN minor device mask */
#define    SRV_BT_UNCLASSIFIED_LAN_MINOR_DEVICE_MASK                        (0x000000)

/* <GROUP Minor Device Mask under Peripheral major Class (Keyboard/pointing device filed)>
joystick peripheral minor device mask */
#define SRV_BT_JOYSTICK_PERIPHERALS_MINOR_DEVICE_CLASS                    (0x000004)
/* <GROUP Minor Device Mask under Peripheral major Class (Keyboard/pointing device filed)>
gamepad device peripheral minor device mask */
#define SRV_BT_GAMEPAD_DEVICE_PERIPHERAL_MINOR_DEVICE_CLASS                (0x000008)
/* <GROUP Minor Device Mask under Peripheral major Class (Keyboard/pointing device filed)>
remote control device peripheral minor device mask */
#define SRV_BT_REMOTE_CONTRO_DEVICE_PERIPHERAL_MINOR_DEVICE_CLASS        (0x00000C)
/* <GROUP Minor Device Mask under Peripheral major Class (Keyboard/pointing device filed)>
sensing device peripheral minor device mask */
#define SRV_BT_SENSING_DEVICE_PERIPHERAL_MINOR_DEVICE_CLASS                (0x000010)
/* <GROUP Minor Device Mask under Peripheral major Class (Keyboard/pointing device filed)>
digitizer tablet peripheral minor device mask */
#define SRV_BT_DIGITIZER_TABLET_PERIPHERAL_MINOR_DEVICE_CLASS            (0x000014)
/* <GROUP Minor Device Mask under Peripheral major Class (Keyboard/pointing device filed)>
card reader peripheral minor device mask */
#define SRV_BT_CARD_READER_PERIPHERAL_MINOR_DEVICE_CLASS                (0x000018)

/* <GROUP Minor Device Mask under Imaging major Class (printing, scanner, caramera...)>
display imaging minor device mask */
#define SRV_BT_DISPLAY_IMAGING_MINOR_DEVICE_CLASS                        (0x000010)
/* <GROUP Minor Device Mask under Imaging major Class (printing, scanner, caramera...)>
camera imaging minor device mask */
#define SRV_BT_CAMERA_IMAGING_MINOR_DEVICE_CLASS                        (0x000020)
/* <GROUP Minor Device Mask under Imaging major Class (printing, scanner, caramera...)>
scanner imaging minor device mask */
#define SRV_BT_SCANNER_IMAGING_MINOR_DEVICE_CLASS                        (0x000040)
/* <GROUP Minor Device Mask under Imaging major Class (printing, scanner, caramera...)>
printer imaging minor device mask */
#define SRV_BT_PRINTER_IMAGING_MINOR_DEVICE_CLASS                        (0x000080)



//#define SRV_BT_CM_SEC_ON                        SRV_BT_CM_SEC_MODE3_LINK
//#define SRV_BT_CM_SEC_OFF                       SRV_BT_CM_SEC_MODE1_NON_SECURE

#define SRV_BT_CM_MAX_INSTANCE_NUM (20)

#define  MMI_BT_ASSERT(a)  ASSERT(a)
#ifdef __MMI_A2DP_SUPPORT__
#define __MMI_BT_CM_CONNECT_EXCLUDE_A2DP__
#endif
/* the security mode */
typedef enum
{
    SRV_BT_CM_SEC_MODE0_OFF,                    /* security mode off */
    SRV_BT_CM_SEC_MODE1_NON_SECURE,             /* security mode non secure */
    SRV_BT_CM_SEC_MODE2_SERVICE,                /* security mode service level */
    SRV_BT_CM_SEC_MODE3_LINK,                   /* security mode link level */
    SRV_BT_CM_SEC_MODE4_SIMPLE,                 /* security mode simple */
    SRV_BT_CM_SEC_TOTAL                         /* security mode total */
} srv_bt_cm_security_mode_enum;

/* operation type enum */
typedef enum
{
    SRV_BT_CM_OPER_TYPE_POWER_ON,               /* power on */
    SRV_BT_CM_OPER_TYPE_RESTORE,                /* restore state */
    SRV_BT_CM_OPER_TYPE_SET_HOST_DEV_NAME,      /* setting host device name */
    SRV_BT_CM_OPER_TYPE_SET_DISCOVERABLE_MODE,  /* set discoverable mode */
    SRV_BT_CM_OPER_TYPE_TOTAL                   /* last enum for operation type */
} srv_bt_cm_oper_type_enum;

/* authorize type enum */
typedef enum
{
    SRV_BT_CM_AUTHORIZE_ALWAYS_ASK,             /* always ask */
    SRV_BT_CM_AUTHORIZE_ALWAYS_CONNECT,         /* always connect */
    SRV_BT_CM_AUTHORIZE_ALWAYS_REJECT,          /* always reject */
    SRV_BT_CM_AUTHORIZE_TOTAL                   /* last enum for authorize type */
} srv_bt_cm_authorize_type;

/* visibility type enum */
typedef enum
{
    SRV_BT_CM_VISIBILITY_ON = 1, /* visibility on, can be discovered by other bt device */

//#ifdef __MMI_BT_TEMP_VISIBILITY__

    SRV_BT_CM_VISIBILITY_TEMPORARY_ON, /* visibility temporary on, can be discovered by other bt device for some time */

//#endif  /* __MMI_BT_TEMP_VISIBILITY__ */

    SRV_BT_CM_VISIBILITY_OFF,   /* visibility off, can not be discovered by other bt device */
    SRV_BT_CM_VISIBILITY_TOTAL  /* last enum for visibility type */
} srv_bt_cm_visibility_type;

/* result type from BT BM enum */
typedef enum
{
    SRV_BT_CM_BTBM_SUCCESS   = BTBM_ADP_SUCCESS,   /* success */
    SRV_BT_CM_BTBM_FAILED    = BTBM_ADP_FAILED,    /* failed */
    SRV_BT_CM_BTBM_BUSY      = BTBM_ADP_BUSY,      /* busy */
    SRV_BT_CM_BTBM_NOT_ALLOW = BTBM_ADP_NOT_ALLOW, /* not allow */
    SRV_BT_CM_EXCEED_MAX_PAIRED_DEVICE_NUM,        /* exceed max device num */
    SRV_BT_CM_BTBM_DEVICE_FULL                     /* device full */
} srv_bt_cm_btbm_result_enum;

/* BT CM current state enum */
typedef enum
{
    SRV_BT_CM_STATE_INIT_ON,                           /* 0 */
    SRV_BT_CM_STATE_DEACTIVATING,                      /* 1 */
    SRV_BT_CM_STATE_ACTIVATING,                        /* 2 */
    SRV_BT_CM_STATE_ACTIVATING_WRITE_SCAN_ENABLE,      /* 3 */
    SRV_BT_CM_STATE_ACTIVATING_WRITE_SCAN_DISABLE,     /* 4 */
    SRV_BT_CM_STATE_IDLE,                              /* 5 */
    SRV_BT_CM_STATE_INQUIRING,                         /* 6 */
    SRV_BT_CM_STATE_INQUIR_RES_IND,                    /* 7 */
    SRV_BT_CM_STATE_INQUIR_CANCELLING,                 /* 8 */
    SRV_BT_CM_STATE_BONDING,                           /* 9 */
    SRV_BT_CM_STATE_PAIRING,                           /* 10 */
    SRV_BT_CM_STATE_SDC_SEARCHING,                     /* 11 */
    SRV_BT_CM_STATE_CONNECTING,                        /* 12 */
    SRV_BT_CM_STATE_DEBONDING,                         /* 13 */
    SRV_BT_CM_STATE_DELETING,                          /* 14 */
    SRV_BT_CM_STATE_DELETING_ALL,                      /* 15 */
    SRV_BT_CM_STATE_DISCONNECTING,                     /* 16 */
    SRV_BT_CM_STATE_PASSKEY_IND,                       /* 17 */
    SRV_BT_CM_STATE_PASSKEY_RES,                       /* 18 */
    SRV_BT_CM_STATE_NUMERIC_CONFIRM,                   /* 19 */
    SRV_BT_CM_STATE_NUMERIC_CONFIRM_RSP,               /* 20 */
    SRV_BT_CM_STATE_PASSKEY_NOTIFY,                    /* 21 */
    SRV_BT_CM_STATE_KEYPRESS_NOTIFY_CANCEL,            /* 22 */
    SRV_BT_CM_STATE_BLOCK_DEVICE_LINK,                 /* 23 */
    SRV_BT_CM_STATE_UNBLOCK_DEVICE_LINK,               /* 24 */
    SRV_BT_CM_STATE_CONNECT_ACCEPT_CONFIRM_IND,        /* 25 */
    SRV_BT_CM_STATE_SDC_REFRESHING,                    /* 26 */
    SRV_BT_CM_STATE_VISIBILITY_SETTING,                /* 27 */
    SRV_BT_CM_STATE_DISCOVERABLE_MODE_SETTING,         /* 28 */
    SRV_BT_CM_STATE_HOST_NAME_SETTING,                 /* 29 */
    SRV_BT_CM_STATE_AUTHENTICATION_SETTING,            /* 30 */
    SRV_BT_CM_STATE_RELEASE_ALL_CONNECTION,            /* 31 */
    SRV_BT_CM_STATE_RELEASE_DEV_CONNECTION,            /* 32 */
    SRV_BT_CM_STATE_SETTING_LIMIT_VISIBILITY,          /* 33 */
    SRV_BT_CM_STATE_RESETTING_LIMIT_VISIBILITY,        /* 34 */
    SRV_BT_CM_STATE_READING_REMOTE_DEV_NAME,           /* 35 */
    SRV_BT_CM_STATE_ACTIVATING_PROFILES,               /* 36 */

 #ifdef __BT_BOND_CANCEL__
    SRV_BT_CM_STATE_BONDING_CANCEL,                    /* 37 */
 #endif

    SRV_BT_CM_STATE_TOTAL                              /* 38 */
} srv_bt_cm_state_enum;

/* BT CM connection type enum */
typedef enum
{
    SRV_BT_CM_NO_CONNECTION,          /* 0 */
    SRV_BT_CM_HFP_CONNECTION,         /* 1 */
    SRV_BT_CM_HSP_CONNECTION,         /* 2 */
    SRV_BT_CM_SPP_CONNECTION,         /* 3 */
    SRV_BT_CM_DUN_CONNECTION,         /* 4 */
    SRV_BT_CM_FTP_CONNECTION,         /* 5 */
    SRV_BT_CM_OPP_CONNECTION,         /* 6 */
    SRV_BT_CM_A2DP_CONNECTION,        /* 7 */
    SRV_BT_CM_A2DP_SINK_CONNECTION,
    SRV_BT_CM_AVRCP_CONNECTION,       /* 8 */
    SRV_BT_CM_AVRCP_CT_CONNECTION,    /* 9 */
    SRV_BT_CM_BPP_CONNECTION,         /* 10 */
    SRV_BT_CM_SIMAP_CONNECTION,       /* 11 */
    SRV_BT_CM_FAX_CONNECTION,         /* 12 */
    SRV_BT_CM_HID_CONNECTION,         /* 13 */
    SRV_BT_CM_BIP_CONNECTION,         /* 14 */
    SRV_BT_CM_BIPC_CONNECTION,        /* 15 */
    SRV_BT_CM_PBAP_CONNECTION,        /* 16 */
    SRV_BT_CM_PBAPC_CONNECTION,       /*17*/
    SRV_BT_CM_FTPC_CONNECTION,        /* 17 */
    SRV_BT_CM_OPPC_CONNECTION,        /* 18 */
    SRV_BT_CM_SYNCML_CONNECTION,      /* 19 */
    SRV_BT_CM_MAPC_CONNECTION,        /* 20 */
    SRV_BT_CM_CONNECTION_TOTAL        /* 20 */
} srv_bt_cm_connection_type;


/* BT CM result code enum */
typedef enum
{
    SRV_BT_CM_RESULT_SUCCESS                = 0,  /* success */
    SRV_BT_CM_RESULT_FAILED                 = -1, /* failed */
    SRV_BT_CM_RESULT_INVALID_HANDLE         = -2, /* invalid instance handler */
    SRV_BT_CM_RESULT_DEV_NOT_FOUND          = -3, /* device not found */
    SRV_BT_CM_RESULT_DEV_LIST_FULL          = -4, /* device list full */
    SRV_BT_CM_RESULT_NO_CONNECTION          = -5, /* there is no connection */
    SRV_BT_CM_RESULT_ONE_HEADSET_CONNECTED  = -6, /* there is one headset connected */
    SRV_BT_CM_RESULT_ONE_A2DP_CONNECTED     = -7, /* there is one A2DP connection */
    SRV_BT_CM_RESULT_SAME_HEADSET_CONNECTED = -8, /* the same headset is connected */
    SRV_BT_CM_RESULT_PROFILE_NOT_SUPPORT    = -9, /* the profile is not supported */
    SRV_BT_CM_RESULT_TOTAL      /* last enum for BT CM result code */
} srv_bt_cm_result_codes_enum;


/* the power status of BT */
typedef enum
{
    SRV_BT_CM_POWER_ON,                 /* power on */
    SRV_BT_CM_POWER_OFF,                /* power off */
    SRV_BT_CM_POWER_SWITCHING_ON,       /* power switching on */
    SRV_BT_CM_POWER_SWITCHING_OFF,      /* power switching off */  
    SRV_BT_CM_POWER_TOTAL               /* last enum for BT power status */
} srv_bt_cm_power_status_enum;

/* the device property */
typedef enum
{
    SRV_BT_CM_DEV_PROPERTY_BLOCK,       /* blocked */
    SRV_BT_CM_DEV_PROPERTY_PAIR,        /* paired */
    SRV_BT_CM_DEV_PROPERTY_AUTHORIZE,   /* authorized */
    SRV_BT_CM_DEV_PROPERTY_TOTAL        /* last enum for device property */
} srv_bt_cm_dev_property_enum;

/* Bluetooth device type */
typedef enum
{
    SRV_BT_CM_DISCOVERED_DEV,   /* discovered device */
    SRV_BT_CM_RECENT_USED_DEV,  /* recent used device */
    SRV_BT_CM_PAIRED_DEV,       /* paired device */
    SRV_BT_CM_ALL_DEV,          /* all device */
    SRV_BT_CM_DEV_TYPE_TOTAL
} srv_bt_cm_dev_type_enum;

/* Bluetooth device address struct */
typedef struct
{
    U32 lap;    /* Lower Address Part 00..23 */
    U8  uap;    /* upper Address Part 24..31 */
    U16 nap;    /* Non-significant    32..47 */
} srv_bt_cm_bt_addr;

/* Bluetooth device struct */
typedef struct
{
    U32 cod;                                                /* class of device */
    U8 name[SRV_BT_CM_BD_FNAME_LEN];                        /* device name */
    srv_bt_cm_bt_addr bd_addr;                              /* device addres */
    U8 attribute;                                           /* authorized or blocked */
    U8 service_list_num;                                    /* supported service number */
    U32 service_list[SRV_BT_CM_MAX_HOST_SUPPORTED_PROFILE]; /* supported service list */
} srv_bt_cm_dev_struct;


/* FuncPtr is a pointer to a func returns void */
typedef void (*profile_activate)(void);
typedef void (*profile_deactivate)(void);
typedef void (*profile_disconnect)(U32 conn_id);


/* supported profile callback table structure */
typedef struct
{
    U32                profile_id;   /* profile UUID */
    profile_activate   activater;    /* activater, CM wil call it to activate profile during bt power on procedure */
    profile_deactivate deactivater;  /* deactivater, CM will call it to deactivate profile during bt power off procedure */
    profile_disconnect disconnector; /* disconnector, CM will call it it to disconnect the profile */
} srv_bt_cm_profile_struct;

/* BT CM connection structure */
typedef struct
{
    U32 index_of_dev_list;               /* Connection identification */
    U32 conn_id;                         /* connection id */
    U32 profile_id;                      /* profile UUID, refer to the UUID macro defination */
    MMI_BOOL audio_on;                   /* audio on status */
    MMI_BOOL active;                     /* active or not */
#ifdef __MMI_BT_DIALER_SUPPORT__
	MMI_BOOL is_excluded;
#endif
} srv_bt_cm_connect_struct;


/***************************************************************************** 
 * Extern Global Function
 *****************************************************************************/

/*****************************************************************************
 * <GROUP Ext_other>
 * FUNCTION
 *  srv_bt_cm_init
 * DESCRIPTION
 *  This function is to init CM service
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_bt_cm_init(void);


/****************************************************************************** 
 * FUNCTION
 *  srv_bt_cm_profile_register
 * DESCRIPTION
 *  this function is to register profile info to CM service
 * PARAMETERS
 *  profile_info_p:    [IN]    profile information, refer to srv_bt_cm_profile_struct
 *  
 * RETURNS
 *  MMI_TRUE : success to register profile information to CM service
 *  MMI_FALSE: failed to register profile information to CM service
 ******************************************************************************/
extern MMI_BOOL srv_bt_cm_profile_register(const srv_bt_cm_profile_struct* profile_info_p);


/****************************************************************************** 
 * FUNCTION
 *  srv_bt_cm_profile_deregister
 * DESCRIPTION
 *  this function is to deregister profile, CM will clear the profiles information from registered information table
 * PARAMETERS
 *  profile_id:    [IN]    profile UUID, refer to the UUID macro defination
 *  
 * RETURNS
 *  void
 ******************************************************************************/
extern void srv_bt_cm_profile_deregister(U32 profile_id);


/*****************************************************************************
 * <GROUP Int_local_dev_set> 
 * FUNCTION
 *  srv_bt_cm_switch_on
 * DESCRIPTION
 *  This function is to switch on bt chip,
 *  and it will also help to activate bt profiles registered to CM service
 * PARAMETERS
 *  void
 * RETURNS
 *  S32: refer to srv_bt_cm_result_codes_enum
 *****************************************************************************/
extern S32 srv_bt_cm_switch_on(void);

/*****************************************************************************
 * <GROUP Int_local_dev_set> 
 * FUNCTION
 *  srv_bt_cm_set_btdialor_mode
 * DESCRIPTION
 *  This function is to set the cm in bt dialor mode.
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_bt_cm_set_btdialor_mode(MMI_BOOL val);

/*****************************************************************************
 * <GROUP Int_local_dev_set> 
 * FUNCTION
 *  srv_bt_cm_get_btdialor_mode
 * DESCRIPTION
 *  This function will return if the btdialor mode is on or off.
 * PARAMETERS
 *  void
 * RETURNS
 *  MMI_BOOL 
 *****************************************************************************/	
extern MMI_BOOL srv_bt_cm_get_btdialor_mode(void);
/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Int_local_dev_set> 
 * FUNCTION
 *  srv_bt_cm_antenna_off
 * DESCRIPTION
 *  This function is to process antenna off request and invoke srv_bt_cm_antenna_off_req_hdler
 *  
 * PARAMETERS
 *  void
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_bt_cm_antenna_off(void);
/* DOM-NOT_FOR_SDK-END */


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Int_local_dev_set> 
 * FUNCTION
 *  srv_bt_cm_power_on_activate_profile
 * DESCRIPTION
 *  This function is to activate BT profiles, invoke from MMI
 * PARAMETERS
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_bt_cm_activate_profile(void);
/* DOM-NOT_FOR_SDK-END */


/*****************************************************************************
 * <GROUP Int_local_dev_set> 
 * FUNCTION
 *  srv_bt_cm_switch_off
 * DESCRIPTION
 *  This function is to switch off bt, it will also help to deactivate all the activated bt profiles,
 *  if there is live connection(s), it will disconnect the live connection(s) firstly
 *  
 * PARAMETERS
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_bt_cm_switch_off(void);


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Int_other> 
 * FUNCTION
 *  srv_bt_cm_recover_panic_req
 * DESCRIPTION
 *  This function is to process recover panic request and send MSG_ID_BT_MMI_RESET_REQ
 * PARAMETERS
 *  void
 * RETURNS
 *  MMI_BOOL: return MMI_TRUE
 *****************************************************************************/
extern MMI_BOOL srv_bt_cm_recover_panic_req(void);
/* DOM-NOT_FOR_SDK-END */


/*****************************************************************************
 * <GROUP Ext_callback>
 * FUNCTION
 *  srv_bt_cm_activate_cnf_hdler
 * DESCRIPTION
 *  during bt power on procedure, CM will call each profile's activator
 *  (registered to CM through srv_bt_cm_profile_register()) one by one after power bt chip,.
 *  This function is to notify CM the profile has completed activate procedure,
 *  then CM can begin to call next activator until all activator has been called
 *  
 * PARAMETERS
 *  profile_id:    [IN]    profile UUID, refer to the UUID macro defination
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_bt_cm_activate_cnf_hdler(U32 profile_id);


/*****************************************************************************
 * <GROUP Ext_callback>
 * FUNCTION
 *  srv_bt_cm_deactivate_cnf_hdler
 * DESCRIPTION
 *  during bt power off procedure, CM will call each profile's deactivator
 *  (registered to CM through srv_bt_cm_profile_register()),
 *  This function is to notify CM the profile has completed deactivate procedure,
 *  then CM can begin to power off bt chip
 *  
 * PARAMETERS
 *  profile_id:    [IN]    profile UUID, refer to the UUID macro defination
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_bt_cm_deactivate_cnf_hdler(U32 profile_id);


/*****************************************************************************
 * <GROUP Ext_local_dev_setting>
 * FUNCTION
 *  srv_bt_cm_get_power_status
 * DESCRIPTION
 *  This function is to get current bt power status
 * PARAMETERS
 *  void
 * RETURNS
 *  srv_bt_cm_power_status_enum   
 *    SRV_BT_CM_POWER_ON means BT power is ON
 *    SRV_BT_CM_POWER_OFF means BT power is OFF
 *    SRV_BT_CM_POWER_SWITCHING_ON means switching power to be ON now
 *    SRV_BT_CM_POWER_SWITCHING_OFF means switching power to be OFF now 
 *****************************************************************************/
extern srv_bt_cm_power_status_enum srv_bt_cm_get_power_status(void);


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Ext_local_dev_setting>
 * FUNCTION
 *  srv_bt_cm_is_activated
 * DESCRIPTION
 *  This function is to check if bt is activated
 * PARAMETERS
 *  void
 * RETURNS
 *  MMI_TRUE  : bluetooth is activated
 *  MMI_FALSE : bluetooth is not activated
 *****************************************************************************/
extern MMI_BOOL srv_bt_cm_is_activated(void);
/* DOM-NOT_FOR_SDK-END */


/****************************************************************************** 
 * FUNCTION
 *  srv_bt_cm_set_visibility
 * DESCRIPTION
 *  this function is to set bluetooth visibility
 * PARAMETERS
 *  type:    [IN]    visibility type
 *  
 * RETURNS
 *  S32: refer to srv_bt_cm_result_codes_enum
 ******************************************************************************/
extern S32 srv_bt_cm_set_visibility(srv_bt_cm_visibility_type type);


/****************************************************************************** 
 * FUNCTION
 *  srv_bt_cm_get_visibility
 * DESCRIPTION
 *  this function is to get bluetooth visibility
 * PARAMETERS
 *  void
 * RETURNS
 *  S32: refer to srv_bt_cm_visibility_type
 ******************************************************************************/
extern S32 srv_bt_cm_get_visibility(void);


#ifdef __MMI_BT_LIMITED_DISCOVERY_SUPPORT__
/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Ext_local_dev_setting>
 * FUNCTION
 *  srv_bt_cm_set_limit_vis
 * DESCRIPTION
 *  This function is to set limited discoverable mode
 * PARAMETERS
 *  vis:    MMI_TRUE means to set limit discovery mode, 
 *          MMI_FALSE means to reset limit discovery mode
 * RETURNS
 *  S32
 *****************************************************************************/
extern S32 srv_bt_cm_set_limit_vis(MMI_BOOL vis);
/* DOM-NOT_FOR_SDK-END */


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Ext_local_dev_setting>
 * FUNCTION
 *  srv_bt_cm_is_limit_vis
 * DESCRIPTION
 *  This function is to check the limited visibility setting of bluetooth
 * PARAMETERS
 *  void
 * RETURNS
 *  MMI_TRUE  : the device is limited visible
 *  MMI_FALSE : the device is not limited visible
 *****************************************************************************/
MMI_BOOL srv_bt_cm_is_limit_vis(void);
/* DOM-NOT_FOR_SDK-END */
#endif /*__MMI_BT_LIMITED_DISCOVERY_SUPPORT__*/


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Ext_local_dev_setting>
 * FUNCTION
 *  srv_bt_cm_set_discoverable_mode
 * DESCRIPTION
 *  This function is to set discoverable mode and invoke srv_bt_cm_write_scanenable_mode_req_hdler
 * PARAMETERS
 *  discoverable_mode:    [IN]    discoverable mode value
 * RETURNS
 *  MMI_BOOL    MMI_TRUE  : set discoverable mode successfully
 *              MMI_FALSE : otherwise
 *****************************************************************************/
extern S32 srv_bt_cm_set_discoverable_mode(U32 discoverable_mode);
/* DOM-NOT_FOR_SDK-END */


/*****************************************************************************
 * <GROUP Int_local_dev_set> 
 * FUNCTION
 *  srv_bt_cm_set_auth
 * DESCRIPTION
 *  This function is to process setting authentication request and invoke srv_bt_cm_security_level_req_hdler
 * PARAMETERS
 *  auth:    [IN]    MMI_TRUE:enable authentication, MMI_FALSE:disable authentication
 * RETURNS
 *  S32: refer to srv_bt_cm_result_codes_enum
 *****************************************************************************/
extern S32 srv_bt_cm_set_authentication(MMI_BOOL auth);


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Ext_local_dev_setting>
 * FUNCTION
 *  srv_bt_cm_is_auth
 * DESCRIPTION
 *  This function is to check the authentication setting
 * PARAMETERS
 *  void
 * RETURNS
 *  MMI_TRUE  : the authentication is on
 *  MMI_FALSE : the authentication is off
 *****************************************************************************/
extern MMI_BOOL srv_bt_cm_is_authentication(void);
/* DOM-NOT_FOR_SDK-END */


/*****************************************************************************
 * <GROUP Ext_local_dev_setting>
 * FUNCTION
 *  srv_bt_cm_get_host_dev_security_level
 * DESCRIPTION
 *  This function is to get host device security level
 * PARAMETERS
 *  void
 * RETURNS
 *  U8      host device security level, refer to srv_bt_cm_security_mode_enum
 *****************************************************************************/
extern U8 srv_bt_cm_get_host_dev_security_level(void);


/*****************************************************************************
 * <GROUP Int_dev_mgr>
 * FUNCTION
 *  srv_bt_cm_search
 * DESCRIPTION 
 *  This function is to process inquiry request and invoke srv_bt_cm_discovery_req_hdler,
 *  each time finding a device, it will notify notifier
 *  (set to CM by srv_bt_cm_set_notify()) with event SRV_BT_CM_EVENT_INQUIRY_IND ,
 *  after search procedure completed, it will notify notifier SRV_BT_CM_EVENT_INQUIRY_COMPLETE.
 * PARAMETERS
 *  max_response  :    [IN]    max repsone number of device
 *  timeout       :    [IN]    inquiry timeout timer
 *  cod           :    [IN]    class of device
 *  name_discovery:    [IN]    name discovery 
 * RETURNS
 *  S32 :    refer to srv_bt_cm_result_codes_enum
 *****************************************************************************/
extern S32 srv_bt_cm_search(U8 max_response, U16 timeout, U32 cod, MMI_BOOL name_discovery);


/*****************************************************************************
 * <GROUP Int_dev_mgr>
 * FUNCTION
 *  srv_bt_cm_search_abort
 * DESCRIPTION
 *  This function is to process inquiry cancel request
 *  and invoke srv_bt_cm_cancel_discovery_req_hdler,
 *  notifier will receive SRV_BT_CM_EVENT_INQUIRY_COMPLETE after cancel inquiry procedure is completed
 * PARAMETERS
 *  void
 * RETURNS
 *  S32: refer to srv_bt_cm_result_codes_enum
 *****************************************************************************/
 extern S32 srv_bt_cm_search_abort(void);


/*****************************************************************************
 * <GROUP Int_dev_mgr>
 * FUNCTION
 *  srv_bt_cm_bond
 * DESCRIPTION
 *  This function is to initiate bond procedure to remote bt device,
 *  it will notify notifier SRV_BT_CM_EVENT_BOND_RES after bond completed
 * PARAMETERS
 *  index:    [IN]    discovered device index
 * RETURNS
 *  S32 : refer to srv_bt_cm_result_codes_enum
 *****************************************************************************/
extern S32 srv_bt_cm_bond(U32 index);


#ifdef __BT_BOND_CANCEL__
/* DOM-NOT_FOR_SDK-BEGIN */
/****************************************************************************** 
 * FUNCTION
 *  srv_bt_cm_bond_cancel
 * DESCRIPTION
 *  this function is to cancel bond process
 * PARAMETERS
 *  void
 * RETURNS
 *  S32: refer to srv_bt_cm_result_codes_enum
 ******************************************************************************/
S32 srv_bt_cm_bond_cancel(void);
/* DOM-NOT_FOR_SDK-END */
#endif


/****************************************************************************** 
 * FUNCTION
 *  srv_bt_cm_debond
 * DESCRIPTION
 *  this function is to debond a device
 * PARAMETERS
 *  index:    [IN]    device index
 *  
 * RETURNS
 *  S32 : refer to srv_bt_cm_result_codes_enum
 ******************************************************************************/
extern S32 srv_bt_cm_debond(U32 index);


/*****************************************************************************
 * <GROUP Int_dev_mgr>
 * FUNCTION
 *  srv_bt_cm_send_passkey
 * DESCRIPTION
 *  This function is to process pair request and send passkey
 * PARAMETERS
 *  dev_addr   :    [IN]    device address
 *  dev_passkey:    [IN]    passkey
 *  result     :    [IN]    MMI_TURE: valid passkey, MMI_FALSE:reject this pair
 * RETURNS
 *  S32 : refer to srv_bt_cm_result_codes_enum
 *****************************************************************************/
extern S32 srv_bt_cm_send_passkey(srv_bt_cm_bt_addr* dev_addr, U8* dev_passkey, MMI_BOOL result);


#ifdef __MMI_BT_SIMPLE_PAIR__
/*****************************************************************************
 * <GROUP Int_dev_mgr>
 * FUNCTION
 *  srv_bt_cm_security_numeric_confirm
 * DESCRIPTION
 *  This function is to reply the numeric confirmation
 * PARAMETERS
 *  dev_addr:    [IN]    device address      
 *  accept  :    [IN]    MMI_TRUE means numeric confirmation result is correct
 *                       MMI_FALSE means numeric confirmation result is incorrect
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_bt_cm_security_numeric_confirm(srv_bt_cm_bt_addr* dev_addr, MMI_BOOL accept);


/*****************************************************************************
 * <GROUP Int_dev_mgr>
 * FUNCTION
 *  srv_bt_cm_security_keypress_notify_cancel
 * DESCRIPTION
 *  This function is to cancel the passkey keypress notify
 * PARAMETERS
 *  dev_addr:    [IN]    device address      
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_bt_cm_security_keypress_notify_cancel(srv_bt_cm_bt_addr* dev_addr);
#endif /* __MMI_BT_SIMPLE_PAIR__ */


/*****************************************************************************
 * <GROUP Ext_local_dev_setting>
 * FUNCTION
 *  srv_bt_cm_set_host_dev_name
 * DESCRIPTION
 *  This function is to set host device name, it will notify notifier SRV_BT_CM_EVENT_SET_NAME
 *  after set host device name procedure is completed.
 * PARAMETERS
 *  name :    [IN]    host device name, UTF-8 coding
 * RETURNS
 *  S32  : refer to srv_bt_cm_result_codes_enum
 *****************************************************************************/
extern S32 srv_bt_cm_set_host_dev_name(U8* name);


/*****************************************************************************
 * <GROUP Int_local_dev_set> 
 * FUNCTION
 *  srv_bt_cm_get_host_dev_info
 * DESCRIPTION
 *  This function is to get host device information
 * PARAMETERS
 *  void
 * RETURNS
 *  srv_bt_cm_dev_struct*   :   the host device information
 *****************************************************************************/
extern srv_bt_cm_dev_struct* srv_bt_cm_get_host_dev_info(void);


/****************************************************************************** 
 * FUNCTION
 *  srv_bt_cm_start_conn
 * DESCRIPTION
 *  This function is to process connect request
 * PARAMETERS
 *  in_out    :    [IN]    MMI_TRUE: incoming connection, MMI_FALSE: outgong connection
 *  profile_id:    [IN]    profile UUID, refer to the UUID macro defination
 *  dev_addr  :    [IN]    device address
 *  dev_name  :    [IN]    device name, UTF-8 coding
 *  
 * RETURNS
 *  S32 : if it is larger than 0, it means it is allowed to
 *  initiate a connection from host device currently, and the return value is a valid conn_id,
 *  otherwise, it is not allowed to start a connection currently.
 ******************************************************************************/
extern S32 srv_bt_cm_start_conn(MMI_BOOL in_out, U32 profile_id, srv_bt_cm_bt_addr* dev_addr, CHAR* dev_name);


/*****************************************************************************
 * <GROUP Ext_callback>
 * FUNCTION
 *  srv_bt_cm_stop_conn
 * DESCRIPTION
 *  This function is to handle disconnection indication
 * PARAMETERS
 *  conn_id:     [IN]     conneciton id, returned by srv_bt_cm_start_conn()
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_bt_cm_stop_conn(U32 conn_id);


/****************************************************************************** 
 * FUNCTION
 *  srv_bt_cm_connect_ind
 * DESCRIPTION
 *  this function is to handle connect indication, if profile is set up successfully,
 *  after call srv_bt_cm_start_conn(), it should call this API to notify CM.
 * PARAMETERS
 *  conn_id:    [IN]    connection ID, returned by srv_bt_cm_start_conn()
 *  
 * RETURNS
 *  void
 ******************************************************************************/
extern void srv_bt_cm_connect_ind(U32 conn_id);


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Ext_callback>
 * FUNCTION
 *  srv_bt_cm_sco_connect_ind_hdler
 * DESCRIPTION
 *  This function is to handle SCO connect indication
 * PARAMETERS
 *  conn_id:    [IN]    connection id, returned by srv_bt_cm_start_conn()
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_bt_cm_sco_connect_ind_hdler(U32 conn_id);
/* DOM-NOT_FOR_SDK-END */


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Ext_callback>
 * FUNCTION
 *  srv_bt_cm_sco_connect_cnf_hdler
 * DESCRIPTION
 *  This function is to handle SCO connent confirm
 * PARAMETERS
 *  result     :    [IN]    connect result
 *  conn_id    :    [IN]    connection id, returned by srv_bt_cm_start_conn()
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_bt_cm_sco_connect_cnf_hdler(U8 result, U32 conn_id);
/* DOM-NOT_FOR_SDK-END */


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Ext_callback>
 * FUNCTION
 *  srv_bt_cm_sco_disconnect_ind_hdler
 * DESCRIPTION
 *  This function is to SCO disconnection indication
 * PARAMETERS
 *  connection_id:    [IN]    connection id
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_bt_cm_sco_disconnect_ind_hdler(U32 connection_id);
/* DOM-NOT_FOR_SDK-END */


/* DOM-NOT_FOR_SDK-BEGIN */
/****************************************************************************** 
 * FUNCTION
 *  srv_bt_cm_get_sco_status
 * DESCRIPTION
 *  this function is to get sco status
 * PARAMETERS
 *  void
 * RETURNS
 *  MMI_BOOL
 ******************************************************************************/
extern MMI_BOOL srv_bt_cm_get_sco_status(void);
/* DOM-NOT_FOR_SDK-END */


/*****************************************************************************
 * <GROUP Int_conn_mgr>
 * FUNCTION
 *  srv_bt_cm_release_dev_conn
 * DESCRIPTION
 *  This function is to process release device connection request,
 *  it will release the designated device's all live conneciton(s).
 * PARAMETERS
 *  dev_addr:    [IN]    the device address pointer
 * RETURNS
 *  S32: refer to srv_bt_cm_result_codes_enum       
 *****************************************************************************/
extern S32 srv_bt_cm_release_dev_conn(srv_bt_cm_bt_addr* dev_addr);


/****************************************************************************** 
 * FUNCTION
 *  srv_bt_cm_release_profile
 * DESCRIPTION
 *  this function is to release the designated device's live connection of profile_id,
 *  after the procedure is completed, it will notify notifier SRV_BT_CM_EVENT_DISCONNECT_IND
 * PARAMETERS
 *  profile_id:    [IN]    profile ID, refer to the UUID macro defination
 *  
 * RETURNS
 *  S32 :refer to srv_bt_cm_result_codes_enum
 ******************************************************************************/
extern S32 srv_bt_cm_release_profile(srv_bt_cm_bt_addr* dev_addr, U32 profile_id);


/*****************************************************************************
 * <GROUP Int_conn_mgr>
 * FUNCTION
 *  srv_bt_cm_release_all_conn
 * DESCRIPTION
 *  This function is to process release the designated device's all live connection,
 *  after the procedure is completed, it will notify the notifier SRV_BT_CM_EVENT_RELEASE_ALL_CONN.
 * PARAMETERS
 *  void
 * RETURNS
 *  S32 : refer to srv_bt_cm_result_codes_enum
 *****************************************************************************/
extern S32 srv_bt_cm_release_all_conn(void);


#if defined(__MMI_BT_AUTHORIZE__)
/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Int_dev_mgr>
 * FUNCTION
 *  srv_bt_cm_unblock
 * DESCRIPTION
 *  This function is to unblock the specific device
 * PARAMETERS
 *  dev_addr:    [IN]    device address      
 * RETURNS
 *  S32 : refer to srv_bt_cm_result_codes_enum    
 *****************************************************************************/
extern S32 srv_bt_cm_unblock(srv_bt_cm_bt_addr* dev_addr);
/* DOM-NOT_FOR_SDK-END */


/*****************************************************************************
* <GROUP Int_dev_mgr>
* FUNCTION
*  srv_bt_cm_set_authorize
* DESCRIPTION
*   This function is to set the authorize setting of a certain device
* PARAMETERS
*  dev_addr      :    [IN]    device address
*  authorize_type:    [IN]    authorize_type: refer to srv_bt_cm_authorize_type
* RETURNS
*  S32 : refer to srv_bt_cm_result_codes_enum
*****************************************************************************/
extern S32 srv_bt_cm_set_authorize(srv_bt_cm_bt_addr* dev_addr, srv_bt_cm_authorize_type authorize_type);


/****************************************************************************** 
 * FUNCTION
 *  srv_bt_cm_authorize_type
 * DESCRIPTION
 *  this function will return the designated device's authorized type
 * PARAMETERS
 *  dev_addr:    [IN]    const device address pointer
 *  
 * RETURNS
 *  srv_bt_cm_authorize_type
 ******************************************************************************/
extern srv_bt_cm_authorize_type srv_bt_cm_get_authorize(const srv_bt_cm_bt_addr* dev_addr);
#endif /* (__MMI_BT_AUTHORIZE__) */

/* DOM-NOT_FOR_SDK-BEGIN */
#if MMI_MAX_SIM_NUM > 1
extern mmi_sim_enum srv_bt_cm_get_prefer_sim(const srv_bt_cm_bt_addr *device);
extern void srv_bt_cm_set_prefer_sim(const srv_bt_cm_bt_addr *device, mmi_sim_enum sim);
extern mmi_sim_enum srv_bt_cm_get_binding_sim(const srv_bt_cm_bt_addr *dev_addr);
#endif
/* DOM-NOT_FOR_SDK-END */

/*****************************************************************************
 * <GROUP Int_dev_mgr>
 * FUNCTION
 *  srv_bt_cm_refresh_service_list
 * DESCRIPTION
 *  This function is to process refresh service list request,
 *  it will notify application through event SRV_BT_CM_EVENT_REFRESH_PROFILE.
 * PARAMETERS
 *  dev_addr:    [IN]    device address
 * RETURNS
 *  S32 : refer to srv_bt_cm_result_codes_enum
 *****************************************************************************/
extern S32 srv_bt_cm_refresh_service_list(srv_bt_cm_bt_addr* dev_addr);


/*****************************************************************************
 * <GROUP Int_conn_mgr>
 * FUNCTION
 *  srv_bt_cm_get_existed_conn_num
 * DESCRIPTION
 *  This function is to get existed connection number
 * PARAMETERS
 *  void
 * RETURNS
 *  U8    :    existed connection number
 *****************************************************************************/
extern U8 srv_bt_cm_get_existed_conn_num(void);


/*****************************************************************************
 * <GROUP Int_conn_mgr>
 * FUNCTION
 *  srv_bt_cm_get_existed_conn_info
 * DESCRIPTION
 *  This function is to get existed connection info
 * PARAMETERS
 *  index:    [IN]    existed connection index
 * RETURNS
 *  srv_bt_cm_connect_struct* : existed connection info pointer
 *****************************************************************************/
srv_bt_cm_connect_struct* srv_bt_cm_get_existed_conn_info(U16 index);


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Ext_paired_dev_setting>
 * FUNCTION
 *  srv_bt_cm_is_headset_connected
 * DESCRIPTION
 *  This function is to check if headset is connected
 * PARAMETERS
 *  index_of_paried_list:    [IN]    the device index of the headset
 * RETURNS
 *  MMI_TRUE  : headset is connected
 *  MMI_FALSE : headset is not connected
 *****************************************************************************/
extern MMI_BOOL srv_bt_cm_is_headset_connected(const srv_bt_cm_bt_addr* dev_addr);
/* DOM-NOT_FOR_SDK-END */


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Ext_local_dev_setting>
 * FUNCTION
 *  srv_bt_cm_is_profile_connected
 * DESCRIPTION
 *  This function is to check if a profile is connected
 * PARAMETERS
 *  conn_type:    [IN]    to check if conn_type is connected, conn_type is defind in srv_bt_cm_connection_type 
 * RETURNS
 *  MMI_TRUE  : the profile is connected
 *  MMI_FALSE : the profile is not connected
 *****************************************************************************/
extern MMI_BOOL srv_bt_cm_is_profile_connected(srv_bt_cm_connection_type conn_type);
/* DOM-NOT_FOR_SDK-END */


/*****************************************************************************
 * <GROUP Ext_local_dev_setting>
 * FUNCTION
 *  srv_bt_cm_is_dev_conn_active
 * DESCRIPTION
 *  This function is to check if certain device is connected
 * PARAMETERS
 *  dev_addr  :    [IN]    device address  
 * RETURNS
 *  MMI_TRUE  : the device is connected
 *  MMI_FASLE : the device is not connected
 *****************************************************************************/
MMI_BOOL srv_bt_cm_is_dev_conn_active(srv_bt_cm_bt_addr* dev_addr);


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Ext_local_dev_setting>
 * FUNCTION
 *  srv_bt_cm_is_audio_path_to_headset
 * DESCRIPTION
 *  This function is to check if the audio path is set to headset
 * PARAMETERS
 *  void
 * RETURNS
 *  MMI_TRUE  : the audio path is set to headphone
 *  MMI_FALSE : the audio path is leave in phone
 *****************************************************************************/
MMI_BOOL srv_bt_cm_is_audio_path_to_headset(void);
/* DOM-NOT_FOR_SDK-END */


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Ext_local_dev_setting>
 * FUNCTION
 *  srv_bt_cm_is_incall_aud_swap2bt
 * DESCRIPTION
 *  This function is to is incall and audio path is swap to bluetooth device
 * PARAMETERS
 *  void
 * RETURNS
 *  MMI_TRUE  : the audio path is swap to bluetooth device
 *  MMI_FALSE : the audio path is not swap to bluetooth device
 *****************************************************************************/
MMI_BOOL srv_bt_cm_is_incall_aud_swap2bt(void);
/* DOM-NOT_FOR_SDK-END */


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Ext_local_dev_setting>
 * FUNCTION
 *  srv_bt_cm_is_audio_link_on
 * DESCRIPTION
 *  This function is to if headset audio link is connected
 * PARAMETERS
 *  void
 * RETURNS
 *  MMI_TRUE  : headset audio link is connected
 *  MMI_FALSE : headset audio link is not connected
 *****************************************************************************/
MMI_BOOL srv_bt_cm_is_audio_link_on(void);
/* DOM-NOT_FOR_SDK-END */


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Ext_paired_dev_setting> 
 * FUNCTION
 *  srv_bt_cm_check_dev_profile_support_status
 * DESCRIPTION
 *  This function is to check if a service is support or not on a certain device
 * PARAMETERS
 *  addr      :    [IN]    address of the device
 *  service_id:    [IN]    the service to find
 * RETURNS
 *  MMI_TRUE  : the service is supported
 *  MMI_FALSE : the service is not supported
 *****************************************************************************/
extern MMI_BOOL srv_bt_cm_check_dev_profile_support_status(srv_bt_cm_bt_addr* dev_addr, U32 service_id);
/* DOM-NOT_FOR_SDK-END */


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Ext_local_dev_setting>
 * FUNCTION
 *  srv_bt_cm_is_simap_activate
 * DESCRIPTION
 *  This function is to check if SIMAP is activated
 * PARAMETERS
 *  void
 * RETURNS
 *  MMI_TRUE  : SIMAP is activated
 *  MMI_FALSE : SIMAP is not activated
 *****************************************************************************/
MMI_BOOL srv_bt_cm_is_simap_activate(void);
/* DOM-NOT_FOR_SDK-END */


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Ext_paired_dev_setting>
 * FUNCTION
 *  srv_bt_cm_set_dev_cod
 * DESCRIPTION
 *  This function is to set device cod and write into nvram
 * PARAMETERS
 *  srv_bt_cm_bt_addr:    [IN]    device address
 *  cod              :    [IN]    class of device
 * RETURNS
 *  S32: refer to srv_bt_cm_result_codes_enum
 *****************************************************************************/
extern S32 srv_bt_cm_set_dev_cod(srv_bt_cm_bt_addr* dev_addr, U32 cod);
/* DOM-NOT_FOR_SDK-END */


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Ext_paired_dev_setting>
 * FUNCTION
 *  srv_bt_cm_get_dev_cod
 * DESCRIPTION
 *  This function is to get device cod
 * PARAMETERS
 *  dev_addr:    [IN]    device address
 * RETURNS
 *  U32 :         class of device
 *****************************************************************************/
extern U32 srv_bt_cm_get_dev_cod(srv_bt_cm_bt_addr* dev_addr);
/* DOM-NOT_FOR_SDK-END */


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Int_dev_mgr>
 * FUNCTION
 *  srv_bt_cm_get_searched_dev_num
 * DESCRIPTION
 *  This function is to get discovered device number
 * PARAMETERS
 *  void
 * RETURNS
 *  U8          discovered device number
 *****************************************************************************/
extern U8 srv_bt_cm_get_searched_dev_num(void);
/* DOM-NOT_FOR_SDK-END */


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Int_dev_mgr>
 * FUNCTION
 *  srv_bt_cm_get_searched_dev_info
 * DESCRIPTION
 *  This function is to get discovered device info
 * PARAMETERS
 *  index:     [IN]    the index of discovered device
 * RETURNS
 *  srv_bt_cm_dev_struct* :      the device info structure pointer
 *****************************************************************************/
extern srv_bt_cm_dev_struct* srv_bt_cm_get_searched_dev_info(U16 index);
/* DOM-NOT_FOR_SDK-END */


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Int_dev_mgr>
 * FUNCTION
 *  srv_bt_cm_get_paired_dev_num
 * DESCRIPTION
 *  This function is to get paired device number
 * PARAMETERS
 *  void
 * RETURNS
 *  U8 : paired device number
 *****************************************************************************/
extern U8 srv_bt_cm_get_paired_dev_num(void);
/* DOM-NOT_FOR_SDK-END */


/****************************************************************************** 
 * FUNCTION
 *  srv_bt_cm_get_dev_num
 * DESCRIPTION
 *  this function is to get device number according to device type
 * PARAMETERS
 *  dev_type:    [IN]    refer to srv_bt_cm_dev_type_enum 
 *  
 * RETURNS
 *  U32 : device nuber of designated device type
 ******************************************************************************/
extern U32 srv_bt_cm_get_dev_num(srv_bt_cm_dev_type_enum dev_type);


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Int_dev_mgr>
 * FUNCTION
 *  srv_bt_cm_get_paired_dev_info
 * DESCRIPTION
 *  This function is to get paired device information
 * PARAMETERS
 *  index:    [IN]    index or paired device  
 * RETURNS
 *  srv_bt_cm_dev_struct*:   device information structure pointer
 *****************************************************************************/
extern srv_bt_cm_dev_struct* srv_bt_cm_get_paired_dev_info(U16 index);
/* DOM-NOT_FOR_SDK-END */


/* DOM-NOT_FOR_SDK-BEGIN */
/****************************************************************************** 
 * FUNCTION
 *  srv_bt_cm_get_dev_info
 * DESCRIPTION
 *  this function will return the device information from paird device list and searched device list according to address,
 *  if can't find the device, it will return NULL
 * PARAMETERS
 *  dev_addr:    [IN]    BT device address
 *  
 * RETURNS
 *  srv_bt_cm_dev_struct* : device information structure pointer
 ******************************************************************************/
extern const srv_bt_cm_dev_struct* srv_bt_cm_get_dev_info(srv_bt_cm_bt_addr* dev_addr);
/* DOM-NOT_FOR_SDK-END */


/****************************************************************************** 
 * FUNCTION
 *  srv_bt_cm_set_dev_name
 * DESCRIPTION
 *  this function is to set paired device name
 * PARAMETERS
 *  dev_addr:    [IN]    BT device address
 *  name_p  :    [IN]    BT device name, UTF-8 encoding
 *  
 * RETURNS
 *  S32 : refer to srv_bt_cm_result_codes_enum
 ******************************************************************************/
extern S32 srv_bt_cm_set_dev_name(srv_bt_cm_bt_addr* dev_addr, U8* name_p);


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Ext_paired_dev_setting>
 * FUNCTION
 *  srv_bt_cm_get_dev_name
 * DESCRIPTION
 *  This function is to get the device UTF8 name
 * PARAMETERS
 *  dev_addr    :    [IN]     bluetooth address
 *  max_name_len:    [IN]     allowed max length of name_p
 *  name_p      :    [OUT]    name buffer pointer
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_bt_cm_get_dev_name(srv_bt_cm_bt_addr* dev_addr, U32 max_name_len, U8* name_p);
/* DOM-NOT_FOR_SDK-END */


/* DOM-NOT_FOR_SDK-BEGIN */
/****************************************************************************** 
 * <GROUP Ext_paired_dev_setting>
 * FUNCTION
 *  srv_bt_cm_get_dev_ucs2_name
 * DESCRIPTION
 *  this function is to get the device's unicode name
 * PARAMETERS
 *  dev_addr    :    [IN]    bluetooth address
 *  max_name_len:    [IN]    allowed max length of name_p
 *  name_p      :    [IN]    name buffer pointer
 * RETURNS
 *  void
 ******************************************************************************/
extern void srv_bt_cm_get_dev_ucs2_name(const srv_bt_cm_bt_addr* dev_addr, U32 max_name_len, WCHAR* name_p);
/* DOM-NOT_FOR_SDK-END */


/****************************************************************************** 
 * FUNCTION
 *  srv_bt_cm_read_remote_dev_name
 * DESCRIPTION
 *  this function is to read the remote device name again,
 *  it will notify notifier SRV_BT_CM_EVENT_READ_REMOTE_DEV_NAME after procedure is completed
 * PARAMETERS
 *  dev_addr:    [IN]    device address
 *  
 * RETURNS
 *  S32 : refer to srv_bt_cm_result_codes_enum
 ******************************************************************************/
extern S32 srv_bt_cm_read_remote_dev_name(srv_bt_cm_bt_addr* dev_addr);


/****************************************************************************** 
 * FUNCTION
 *  srv_bt_cm_get_dev_index
 * DESCRIPTION
 *  this function is to get device index in corresponding device list
 *  according to device type
 * PARAMETERS
 *  dev_addr:    [IN]    device address
 *  dev_type:    [IN]    device type
 *  
 * RETURNS
 *  if succeed to find the device, return index in corresponding device list
 *  if failed to find the device, return 0xFFFFFFFF
 ******************************************************************************/
extern U32 srv_bt_cm_get_dev_index(const srv_bt_cm_bt_addr* dev_addr, srv_bt_cm_dev_type_enum dev_type);


/****************************************************************************** 
 * FUNCTION
 *  srv_bt_cm_get_dev_info_by_addr
 * DESCRIPTION
 *  this function is to get the device information througth device address
 *  according to the device type
 * PARAMETERS
 *  dev_addr:    [IN]    device address
 *  dev_type:    [IN]    device type
 *  
 * RETURNS
 *  if succeed to find the device, return its information
 *  if failed to find the device, return NULL
 ******************************************************************************/
extern const srv_bt_cm_dev_struct* srv_bt_cm_get_dev_info_by_addr(
    const srv_bt_cm_bt_addr* dev_addr,
    srv_bt_cm_dev_type_enum dev_type);


/****************************************************************************** 
 * FUNCTION
 *  srv_bt_cm_get_dev_info_by_index
 * DESCRIPTION
 *  this function is to get device info 
 * PARAMETERS
 *  index   :    [IN]    device index
 *  dev_type:    [IN]    device type
 *  
 * RETURNS
 *  if succeed to find the device, return its information
 *  if failed to find the device, return NULL
 ******************************************************************************/
extern const srv_bt_cm_dev_struct* srv_bt_cm_get_dev_info_by_index(U32 index, srv_bt_cm_dev_type_enum dev_type);


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Ext_paired_dev_setting>
 * FUNCTION
 *  srv_bt_cm_dev_property_check
 * DESCRIPTION
 *  This function is to check if device is matched certain property
 * PARAMETERS
 *  srv_bt_cm_bt_addr:    [IN]    BT device address    
 *  prop             :    [IN]    device property, refer to srv_bt_cm_dev_property_enum
 * RETURNS
 *  MMI_TRUE  : means matched
 *  MMI_FALSE : means not matched
 *****************************************************************************/
MMI_BOOL srv_bt_cm_dev_property_check(srv_bt_cm_bt_addr* dev_addr, srv_bt_cm_dev_property_enum prop);
/* DOM-NOT_FOR_SDK-END */


/*****************************************************************************
 * <GROUP Int_dev_mgr>
 * FUNCTION
 *  srv_bt_cm_dev_del
 * DESCRIPTION
 *  This function is to process my device delete request,
 *  after successfully delete the device from paired device list,
 *  it will notify notifier SRV_BT_CM_EVENT_MYDEV_DEL.
 * PARAMETERS
 *  dev_addr:    [IN]    device address
 * RETURNS
 *  S32 : refer to srv_bt_cm_result_codes_enum
 *****************************************************************************/
extern S32 srv_bt_cm_dev_del(srv_bt_cm_bt_addr* dev_addr);


/*****************************************************************************
 * <GROUP Int_dev_mgr>
 * FUNCTION
 *  srv_bt_cm_dev_del_all
 * DESCRIPTION
 *  This function is to process My device delete all request,
 *  after successfully clear paired device list,
 *  it will notify notifier SRV_BT_CM_EVENT_MYDEV_DEL.
 * PARAMETERS
 *  void
 * RETURNS
 *  S32 : refer to srv_bt_cm_result_codes_enum
 *****************************************************************************/
extern S32 srv_bt_cm_dev_del_all(void);


/*****************************************************************************
 * <GROUP Int_dev_mgr>
 * FUNCTION
 *  srv_bt_cm_dev_add
 * DESCRIPTION
 *  This function is to process My device add request
 * PARAMETERS
 *  dev_addr:    [IN]    device address pointer
 * RETURNS
 *  S32 : refer to srv_bt_cm_result_codes_enum
 *****************************************************************************/
extern S32 srv_bt_cm_dev_add(srv_bt_cm_bt_addr* dev_addr);


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Int_dev_mgr>
 * FUNCTION
 *  srv_bt_cm_dev_remove
 * DESCRIPTION
 *  This function is to process My device remove request
 * PARAMETERS
 *  dev_addr:    [IN]   device address pointer
 * RETURNS
 *  S32 : refer to srv_bt_cm_result_codes_enum
 *****************************************************************************/
extern S32 srv_bt_cm_dev_remove(srv_bt_cm_bt_addr* dev_addr);
/* DOM-NOT_FOR_SDK-END */


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Ext_other>
 * FUNCTION
 *  srv_bt_cm_get_conn_type
 * DESCRIPTION
 *  This function is to get connection type
 * PARAMETERS
 *  profile_id:    [IN]    profile UUID, refer to the UUID macro defination
 * RETURNS
 *  srv_bt_cm_connection_type : connection type
 *****************************************************************************/
extern srv_bt_cm_connection_type srv_bt_cm_get_conn_type(U32 profile_id);
/* DOM-NOT_FOR_SDK-END */


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Ext_other>
 * FUNCTION
 *  mmi_bt_register_operation_callback
 * DESCRIPTION
 *  This function is to register operation callback
 * PARAMETERS
 *  oper_type:    [IN]    operaion type
 *  func_p   :    [IN]    function pointer
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_bt_cm_register_operation_callback(srv_bt_cm_oper_type_enum oper_type, FuncPtr func_p);
/* DOM-NOT_FOR_SDK-END */


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Ext_other>
 * FUNCTION
 *  mmi_bt_unregister_operation_callback
 * DESCRIPTION
 *  This function is to unregister operation callback
 * PARAMETERS
 *  oper_type:    [IN]    operation type
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_bt_cm_unregister_operation_callback(srv_bt_cm_oper_type_enum oper_type);
/* DOM-NOT_FOR_SDK-END */


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Ext_other>
 * FUNCTION
 *  srv_bt_cm_reg_pairing_permission
 * DESCRIPTION
 *  This function is to register the pairing permission function call
 * PARAMETERS
 *  U32 profile_id:    to specify the profile uuid
 *  void *fp      :    registered function call for CM to check if pairing procedure is permitted
 *                     the input argument of the registerd function call is srv_bt_cm_bt_addr, CM will pass this
 *                     information to registered function call.
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_bt_cm_reg_pairing_permission(U32 profile_id, void* fp);
/* DOM-NOT_FOR_SDK-END */


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Ext_other>
 * FUNCTION
 *  srv_bt_cm_unreg_pairing_permission
 * DESCRIPTION
 *  This function is to unregister the pairing permission function call
 * PARAMETERS
 *  profile_id:    to specify the profile uuid
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_bt_cm_unreg_pairing_permission(U32 profile_id);
/* DOM-NOT_FOR_SDK-END */


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Ext_other>
 * FUNCTION
 *  srv_bt_cm_send_msg
 * DESCRIPTION
 *  This function is the handler for send msg to XXX module
 * PARAMETERS
 *  dest_module :    [IN]    destination module
 *  sap_id      :    [IN]    SAP id
 *  msg_id      :    [IN]    message id
 *  p_local_para:    [IN]    local parameter
 *  p_peer_buff :    [IN]    peer buffer
 * RETURNS
 *  void
 *****************************************************************************/
extern void srv_bt_cm_send_msg(U32 dest_module, U32 sap_id, U32 msg_id, void* p_local_para, void* p_peer_buff);
/* DOM-NOT_FOR_SDK-END */


#ifdef __DM_LAWMO_SUPPORT__
/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * FUNCTION
 *  srv_bt_cm_lock_bt_module_req
 * DESCRIPTION
 *  This function is to lock BT module and send MSG_ID_BT_LOCK_REQ
 * PARAMETERS
 *  void
 * RETURNS
 *  MMI_TRUE : success
 *  MMI_FALSE: failed
 *****************************************************************************/
extern MMI_BOOL srv_bt_cm_lock_bt_module_req(void);
/* DOM-NOT_FOR_SDK-END */
#endif /*__DM_LAWMO_SUPPORT__*/

#if defined(__MMI_HIDD_SUPPORT__)
extern MMI_BOOL srv_bt_cm_dev_is_support_hid(srv_bt_cm_dev_struct *dev_p);
#endif /*defined(__MMI_HIDD_SUPPORT__)*/

/**********************************************************************************/
typedef enum
{
    SRV_BT_CM_EVENT_ACTIVATE                    = 0x00000001, /* activate */
    SRV_BT_CM_EVENT_DEACTIVATE                  = 0x00000002, /* deactivate */
    SRV_BT_CM_EVENT_INQUIRY_IND                 = 0x00000004, /* inquiry indication */
    SRV_BT_CM_EVENT_INQUIRY_COMPLETE            = 0x00000008, /* inquiry complete */

    SRV_BT_CM_EVENT_BEGIN_ACTIVATE              = 0x00000010, // begin activate
    SRV_BT_CM_EVENT_BEGIN_DEACTIVATE            = 0x00800000, // begin deactivate

    SRV_BT_CM_EVENT_BOND_RES                    = 0x00000020, /* bond result */
    SRV_BT_CM_EVENT_PAIR_IND                    = 0x00000040, /* pair indication */
    SRV_BT_CM_EVENT_PAIR_RES                    = 0x00000080, /* pair result */
//#ifdef __MMI_BT_SIMPLE_PAIR__
    SRV_BT_CM_EVENT_SECURITY_USER_CONFIRM       = 0x00000100, /* security user confirm */
    SRV_BT_CM_EVENT_SECURITY_PASSKEY_NOTIFY     = 0x00000200, /* security passkey notify */
    SRV_BT_CM_EVENT_SECURITY_KEYPRESS_NOTIFY    = 0x00000400, /* security keypress notify */
//#endif /* __MMI_BT_SIMPLE_PAIR__ */
    SRV_BT_CM_EVENT_CONNECT_REQ                 = 0x00000800, /* connect request */
    SRV_BT_CM_EVENT_CONNECT_RES                 = 0x00001000, /* connect result */
    SRV_BT_CM_EVENT_DISCONNECT_IND              = 0x00002000, /* disconnect indication */
    SRV_BT_CM_EVENT_RELEASE_ALL_CONN            = 0x00004000, /* release all connection */
    SRV_BT_CM_EVENT_REFRESH_PROFILE             = 0x00008000, /* refresh profile */
//#ifdef __MMI_BT_AUTHORIZE__
    SRV_BT_CM_EVENT_SET_AUTHORIZE               = 0x00010000, /* set authorize */
    SRV_BT_CM_EVENT_UNBLOCK                     = 0x00020000, /* unblock device */
//#endif  /* __MMI_BT_AUTHORIZE__ */
    SRV_BT_CM_EVENT_MYDEV_DEL                   = 0x00040000, /* mydevice delete */
    //SRV_BT_CM_EVENT_MYDEV_DEL_ALL             = 0x00080000,
    SRV_BT_CM_EVENT_SET_VISIBILITY              = 0x00100000, /* set visibility */
    SRV_BT_CM_EVENT_SET_NAME                    = 0x00200000, /* set name */
    SRV_BT_CM_EVENT_SET_AUTHENTICATION          = 0x00400000, /* set authentication */
//#ifdef __MMI_SIMAP_SUPPORT__
    SRV_BT_CM_EVENT_SET_SIMAP                   = 0x01000000, /* set SIMAP */
//#endif  /* __MMI_SIMAP_SUPPORT__ */
    SRV_BT_CM_EVENT_SCO_IND                     = 0x02000000, /* sco indication */
    SRV_BT_CM_EVENT_PANIC_IND                   = 0x04000000, /* panic inidation */
    SRV_BT_CM_EVENT_READ_REMOTE_DEV_NAME        = 0x08000000, /* read remote device */
    SRV_BT_CM_EVENT_SET_LIMIT_DISCOVERABLE_MODE = 0x10000000, /* set limit discoverable mode */
    SRV_BT_CM_EVENT_CHIP_DETECT                 = 0x20000000, /* chip auto detect */

//#ifdef __BT_BOND_CANCEL__
    SRV_BT_CM_EVENT_BOND_CANCEL                 = 0x40000000  /* bond cancel */
//#endif

    //SRV_BT_CM_EVENT_NOTIFY_CONNECTOR            = 0x40000000,
    //SRV_BT_CM_EVENT_ACL_LINK_EXCEED_MAX_NUM     = 0x20000000
} srv_bt_cm_event_enum;


/* begin activate event struct */
typedef struct
{
    S32 srv_hd;                 /* service handle*/
    void* user_data;            /* user data */
    MMI_BOOL result;            /* activate result */
} srv_bt_cm_begin_activate_struct;

    
/* activate event struct */
typedef struct
{
    S32 srv_hd;                 /* service handle*/
    void* user_data;            /* user data */
    MMI_BOOL result;            /* activate result */
} srv_bt_cm_activate_struct;


/* begin deactivate event struct */
typedef struct
{
    S32 srv_hd;                 /* service handle*/
    void* user_data;            /* user data */
    MMI_BOOL result;            /* deactivate result */
} srv_bt_cm_begin_deactivate_struct;


/* deactivate event struct */
typedef struct
{
    S32 srv_hd;                 /* service handle*/
    void* user_data;            /* user data */
    MMI_BOOL result;            /* deactivate result */
} srv_bt_cm_deactivate_struct;


/* inquiry indication event struct */
typedef struct
{
    S32 srv_hd;                 /* service handle*/
    void* user_data;            /* user data */
    U32 discovered_dev_num;     /* discovered device number */
} srv_bt_cm_inquiry_indication_struct;


/* inquiry complete event struct */
typedef struct
{
    S32 srv_hd;                 /* service handle*/
    void* user_data;            /* user data */
    S32 result;                 /* inquiry complete result */
    MMI_BOOL is_cancelled;      /* MMI_TRUE: cancelled by MMI
                                 * MMI_FALSE: not cancelled by MMI */
} srv_bt_cm_inquiry_complete_struct;


/* bond result event struct */
typedef struct
{
    S32 srv_hd;                 /* service handle*/
    void* user_data;            /* user data */
    srv_bt_cm_bt_addr dev_addr; /* device address */
    S32 result;                 /* MMI_TRUE: success */

    //MMI_BOOL is_first_bond;  /* MMI_TRUE: first pair, MMI_FALSE: not first pair */
} srv_bt_cm_bond_res_struct;


/* pair indication struct */
typedef struct
{
    S32 srv_hd;                 /* service handle*/
    void* user_data;            /* user data */
    U8* dev_name;                 /* device name */
    U8 enable_16digits_pin_code;  /* whether enable 16 digits pin code */
    srv_bt_cm_bt_addr dev_addr;   /* device address */
} srv_bt_cm_pair_ind_struct;


/* paire result event struct */
typedef struct
{
    S32 srv_hd;                 /* service handle*/
    void* user_data;            /* user data */
    srv_bt_cm_bt_addr dev_addr; /* device address */
    S32 result;                 /* MMI_TRUE: success, MMI_FALSE: fail */
    MMI_BOOL is_first_pair;     /* MMI_TRUE: first pair, MMI_FALSE: not first pair */
} srv_bt_cm_pair_res_struct;


/* security user confirm event struct */
typedef struct
{
    S32 srv_hd;                 /* service handle*/
    void* user_data;            /* user data */
    U8* dev_name;               /* device name */
    srv_bt_cm_bt_addr dev_addr; /* device address */
    U8 display_numeric;         /* whether display numeric */
    U8* passcode;               /* passcode */
} srv_bt_cm_security_user_confirm_struct;


/* security passkey event struct */
typedef struct
{
    S32 srv_hd;                 /* service handle*/
    void* user_data;            /* user data */
    U8* dev_name;               /* device name */
    srv_bt_cm_bt_addr dev_addr; /* device address */
    U8* passcode;               /* passcode */
} srv_bt_cm_security_passkey_struct;


/* security keypress event struct*/
typedef struct
{
    S32 srv_hd;                 /* service handle*/
    void* user_data;            /* user data */
    srv_bt_cm_bt_addr dev_addr; /* device address */
    U8 num_digit;               /* numeic digit */
} srv_bt_cm_security_keypress_struct;


/* connect request event struct */
typedef struct
{
    S32 srv_hd;                 /* service handle*/
    void* user_data;            /* user data */
    U8* dev_name;               /* device name */
    srv_bt_cm_bt_addr dev_addr; /* device address */
    U32 conn_id;                /* connection ID */
    U32 profile_id;             /* profile ID */
} srv_bt_cm_conn_req_struct;


/* connect result event struct */
typedef struct
{
    S32 srv_hd;                 /* service handle*/
    void* user_data;            /* user data */
    srv_bt_cm_bt_addr* dev_addr;/* device address */
    U32 profile_id;             /* profile ID */
    S32 result;                 /* connect result */
} srv_bt_cm_conn_res_struct;


/* disconnect indication event struct */
typedef struct
{
    S32 srv_hd;                 /* service handle*/
    void* user_data;            /* user data */
    srv_bt_cm_bt_addr* dev_addr; /* device address */
    U32 profile_id;              /* profile ID */
/* DOM-NOT_FOR_SDK-BEGIN */
    MMI_BOOL passive;
/* DOM-NOT_FOR_SDK-END */
    //MMI_BOOL result;             /* disconnect result */
} srv_bt_cm_disconnect_ind_struct;


/* release all device event struct */
typedef struct
{
    S32 srv_hd;                 /* service handle*/
    void* user_data;            /* user data */
    srv_bt_cm_bt_addr* dev_addr;/* device address */
    MMI_BOOL result;            /* release all device result */
} srv_bt_cm_release_all_struct;


/* refresh service list event struct */
typedef struct
{
    S32 srv_hd;                 /* service handle*/
    void* user_data;            /* user data */
    S32 result;                 /* release all service list result */
} srv_bt_cm_refresh_service_list_struct;


/* set authorize event struct */
typedef struct
{
    S32 srv_hd;                 /* service handle*/
    void* user_data;            /* user data */
    MMI_BOOL result;            /* set authorize result */
} srv_bt_cm_set_authorize_struct;


/* unblock event struct */
typedef struct
{
    S32 srv_hd;                 /* service handle*/
    void* user_data;            /* user data */
    MMI_BOOL result;            /* unblock event */
} srv_bt_cm_unblock_struct;


/* mydevice delete event struct */
typedef struct
{
    S32 srv_hd;                 /* service handle*/
    void* user_data;            /* user data */
    MMI_BOOL result;            /* my device delete result */
} srv_bt_cm_mydev_del_struct;


/* typedef struct */
/* { */
/*     MMI_BOOL result; */
/* } srv_bt_cm_mydev_del_all_struct; */


/* set visibility event struct */
typedef struct
{
    S32 srv_hd;                 /* service handle*/
    void* user_data;            /* user data */
    MMI_BOOL result;            /* set visibility result */
    MMI_BOOL is_from_mmi;       /* to identify whether the action is initiated by MMI
                                 * or change the visibility just by CM service due to A2DP connected */
} srv_bt_cm_set_visibility_struct;

    
/* set name event struct */
typedef struct
{
    S32 srv_hd;                 /* service handle*/
    void* user_data;            /* user data */
    S32 result;                 /* set name result */
} srv_bt_cm_set_name_struct;

    
/* set authentication event struct */
typedef struct
{
    S32 srv_hd;                 /* service handle*/
    void* user_data;            /* user data */
    S32 result;                 /* set authentication result */
} srv_bt_cm_set_authentication_struct;

    
/* set SIMAP event struct */
typedef struct
{
    S32 srv_hd;                 /* service handle*/
    void* user_data;            /* user data */
    MMI_BOOL result;            /* set SIMAP result */
} srv_bt_cm_set_simap_struct;


/* sco indication event struct */
typedef struct
{
    S32 srv_hd;                 /* service handle*/
    void* user_data;            /* user data */
    MMI_BOOL result;            /* sco indication result */
} srv_bt_cm_sco_ind_struct;


/* panic indication struct */
typedef struct
{
    S32 srv_hd;                 /* service handle*/
    void* user_data;            /* user data */
} srv_bt_cm_panic_ind_struct;


/* read remote device name struct */
typedef struct
{
    S32 srv_hd;                  /* service handle*/
    void* user_data;             /* user data */
    srv_bt_cm_bt_addr* dev_addr; /* device address */
} srv_bt_cm_read_remote_dev_name_struct;
    

/* set limit discoverable mode event struct */
typedef struct
{
    S32 srv_hd;                 /* service handle*/
    void* user_data;            /* user data */
    S32 result;                 /* set limit discoverable mode result */
} srv_bt_cm_set_limit_discoverable_mode_struct;

typedef struct
{
    S32 srv_hd;                 /* service handle*/
    void* user_data;            /* user data */
    S32 result;                 /* 1: chip available, 0: chip not available */
} srv_bt_cm_chip_detect_struct;

// typedef struct
// {
//     U32 conn_id;
//     U32 profile_id;
//     MMI_BOOL result;
// } srv_bt_cm_notify_connector_struct;

// #ifdef __BT_BOND_CANCEL__
typedef struct
{
    S32 srv_hd;                 /* service handle*/
    void* user_data;            /* user data */
    MMI_BOOL result;            /* bond cancel result */
} srv_bt_cm_bond_cancel_result;
// #endif
    

/* bluetooth cm service handle form */
typedef void (*srv_bt_cm_notifier)(U32 event, void* para);


/****************************************************************************** 
 * FUNCTION
 *  srv_bt_cm_set_notify
 * DESCRIPTION
 *  Bluetooth CM set notifier, after set successfully,
 *  notifier will receive the event notification it it happens.
 * PARAMETERS
 *  notifier  :    [IN]    notifier, refer to srv_bt_cm_notifier
 *  event_mask:    [IN]    event mask, refer to srv_bt_cm_event_enum
 *  user_data :    [IN]    user data
 *  
 * RETURNS
 *  service handle, if it is less than 0, it means invalid handle
 ******************************************************************************/
extern S32 srv_bt_cm_set_notify(srv_bt_cm_notifier notifier, U32 event_mask, void* user_data);


/****************************************************************************** 
 * FUNCTION
 *  srv_bt_cm_reset_notify
 * DESCRIPTION
 *  this function is to reset notifier, notifier will not receive any event from CM service any more
 * PARAMETERS
 *  srv_hd :    [IN]    notify handler, returned by srv_bt_cm_set_notify()
 *  
 * RETURNS
 *  S32 : refer to srv_bt_cm_result_codes_enum
 ******************************************************************************/
extern S32 srv_bt_cm_reset_notify(S32 srv_hd);


#ifdef __BT_AUTO_DETECT_SUPPORT__
/*****************************************************************************
 * <GROUP Ext_local_dev_setting>
 * FUNCTION
 *  srv_bt_chip_available
 * DESCRIPTION
 *  This function is to check the whether bluetooth chip is available.
 * PARAMETERS
 *  void
 * RETURNS
 *  1: chip available.
 *  0: chip not available.
 *****************************************************************************/
U32 srv_bt_chip_available(void);
#endif



/*--------------------------------------------------------------------------------*/
/* API will be moved Btcmsrvprot.h */
/*--------------------------------------------------------------------------------*/
/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Int_local_dev_set> 
 * FUNCTION
 *  srv_bt_cm_get_state
 * DESCRIPTION
 *  This function is to get current bluetooth state
 * PARAMETERS
 *  void
 * RETURNS
 *  srv_bt_cm_state_enum : current bluetooth state
 *****************************************************************************/
srv_bt_cm_state_enum srv_bt_cm_get_state(void);
/* DOM-NOT_FOR_SDK-END */


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Int_other> 
 * FUNCTION
 *  srv_bt_cm_get_flag
 * DESCRIPTION
 *  This function is to get flag value
 * PARAMETERS
 *  get_flag:    [IN]    the flag
 * RETURNS
 *  U32 : flag value
 *****************************************************************************/
U32 srv_bt_cm_get_flag(U32 get_flag);
/* DOM-NOT_FOR_SDK-END */


/* the default device type enum */
typedef enum
{
    SRV_BT_CM_DEFAULT_DEV_TYPE_HS,      /* default headset */
    SRV_BT_CM_DEFAULT_DEV_TYPE_HID,     /* default HID device */   
    SRV_BT_CM_DEFAULT_DEV_TYPE_TOTAL    /* last enum for default device type */
} srv_bt_cm_default_dev_type_enum;


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Ext_paired_dev_setting>
 * FUNCTION
 *  srv_bt_cm_get_default_dev_addr
 * DESCRIPTION
 *  This function is to get default device address, 
 *  NULL means default device not existed
 * PARAMETERS
 *  dev_type:    [IN]    default device type
 * RETURNS
 *  srv_bt_cm_bt_addr        default device address pointer, 
 *                           NULL means default device not existed
 *****************************************************************************/
srv_bt_cm_bt_addr* srv_bt_cm_get_default_dev_addr(srv_bt_cm_default_dev_type_enum dev_type);
/* DOM-NOT_FOR_SDK-END */


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Ext_paired_dev_setting>
 * FUNCTION
 *  srv_bt_cm_set_default_dev
 * DESCRIPTION
 *  This function is to set default device
 * PARAMETERS
 *  dev_type:    [IN]    default device type
 *  dev_addr:    [IN]    device address
 * RETURNS
 *  srv_bt_cm_result_codes_enum : the result of setting default device
 *****************************************************************************/
srv_bt_cm_result_codes_enum srv_bt_cm_set_default_dev(srv_bt_cm_default_dev_type_enum dev_type, srv_bt_cm_bt_addr* dev_addr);
/* DOM-NOT_FOR_SDK-END */


/* DOM-NOT_FOR_SDK-BEGIN */
/* FuncPtr: a pointer to a function which is to connect headset */
typedef void (*srv_bt_cm_headset_connect_callback)(MMI_BOOL b_success);
/* DOM-NOT_FOR_SDK-END */


/* DOM-NOT_FOR_SDK-BEGIN */
/*****************************************************************************
 * <GROUP Ext_other>
 * FUNCTION
 *  srv_bt_cm_connect_default_headset
 * DESCRIPTION
 *  This function is to process connect default headset request
 * PARAMETERS
 *  conn_cb    :    connection callback function
 * RETURNS
 *  MMI_TRUE  : success to connect
 *  MMI_FALSE : otherwise
 *****************************************************************************/
extern MMI_BOOL srv_bt_cm_connect_default_headset(srv_bt_cm_headset_connect_callback conn_cb);
/* DOM-NOT_FOR_SDK-END */


/* DOM-NOT_FOR_SDK-BEGIN */
/****************************************************************************** 
 * FUNCTION
 *  srv_bt_cm_is_dev_addr_equal
 * DESCRIPTION
 *  this function is used to judge whether two bluetooth address is equal
 * PARAMETERS
 *  dev_addr1    [IN]    device address
 *  dev_addr2    [IN]    device address
 *  
 * RETURNS
 *  MMI_TRUE : two device address is equal
 *  MMI_FALSE: two device address is not equal
 ******************************************************************************/
extern MMI_BOOL srv_bt_cm_is_dev_addr_equal(const srv_bt_cm_bt_addr* dev_addr1, const srv_bt_cm_bt_addr* dev_addr2);
/* DOM-NOT_FOR_SDK-END */

//#endif /* __MMI_BT_SUPPORT__ */
#ifdef __MMI_BT_SUPPORT__
void srv_bt_cm_set_btdialor_app_mode(MMI_BOOL val);
MMI_BOOL srv_bt_cm_get_btdialor_app_mode(void);
#endif

#ifdef __cplusplus
}   /* extern "C" */
#endif

#endif /* BT_CM_SRV_GPROT_H */