Beispiel #1
0
            public bool Disconnect()
            {
                bool result = false;

                if (LinkManager != null)
                {
                    byte[] disconnectRequest = LLCP.GetFrame(DSAP, LLCP.PTYPES.DISC, SSAP, 0, new byte[0]);
                    byte[] response          = new byte[0];
                    if (LinkManager.Tranceive(disconnectRequest, out response))
                    {
                        // check response
                        result = true;
                    }
                }
                return(result);
            }
Beispiel #2
0
            public bool SendMessage(byte[] message, out byte[] response)
            {
                bool result = false;

                response = new byte[0];
                if (LinkManager != null)
                {
                    byte[] llcp = LLCP.GetFrame(DSAP, LLCP.PTYPES.I, SSAP, 0, message);
                    if (LinkManager.Tranceive(llcp, out response))
                    {
                        //check response
                        result = true;
                    }
                }
                return(result);
            }
Beispiel #3
0
            public bool Connect(byte ssap, LLCPParameters parameters)
            {
                bool result = false;

                if (LinkManager != null)
                {
                    this.SSAP = ssap;
                    byte[] payload        = parameters.GetParams();
                    byte[] connectRequest = LLCP.GetFrame((byte)WelKnownServiceAccessPoints.ServiceDiscoveryProtocolService, LLCP.PTYPES.CONNECT, ssap, 0, payload);
                    byte[] response       = new byte[0];
                    if (LinkManager.Tranceive(connectRequest, out response))
                    {
                        if (response.Length > 2)
                        {
                            this.DSAP = (byte)(response[2] & 0x3F);
                            // check response
                            Connected = true;
                        }
                    }
                }
                return(result);
            }