Esempio n. 1
0
        void GetInfo(ref BluetoothAddress addr)
        {
            BtSdkError ret;
            var        props = new Structs.BtSdkRemoteDevicePropertyStru();

            ret = _factory.Api.Btsdk_GetRemoteDeviceProperty(_hDev, out props);
            BluesoleilUtils.CheckAndThrow(ret, "Btsdk_GetRemoteDeviceProperty");
            //
            if ((props.mask & Structs.BtSdkRemoteDevicePropertyStru.Mask.Handle) != 0)
            {
                Debug.Assert(_hDev == props.dev_hdl, "hDev");
            }
            else
            {
                Debug.Fail("Handle unknown?!?");
            }
            if ((props.mask & Structs.BtSdkRemoteDevicePropertyStru.Mask.Address) != 0)
            {
                addr = BluesoleilUtils.ToBluetoothAddress(props.bd_addr);
            }
            if ((props.mask & Structs.BtSdkRemoteDevicePropertyStru.Mask.Class) != 0)
            {
                _cod = new ClassOfDevice(props.dev_class);
            }
            if ((props.mask & Structs.BtSdkRemoteDevicePropertyStru.Mask.Name) != 0)
            {
                Debug.Assert(props.name.Length == StackConsts.BTSDK_DEVNAME_LEN,
                             "props.name.Length: " + props.name.Length + ", BTSDK_DEVNAME_LEN: " + StackConsts.BTSDK_DEVNAME_LEN);
                string name = BluesoleilUtils.FromNameString(props.name);
                _cachedName = name;
            }
            if ((props.mask & Structs.BtSdkRemoteDevicePropertyStru.Mask.LmpInfo) != 0)
            {
                var fs = (LmpFeatures)BitConverter.ToInt64(props.lmp_info.lmp_feature, 0);
                var v  = new RadioVersions(props.lmp_info.lmp_version, props.lmp_info.lmp_subversion,
                                           fs, props.lmp_info.manuf_name);
                _versions = v;
            }
            //props.
        }
Esempio n. 2
0
 internal static extern BtSdkError Btsdk_GetRemoteDeviceProperty(BTDEVHDL dev_hdl, out Structs.BtSdkRemoteDevicePropertyStru rmt_dev_prop);
 BtSdkError IBluesoleilApi.Btsdk_GetRemoteDeviceProperty(BTDEVHDL dev_hdl, out Structs.BtSdkRemoteDevicePropertyStru rmt_dev_prop)
 {
     return(NativeMethods.Btsdk_GetRemoteDeviceProperty(dev_hdl, out rmt_dev_prop));
 }