예제 #1
0
        internal static BluetoothDeviceSdpData ConvertStructToSdpData(BluetoothDeviceSdpStruct structData)
        {
            BluetoothDeviceSdpData resultData = new BluetoothDeviceSdpData();
            Collection <string>    uuidList   = null;

            if (structData.ServiceCount > 0)
            {
                IntPtr[] extensionList = new IntPtr[structData.ServiceCount];
                Marshal.Copy(structData.ServiceUuid, extensionList, 0, structData.ServiceCount);
                uuidList = new Collection <string> ();
                foreach (IntPtr extension in extensionList)
                {
                    string uuid = Marshal.PtrToStringAnsi(extension);
                    uuidList.Add(uuid);
                }
            }

            resultData.Uuid    = uuidList;
            resultData.Address = structData.DeviceAddress;

            return(resultData);
        }
예제 #2
0
 internal ServiceSearchedEventArgs(BluetoothError result, BluetoothDeviceSdpData sdpData)
 {
     _result  = result;
     _sdpData = sdpData;
 }