2 * Copyright (C) 2010 NXP Semiconductors
\r
4 * Licensed under the Apache License, Version 2.0 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://www.apache.org/licenses/LICENSE-2.0
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
18 * =========================================================================== *
\r
21 * \file phHciNfc_ISO15693.c *
\r
22 * \brief HCI ISO-15693 management routines. *
\r
25 * Project: NFC-FRI-1.1 *
\r
27 * $Date: Thu Feb 11 18:54:47 2010 $ *
\r
28 * $Author: ing04880 $ *
\r
29 * $Revision: 1.7 $ *
\r
32 * =========================================================================== *
\r
36 ***************************** Header File Inclusion ****************************
\r
38 #include <phNfcCompId.h>
\r
39 #include <phHciNfc_Pipe.h>
\r
40 #include <phHciNfc_RFReader.h>
\r
41 #include <phOsalNfc.h>
\r
43 #if defined (TYPE_ISO15693)
\r
44 #include <phHciNfc_ISO15693.h>
\r
47 ****************************** Macro Definitions *******************************
\r
49 #define ISO_15693_INVENTORY_INDEX 0x01U
\r
50 #define ISO_15693_AFI_INDEX 0x02U
\r
52 #define ISO_15693_INVENTORY_LENGTH 0x0AU
\r
53 #define ISO_15693_AFI_LENGTH 0x01U
\r
55 #define ISO_15693_SINGLE_TAG_FOUND 0x00U
\r
56 #define ISO_15693_MULTIPLE_TAGS_FOUND 0x03U
\r
59 *************************** Structure and Enumeration ***************************
\r
63 *************************** Static Function Declaration **************************
\r
68 phHciNfc_ISO15693_InfoUpdate(
\r
69 phHciNfc_sContext_t *psHciContext,
\r
77 phHciNfc_Recv_ISO15693_Response(
\r
90 phHciNfc_Recv_ISO15693_Event(
\r
102 *************************** Function Definitions ***************************
\r
106 phHciNfc_ISO15693_Init_Resources(
\r
107 phHciNfc_sContext_t *psHciContext
\r
110 NFCSTATUS status = NFCSTATUS_SUCCESS;
\r
111 phHciNfc_ISO15693_Info_t *ps_15693_info=NULL;
\r
112 if( NULL == psHciContext )
\r
114 status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_INVALID_PARAMETER);
\r
118 if (NULL != psHciContext->p_iso_15693_info)
\r
120 status = NFCSTATUS_SUCCESS;
\r
122 else if(( NULL == psHciContext->p_iso_15693_info ) &&
\r
123 (phHciNfc_Allocate_Resource((void **)(&ps_15693_info),
\r
124 sizeof(phHciNfc_ISO15693_Info_t))== NFCSTATUS_SUCCESS)
\r
127 psHciContext->p_iso_15693_info = ps_15693_info;
\r
128 ps_15693_info->current_seq = ISO15693_INVENTORY;
\r
129 ps_15693_info->next_seq = ISO15693_INVENTORY;
\r
130 ps_15693_info->ps_15693_pipe_info = NULL;
\r
134 status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_INSUFFICIENT_RESOURCES);
\r
143 phHciNfc_ISO15693_Get_PipeID(
\r
144 phHciNfc_sContext_t *psHciContext,
\r
148 NFCSTATUS status = NFCSTATUS_SUCCESS;
\r
149 if( (NULL != psHciContext)
\r
150 && ( NULL != ppipe_id )
\r
151 && ( NULL != psHciContext->p_iso_15693_info )
\r
154 phHciNfc_ISO15693_Info_t *ps_15693_info = NULL;
\r
155 ps_15693_info = (phHciNfc_ISO15693_Info_t *)
\r
156 psHciContext->p_iso_15693_info ;
\r
157 *ppipe_id = ps_15693_info->ps_15693_pipe_info->pipe.pipe_id;
\r
161 status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_INVALID_PARAMETER);
\r
168 phHciNfc_ISO15693_Update_PipeInfo(
\r
169 phHciNfc_sContext_t *psHciContext,
\r
171 phHciNfc_Pipe_Info_t *pPipeInfo
\r
174 NFCSTATUS status = NFCSTATUS_SUCCESS;
\r
175 if((NULL == psHciContext) || (NULL == pPipeInfo))
\r
177 status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_INVALID_PARAMETER);
\r
179 else if(NULL == psHciContext->p_iso_15693_info)
\r
181 status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_FEATURE_NOT_SUPPORTED);
\r
185 phHciNfc_ISO15693_Info_t *ps_15693_info = NULL;
\r
186 ps_15693_info = (phHciNfc_ISO15693_Info_t *)
\r
187 psHciContext->p_iso_15693_info ;
\r
189 /* Update the pipe_id of the ISO15693 Gate obtained from
\r
190 the HCI Response */
\r
191 ps_15693_info->ps_15693_pipe_info = pPipeInfo;
\r
192 ps_15693_info->pipe_id = pipeID;
\r
193 ps_15693_info->ps_15693_pipe_info->pipe.pipe_id = pipeID;
\r
194 /* Update the Response Receive routine of the ISO15693 Gate */
\r
195 pPipeInfo->recv_resp = &phHciNfc_Recv_ISO15693_Response;
\r
196 /* Update the event Receive routine of the ISO15693 Gate */
\r
197 pPipeInfo->recv_event = &phHciNfc_Recv_ISO15693_Event;
\r
204 phHciNfc_ISO15693_Update_Info(
\r
205 phHciNfc_sContext_t *psHciContext,
\r
207 void *iso_15693_info
\r
210 NFCSTATUS status = NFCSTATUS_SUCCESS;
\r
212 if (NULL == psHciContext)
\r
214 status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_INVALID_PARAMETER);
\r
216 else if(NULL == psHciContext->p_iso_15693_info)
\r
218 status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_FEATURE_NOT_SUPPORTED);
\r
222 phHciNfc_ISO15693_Info_t *ps_15693_info = NULL;
\r
223 ps_15693_info = (phHciNfc_ISO15693_Info_t *)
\r
224 psHciContext->p_iso_15693_info;
\r
228 case HCI_ISO_15693_ENABLE:
\r
230 if (NULL != iso_15693_info)
\r
232 ps_15693_info->enable_iso_15693_gate =
\r
233 *((uint8_t *)iso_15693_info);
\r
237 case HCI_ISO_15693_INFO_SEQ:
\r
239 ps_15693_info->current_seq = ISO15693_INVENTORY;
\r
240 ps_15693_info->next_seq = ISO15693_INVENTORY;
\r
245 status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_INVALID_PARAMETER);
\r
255 phHciNfc_ISO15693_Info_Sequence (
\r
260 NFCSTATUS status = NFCSTATUS_SUCCESS;
\r
261 phHciNfc_sContext_t *psHciContext = ((phHciNfc_sContext_t *)psHciHandle);
\r
262 if( (NULL == psHciContext)
\r
263 || (NULL == pHwRef)
\r
266 status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_INVALID_PARAMETER);
\r
268 else if((NULL == psHciContext->p_iso_15693_info) ||
\r
269 (HCI_ISO_15693_ENABLE !=
\r
270 ((phHciNfc_ISO15693_Info_t *)(psHciContext->p_iso_15693_info))->
\r
271 enable_iso_15693_gate))
\r
273 status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_FEATURE_NOT_SUPPORTED);
\r
277 phHciNfc_ISO15693_Info_t *ps_15693_info = NULL;
\r
278 phHciNfc_Pipe_Info_t *ps_pipe_info = NULL;
\r
279 uint8_t pipeid = 0;
\r
281 ps_15693_info = (phHciNfc_ISO15693_Info_t *)
\r
282 psHciContext->p_iso_15693_info;
\r
283 ps_pipe_info = ps_15693_info->ps_15693_pipe_info;
\r
285 if(NULL == ps_pipe_info )
\r
287 status = PHNFCSTVAL(CID_NFC_HCI,
\r
288 NFCSTATUS_INVALID_HCI_SEQUENCE);
\r
292 switch(ps_15693_info->current_seq)
\r
294 case ISO15693_INVENTORY:
\r
296 ps_pipe_info->reg_index = ISO_15693_INVENTORY_INDEX;
\r
297 pipeid = ps_pipe_info->pipe.pipe_id ;
\r
298 /* Fill the data buffer and send the command to the
\r
301 phHciNfc_Send_Generic_Cmd( psHciContext, pHwRef,
\r
302 pipeid, (uint8_t)ANY_GET_PARAMETER);
\r
303 if(NFCSTATUS_PENDING == status )
\r
305 ps_15693_info->next_seq = ISO15693_AFI;
\r
311 ps_pipe_info->reg_index = ISO_15693_AFI_INDEX;
\r
312 pipeid = ps_pipe_info->pipe.pipe_id ;
\r
313 /* Fill the data buffer and send the command to the
\r
316 phHciNfc_Send_Generic_Cmd( psHciContext, pHwRef,
\r
317 pipeid, (uint8_t)ANY_GET_PARAMETER);
\r
318 if(NFCSTATUS_PENDING == status )
\r
320 ps_15693_info->next_seq = ISO15693_END_SEQUENCE;
\r
324 case ISO15693_END_SEQUENCE:
\r
326 phNfc_sCompletionInfo_t CompInfo;
\r
327 if (ISO_15693_MULTIPLE_TAGS_FOUND ==
\r
328 ps_15693_info->multiple_tgts_found)
\r
330 CompInfo.status = NFCSTATUS_MULTIPLE_TAGS;
\r
334 CompInfo.status = NFCSTATUS_SUCCESS;
\r
337 CompInfo.info = &(ps_15693_info->iso15693_info);
\r
339 ps_15693_info->iso15693_info.RemDevType =
\r
340 phHal_eISO15693_PICC;
\r
341 ps_15693_info->current_seq = ISO15693_INVENTORY;
\r
342 ps_15693_info->next_seq = ISO15693_INVENTORY;
\r
343 status = NFCSTATUS_SUCCESS;
\r
344 /* Notify to the upper layer */
\r
345 phHciNfc_Tag_Notify(psHciContext, pHwRef,
\r
346 NFC_NOTIFY_TARGET_DISCOVERED,
\r
352 status = PHNFCSTVAL(CID_NFC_HCI,
\r
353 NFCSTATUS_INVALID_HCI_RESPONSE);
\r
364 phHciNfc_ISO15693_InfoUpdate(
\r
365 phHciNfc_sContext_t *psHciContext,
\r
367 uint8_t *reg_value,
\r
371 NFCSTATUS status = NFCSTATUS_SUCCESS;
\r
372 phHciNfc_ISO15693_Info_t *ps_15693_info = NULL;
\r
375 ps_15693_info = (phHciNfc_ISO15693_Info_t *)
\r
376 (psHciContext->p_iso_15693_info);
\r
381 case ISO_15693_INVENTORY_INDEX:
\r
383 if (ISO_15693_INVENTORY_LENGTH == reg_length)
\r
385 ps_15693_info->iso15693_info.RemoteDevInfo
\r
386 .Iso15693_Info.Flags = *(reg_value + i );
\r
388 ps_15693_info->iso15693_info.RemoteDevInfo
\r
389 .Iso15693_Info.Dsfid = *(reg_value + i );
\r
391 (void)memcpy(ps_15693_info->iso15693_info.
\r
392 RemoteDevInfo.Iso15693_Info.Uid,
\r
393 (reg_value+i), (reg_length - i ));
\r
394 ps_15693_info->iso15693_info.RemoteDevInfo
\r
395 .Iso15693_Info.UidLength = ( reg_length - i );
\r
396 HCI_PRINT_BUFFER("\tISO 15693 inventory", reg_value, reg_length);
\r
400 status = PHNFCSTVAL(CID_NFC_HCI,
\r
401 NFCSTATUS_INVALID_HCI_RESPONSE);
\r
405 case ISO_15693_AFI_INDEX:
\r
407 if (ISO_15693_AFI_LENGTH == reg_length)
\r
409 ps_15693_info->iso15693_info.RemoteDevInfo
\r
410 .Iso15693_Info.Afi = *(reg_value + i );
\r
411 HCI_PRINT_BUFFER("\tISO 15693 AFI", reg_value, reg_length);
\r
415 status = PHNFCSTVAL(CID_NFC_HCI,
\r
416 NFCSTATUS_INVALID_HCI_RESPONSE);
\r
422 status = PHNFCSTVAL(CID_NFC_HCI,
\r
423 NFCSTATUS_INVALID_HCI_RESPONSE);
\r
433 phHciNfc_Recv_ISO15693_Response(
\r
436 uint8_t *pResponse,
\r
437 #ifdef ONE_BYTE_LEN
\r
444 NFCSTATUS status = NFCSTATUS_SUCCESS;
\r
445 phHciNfc_sContext_t *psHciContext =
\r
446 (phHciNfc_sContext_t *)psContext ;
\r
449 if( (NULL == psHciContext) || (NULL == pHwRef) || (NULL == pResponse)
\r
452 status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_INVALID_PARAMETER);
\r
454 else if(NULL == psHciContext->p_iso_15693_info)
\r
456 status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_FEATURE_NOT_SUPPORTED);
\r
460 phHciNfc_ISO15693_Info_t *ps_15693_info = NULL;
\r
461 phHciNfc_Pipe_Info_t *ps_pipe_info = NULL;
\r
462 uint8_t prev_cmd = ANY_GET_PARAMETER;
\r
464 ps_15693_info = (phHciNfc_ISO15693_Info_t *)
\r
465 psHciContext->p_iso_15693_info;
\r
467 ps_pipe_info = ps_15693_info->ps_15693_pipe_info;
\r
468 if( NULL == ps_pipe_info)
\r
470 status = PHNFCSTVAL(CID_NFC_HCI,
\r
471 NFCSTATUS_INVALID_HCI_SEQUENCE);
\r
475 prev_cmd = ps_pipe_info->prev_msg ;
\r
478 case ANY_GET_PARAMETER:
\r
480 status = phHciNfc_ISO15693_InfoUpdate(psHciContext,
\r
481 ps_pipe_info->reg_index,
\r
482 &pResponse[HCP_HEADER_LEN],
\r
483 (uint8_t)(length - HCP_HEADER_LEN));
\r
485 status = phHciNfc_ReaderMgmt_Update_Sequence(psHciContext,
\r
490 case ANY_SET_PARAMETER:
\r
492 HCI_PRINT("ISO 15693 Parameter Set \n");
\r
493 status = phHciNfc_ReaderMgmt_Update_Sequence(psHciContext,
\r
495 ps_15693_info->next_seq = ISO15693_INVENTORY;
\r
498 case ANY_OPEN_PIPE:
\r
500 HCI_PRINT("ISO 15693 open pipe complete\n");
\r
501 status = phHciNfc_ReaderMgmt_Update_Sequence(psHciContext,
\r
503 ps_15693_info->next_seq = ISO15693_INVENTORY;
\r
506 case ANY_CLOSE_PIPE:
\r
508 HCI_PRINT("ISO 15693 close pipe complete\n");
\r
509 status = phHciNfc_ReaderMgmt_Update_Sequence(psHciContext,
\r
514 case NXP_ISO15693_CMD:
\r
516 if (length >= HCP_HEADER_LEN)
\r
518 HCI_PRINT("ISO 15693 packet received \n");
\r
519 /* Copy buffer to the receive buffer */
\r
520 phHciNfc_Append_HCPFrame(psHciContext->recv_buffer,
\r
521 0, pResponse, length);
\r
522 psHciContext->rx_total = length;
\r
523 psHciContext->rx_index = HCP_HEADER_LEN;
\r
524 HCI_PRINT_BUFFER("ISO 15693 Bytes received",
\r
525 pResponse, length);
\r
529 status = PHNFCSTVAL(CID_NFC_HCI,
\r
530 NFCSTATUS_INVALID_HCI_RESPONSE);
\r
536 status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_INVALID_HCI_RESPONSE);
\r
539 }/* End of switch(prev_cmd) */
\r
541 if( NFCSTATUS_SUCCESS == status )
\r
543 ps_pipe_info->prev_status = NFCSTATUS_SUCCESS;
\r
544 ps_15693_info->current_seq = ps_15693_info->next_seq;
\r
553 phHciNfc_Recv_ISO15693_Event(
\r
557 #ifdef ONE_BYTE_LEN
\r
564 NFCSTATUS status = NFCSTATUS_SUCCESS;
\r
565 phHciNfc_sContext_t *psHciContext =
\r
566 (phHciNfc_sContext_t *)psContext ;
\r
567 if( (NULL == psHciContext) || (NULL == pHwRef) || (NULL == pEvent)
\r
570 status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_INVALID_PARAMETER);
\r
572 else if((NULL == psHciContext->p_iso_15693_info) ||
\r
573 (HCI_ISO_15693_ENABLE !=
\r
574 ((phHciNfc_ISO15693_Info_t *)(psHciContext->p_iso_15693_info))->
\r
575 enable_iso_15693_gate))
\r
577 status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_FEATURE_NOT_SUPPORTED);
\r
581 phHciNfc_HCP_Packet_t *p_packet = NULL;
\r
582 phHciNfc_ISO15693_Info_t *ps_15693_info=NULL;
\r
583 phHciNfc_HCP_Message_t *message = NULL;
\r
584 uint8_t instruction=0,
\r
587 ps_15693_info = (phHciNfc_ISO15693_Info_t *)
\r
588 psHciContext->p_iso_15693_info;
\r
589 p_packet = (phHciNfc_HCP_Packet_t *)pEvent;
\r
590 message = &p_packet->msg.message;
\r
591 /* Get the instruction bits from the Message Header */
\r
592 instruction = (uint8_t) GET_BITS8( message->msg_header,
\r
593 HCP_MSG_INSTRUCTION_OFFSET, HCP_MSG_INSTRUCTION_LEN);
\r
595 if ((EVT_TARGET_DISCOVERED == instruction)
\r
596 && ((ISO_15693_MULTIPLE_TAGS_FOUND == message->payload[i])
\r
597 || (ISO_15693_SINGLE_TAG_FOUND == message->payload[i]))
\r
600 phNfc_sCompletionInfo_t pCompInfo;
\r
602 /* #define NFC_ISO_15693_MULTIPLE_TAGS_SUPPORT 0x00 */
\r
603 #if (NFC_ISO_15693_MULTIPLE_TAGS_SUPPORT >= 0x01)
\r
605 if (ISO_15693_MULTIPLE_TAGS_FOUND == message->payload[i])
\r
607 ps_15693_info->multiple_tgts_found = ISO_15693_MULTIPLE_TAGS_FOUND;
\r
608 pCompInfo.status = NFCSTATUS_MULTIPLE_TAGS;
\r
611 #endif /* #if (NFC_ISO_15693_MULTIPLE_TAGS_SUPPORT <= 0x01) */
\r
613 ps_15693_info->multiple_tgts_found = FALSE;
\r
614 pCompInfo.status = NFCSTATUS_SUCCESS;
\r
616 /* CompInfo.info = &(ps_15693_info->iso15693_info); */
\r
618 psHciContext->host_rf_type = phHal_eISO15693_PCD;
\r
619 ps_15693_info->iso15693_info.RemDevType = phHal_eISO15693_PICC;
\r
620 ps_15693_info->current_seq = ISO15693_INVENTORY;
\r
621 /* Notify to the HCI Generic layer To Update the FSM */
\r
622 phHciNfc_Notify_Event(psHciContext, pHwRef,
\r
623 NFC_NOTIFY_TARGET_DISCOVERED,
\r
629 status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_INVALID_HCI_RESPONSE);
\r
636 phHciNfc_Send_ISO15693_Command(
\r
637 phHciNfc_sContext_t *psHciContext,
\r
643 NFCSTATUS status = NFCSTATUS_SUCCESS;
\r
645 if( (NULL == psHciContext) || (NULL == pHwRef) )
\r
647 status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_INVALID_PARAMETER);
\r
649 else if((NULL == psHciContext->p_iso_15693_info) ||
\r
650 (HCI_ISO_15693_ENABLE !=
\r
651 ((phHciNfc_ISO15693_Info_t *)(psHciContext->p_iso_15693_info))->
\r
652 enable_iso_15693_gate) ||
\r
653 (HCI_UNKNOWN_PIPE_ID ==
\r
654 ((phHciNfc_ISO15693_Info_t *)(psHciContext->p_iso_15693_info))->
\r
657 ((phHciNfc_ISO15693_Info_t *)(psHciContext->p_iso_15693_info))->
\r
660 status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_FEATURE_NOT_SUPPORTED);
\r
664 phHciNfc_ISO15693_Info_t *ps_15693_info=NULL;
\r
665 phHciNfc_Pipe_Info_t *ps_pipe_info=NULL;
\r
666 phHciNfc_HCP_Packet_t *hcp_packet = NULL;
\r
667 phHciNfc_HCP_Message_t *hcp_message = NULL;
\r
669 uint16_t length = HCP_HEADER_LEN;
\r
671 ps_15693_info = (phHciNfc_ISO15693_Info_t *)
\r
672 psHciContext->p_iso_15693_info ;
\r
673 ps_pipe_info = ps_15693_info->ps_15693_pipe_info;
\r
674 if(NULL == ps_pipe_info )
\r
676 status = PHNFCSTVAL(CID_NFC_HCI,
\r
677 NFCSTATUS_INVALID_HCI_SEQUENCE);
\r
681 psHciContext->tx_total = 0 ;
\r
682 hcp_packet = (phHciNfc_HCP_Packet_t *) psHciContext->send_buffer;
\r
683 /* Construct the HCP Frame */
\r
684 if (NXP_ISO15693_CMD == cmd)
\r
686 phHciNfc_Build_HCPFrame(hcp_packet,HCP_CHAINBIT_DEFAULT,
\r
687 (uint8_t) pipe_id, HCP_MSG_TYPE_COMMAND, cmd);
\r
688 hcp_message = &(hcp_packet->msg.message);
\r
692 hcp_message->payload[i++] =
\r
693 psHciContext->p_xchg_info->params.tag_info.cmd_type ;
\r
695 hcp_message->payload[i++] =
\r
696 psHciContext->p_xchg_info->params.tag_info.addr ;
\r
698 phHciNfc_Append_HCPFrame((uint8_t *)hcp_message->payload,
\r
699 i, (uint8_t *)ps_pipe_info->param_info,
\r
700 ps_pipe_info->param_length);
\r
701 length =(uint16_t)(length + i + ps_pipe_info->param_length);
\r
703 ps_pipe_info->sent_msg_type = (uint8_t)HCP_MSG_TYPE_COMMAND;
\r
704 ps_pipe_info->prev_msg = cmd;
\r
705 psHciContext->tx_total = length;
\r
706 psHciContext->response_pending = TRUE;
\r
708 /* Send the Constructed HCP packet to the lower layer */
\r
709 status = phHciNfc_Send_HCP( psHciContext, pHwRef);
\r
710 ps_pipe_info->prev_status = status;
\r
718 phHciNfc_ISO15693_Set_AFI(
\r
724 NFCSTATUS status = NFCSTATUS_SUCCESS;
\r
725 phHciNfc_sContext_t *psHciContext =
\r
726 (phHciNfc_sContext_t *)psContext ;
\r
728 if( (NULL == psHciContext) || (NULL == pHwRef))
\r
730 status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_INVALID_PARAMETER);
\r
732 else if((NULL == psHciContext->p_iso_15693_info) ||
\r
733 (HCI_ISO_15693_ENABLE !=
\r
734 ((phHciNfc_ISO15693_Info_t *)(psHciContext->p_iso_15693_info))->
\r
735 enable_iso_15693_gate))
\r
737 status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_FEATURE_NOT_SUPPORTED);
\r
741 phHciNfc_ISO15693_Info_t *ps_15693_info = NULL;
\r
742 phHciNfc_Pipe_Info_t *ps_pipe_info = NULL;
\r
743 uint8_t pipeid = 0;
\r
745 ps_15693_info = (phHciNfc_ISO15693_Info_t *)
\r
746 psHciContext->p_iso_15693_info ;
\r
747 ps_pipe_info = ps_15693_info->ps_15693_pipe_info;
\r
749 if( NULL == ps_pipe_info)
\r
751 status = PHNFCSTVAL(CID_NFC_HCI,
\r
752 NFCSTATUS_INVALID_HCI_SEQUENCE);
\r
756 ps_pipe_info->reg_index = ISO_15693_AFI_INDEX;
\r
757 ps_pipe_info->param_info = &afi_value;
\r
758 ps_pipe_info->param_length = sizeof(afi_value);
\r
759 pipeid = ps_pipe_info->pipe.pipe_id ;
\r
760 status = phHciNfc_Send_Generic_Cmd( psHciContext, pHwRef,
\r
761 pipeid, (uint8_t)ANY_SET_PARAMETER);
\r
767 #endif /* #if defined (TYPE_ISO15693) */
\r