示例#1
0
        internal static void RaiseSdpEvent(StuffSdpQueryBluetopia stuff, IntPtr pSDP_Response_Data, uint sdpRequestId)
        {
            var       done  = new ManualResetEvent(false);
            Exception error = null;

            try {
                ThreadPool.QueueUserWorkItem(delegate {
                    try {
                        stuff.DutSdpQuery.HandleSDP_Response_Callback(stuff.StackId,
                                                                      sdpRequestId,
                                                                      pSDP_Response_Data, 0);
                    } catch (Exception ex) {
                        error = ex;
                    } finally {
                        done.Set();
                    }
                });
            } finally {
                var signalled = done.WaitOne(10 * 1000);
                //done.Close();
                Debug.Assert(signalled, "NOT done.signalled");
            }
            if (error != null)
            {
                throw new System.Reflection.TargetInvocationException(error);
            }
        }
        // TODO (Mockery_VerifyAllExpectationsHaveBeenMet();
        // TODO (Uuid16).

        internal static StuffSdpQueryBluetopia Create_BluetopiaSdpQuery()
        {
            var stuff = new StuffSdpQueryBluetopia();

            BluetopiaTesting.InitMockery(stuff, 205);
            //
            stuff.SetDut(new BluetopiaSdpQuery(stuff.GetFactory()));
            return(stuff);
        }