Exemple #1
0
        internal BluesoleilRadio(BluesoleilFactory fcty)
        {
            _fcty = fcty;
            _fcty.SdkInit();
            BtSdkError retAddr, ret;

            byte[] bd_addr = new byte[StackConsts.BTSDK_BDADDR_LEN];
            ret = retAddr = _fcty.Api.Btsdk_GetLocalDeviceAddress(bd_addr);
            BluesoleilUtils.Assert(retAddr, "Btsdk_GetLocalDeviceAddress");
            if (ret == BtSdkError.OK)
            {
                _addr = BluesoleilUtils.ToBluetoothAddress(bd_addr);
            }
            else
            {
                _addr = BluetoothAddress.None;
            }
            //
            byte[] arr = new byte[500];
            UInt16 len = checked ((UInt16)arr.Length);

            ret = _fcty.Api.Btsdk_GetLocalName(arr, ref len);
            if (retAddr == BtSdkError.OK)
            {
                BluesoleilUtils.Assert(ret, "Btsdk_GetLocalName");
            }
            if (ret == BtSdkError.OK)
            {
                _name = BluesoleilUtils.FromNameString(arr, len);
            }
            else
            {
                _name = string.Empty;
            }
            //
            uint cod;

            ret = _fcty.Api.Btsdk_GetLocalDeviceClass(out cod);
            //BluesoleilUtils.CheckAndThrow(ret);
            if (retAddr == BtSdkError.OK)
            {
                Debug.Assert(ret == BtSdkError.OK, "Btsdk_GetLocalDeviceClass ret: " + ret);
            }
            _cod = new ClassOfDevice(cod);
            //
            _lmp = new Structs.BtSdkLocalLMPInfoStru(HciVersion.Unknown);
            ret  = _fcty.Api.Btsdk_GetLocalLMPInfo(ref _lmp);
            if (retAddr == BtSdkError.OK)
            {
                BluesoleilUtils.Assert(ret, "Btsdk_GetLocalLMPInfo");
            }
        }
Exemple #2
0
 internal static extern BtSdkError Btsdk_GetLocalLMPInfo(ref Structs.BtSdkLocalLMPInfoStru lmp_info);
 BtSdkError IBluesoleilApi.Btsdk_GetLocalLMPInfo(ref Structs.BtSdkLocalLMPInfoStru lmp_info)
 {
     return(NativeMethods.Btsdk_GetLocalLMPInfo(ref lmp_info));
 }