[Nexus S Android Development] useronce:
With the enhancement of D. Yeager for CM9, we can enable the Host Card Emulation functionality without any Secure Element.

by now, it can only change the SAK, ATQA, APP_DATA,... by modifying the CM9 source code. but when changing the uid, we'll get the lower-layer error: by logcating, it shows 'ANY_E_REG_ACCESS_DENIED' according to ETSI TS 102 622.

so, this operation must be blocked by the CLF's software stack, i guess - for i have no PN544/PN65N's manual.

but, i want to ask, is there any possible to change the rid to uid of host card emulation for nuxus s?

Reference:

Modifyed Code:

loc: android_external_libnfc-nxp.rar\src\phHciNfc_CE_A.c

NFCSTATUS
phHciNfc_CE_A_Initialise(
phHciNfc_sContext_t *psHciContext,
void *pHwRef
)
{
/*
1. Open Pipe,
2. Set all parameters
*/
NFCSTATUS status = NFCSTATUS_SUCCESS;
static uint8_t sak = 0x38; // HOST_CE_A_SAK_DEFAULT;
static uint8_t uid_info[] = { 0xE0U, 0x15U, 0x07U, 0x06U };
static uint8_t atqa_info[] = { NXP_CE_A_ATQA_LOW,
NXP_CE_A_ATQA_HIGH
};

if ((NULL == psHciContext) || (NULL == pHwRef))
{
status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_INVALID_PARAMETER);
}
else if(NULL == psHciContext->p_ce_a_info)
{
status = PHNFCSTVAL(CID_NFC_HCI, NFCSTATUS_FEATURE_NOT_SUPPORTED);
}
else
{
phHciNfc_CE_A_Info_t *ps_ce_a_info = ((phHciNfc_CE_A_Info_t *)
psHciContext->p_ce_a_info );
phHciNfc_Pipe_Info_t *ps_pipe_info = NULL;

ps_pipe_info = ps_ce_a_info->p_pipe_info;
if(NULL == ps_pipe_info )
{
status = PHNFCSTVAL(CID_NFC_HCI,
NFCSTATUS_INVALID_HCI_INFORMATION);
}
else
{
switch(ps_ce_a_info->current_seq)
{
case HOST_CE_A_PIPE_OPEN:
{
status = phHciNfc_Open_Pipe( psHciContext,
pHwRef, ps_pipe_info );
if(status == NFCSTATUS_SUCCESS)
{
//{----------------------------------- new for uid
ps_ce_a_info->next_seq = HOST_CE_A_UID_SEQ; // HOST_CE_A_SAK_SEQ;
//}----------------------------------- new for uid
status = NFCSTATUS_PENDING;
}
break;
}
//{----------------------------------- new for uid
case HOST_CE_A_UID_SEQ:
{
/* HOST Card Emulation A UID Configuration */
ps_pipe_info->reg_index = HOST_CE_A_UID_REG_INDEX;
/* Configure the UID of Host Card Emulation A */
ps_pipe_info->param_info = (void*)uid_info ;
ps_pipe_info->param_length = sizeof(uid_info) ;
status = phHciNfc_Send_Generic_Cmd(psHciContext,pHwRef,
ps_pipe_info->pipe.pipe_id,
(uint8_t)ANY_SET_PARAMETER);
if(status == NFCSTATUS_PENDING)
{
ps_ce_a_info->next_seq = HOST_CE_A_SAK_SEQ;
}
break;
}
//}----------------------------------- new for uid
case HOST_CE_A_SAK_SEQ:
{
/* HOST Card Emulation A SAK Configuration */
ps_pipe_info->reg_index = HOST_CE_A_SAK_INDEX;
/* Configure the SAK of Host Card Emulation A */
sak = (uint8_t)HOST_CE_A_SAK_DEFAULT;
ps_pipe_info->param_info =(void*)&sak ;
ps_pipe_info->param_length = sizeof(sak) ;
status = phHciNfc_Send_Generic_Cmd(psHciContext,pHwRef,
ps_pipe_info->pipe.pipe_id,
(uint8_t)ANY_SET_PARAMETER);
if(status == NFCSTATUS_PENDING)
{
ps_ce_a_info->next_seq = HOST_CE_A_ATQA_SEQ;
}
break;
}
case HOST_CE_A_ATQA_SEQ:
{
/* HOST Card Emulation A ATQA Configuration */
ps_pipe_info->reg_index = HOST_CE_A_ATQA_INDEX;
/* Configure the ATQA of Host Card Emulation A */
ps_pipe_info->param_info = (void*)atqa_info ;
ps_pipe_info->param_length = sizeof(atqa_info) ;
status = phHciNfc_Send_Generic_Cmd(psHciContext,pHwRef,
ps_pipe_info->pipe.pipe_id,
(uint8_t)ANY_SET_PARAMETER);
if(status == NFCSTATUS_PENDING)
{
ps_ce_a_info->next_seq = HOST_CE_A_ENABLE_SEQ;
}
break;
}
case HOST_CE_A_ENABLE_SEQ:
{
status = phHciNfc_CE_A_Mode( psHciContext,
pHwRef, HOST_CE_MODE_ENABLE );
if(status == NFCSTATUS_PENDING)
{
ps_ce_a_info->next_seq = HOST_CE_A_DISABLE_SEQ;
status = NFCSTATUS_SUCCESS;
}
break;
}
default :
{
break;
}
}
}
}

return status;
}