BTool.AttErrorRsp.GetATT_ErrorRsp C# (CSharp) Method

GetATT_ErrorRsp() public method

public GetATT_ErrorRsp ( HCIReplies hciReplies, bool &dataFound ) : bool
hciReplies HCIReplies
dataFound bool
return bool
        public bool GetATT_ErrorRsp(HCIReplies hciReplies, ref bool dataFound)
        {
            dataFound = false;
            bool flag;
            if (flag = rspHdlrsUtils.CheckValidResponse(hciReplies))
            {
                HCIReplies.HCI_LE_ExtEvent hciLeExtEvent = hciReplies.HciLeExtEvent;
                HCIReplies.HCI_LE_ExtEvent.ATT_ErrorRsp attErrorRsp = hciLeExtEvent.AttErrorRsp;
                HCIReplies.LE_ExtEventHeader leExtEventHeader = hciLeExtEvent.Header;
                if (attErrorRsp != null)
                {
                    dataFound = true;
                    if (leExtEventHeader.EventStatus != 0)
                        flag = rspHdlrsUtils.UnexpectedRspEventStatus(hciReplies, "AttErrorRsp");
                    else
                        SendRspCallback(hciReplies, true);
                }
            }
            if (!flag && dataFound)
                SendRspCallback(hciReplies, false);
            return flag;
        }

Usage Example

Esempio n. 1
0
        private bool ProcessQData(HCIReplies hciReplies, ref bool dataFound)
        {
            bool success = true;

            dataFound = false;
            if (hciReplies == null || hciReplies.HciLeExtEvent == null)
            {
                return(false);
            }
            switch (hciReplies.HciLeExtEvent.Header.EventCode)
            {
            case 1281:
                success = AttErrorRsp.GetATT_ErrorRsp(hciReplies, ref dataFound);
                break;

            case 1285:
                success = m_attFindInfoRsp.GetATT_FindInfoRsp(hciReplies, ref dataFound);
                break;

            case 1287:
                success = m_attFindByTypeValueRsp.GetATT_FindByTypeValueRsp(hciReplies, ref dataFound);
                break;

            case 1289:
                success = m_attReadByTypeRsp.GetATT_ReadByTypeRsp(hciReplies, ref dataFound);
                break;

            case 1291:
                success = AttReadRsp.GetATT_ReadRsp(hciReplies, ref dataFound);
                break;

            case 1293:
                success = AttReadBlobRsp.GetATT_ReadBlobRsp(hciReplies, ref dataFound);
                break;

            case 1297:
                success = m_attReadByGrpTypeRsp.GetATT_ReadByGrpTypeRsp(hciReplies, ref dataFound);
                break;

            case 1299:
                success = AttWriteRsp.GetATT_WriteRsp(hciReplies, ref dataFound);
                break;

            case 1303:
                success = AttPrepareWriteRsp.GetATT_PrepareWriteRsp(hciReplies, ref dataFound);
                break;

            case 1305:
                success = AttExecuteWriteRsp.GetATT_ExecuteWriteRsp(hciReplies, ref dataFound);
                break;

            case 1307:
                success = AttHandleValueNotification.GetATT_HandleValueNotification(hciReplies, ref dataFound);
                break;

            case 1309:
                success = AttHandleValueIndication.GetATT_HandleValueIndication(hciReplies, ref dataFound);
                break;

            case 1663:
                success = ExtCmdStatus.GetExtensionCommandStatus(hciReplies, ref dataFound);
                break;
            }
            return(success);
        }