Example #1
0
static void camd33_request_emm()
{
  uchar mbuf[20];
	struct s_reader *aureader = NULL, *rdr = NULL;

	//TODO: just take the first reader in list
	LL_ITER itr = ll_iter_create(cur_client()->aureader_list);
	while ((rdr = ll_iter_next(&itr))) {
		aureader=rdr;
		break;
	}

	if (!aureader) return;

  if (aureader->hexserial[0])
  {
    log_emm_request(aureader);
    mbuf[0]=0;
    mbuf[1]=aureader->caid>>8;
    mbuf[2]=aureader->caid&0xff;
    memcpy(mbuf+3, aureader->hexserial, 4);
    memcpy(mbuf+7, &aureader->prid[0][1], 3);
    memcpy(mbuf+10, &aureader->prid[2][1], 3);
    camd33_send(mbuf, 13);
  }
Example #2
0
static void camd33_request_emm(void)
{
	uchar mbuf[20];
	struct s_reader *aureader = NULL, *rdr = NULL;

	//TODO: just take the first reader in list
	LL_ITER itr = ll_iter_create(cur_client()->aureader_list);
	while((rdr = ll_iter_next(&itr)))
	{
		aureader = rdr;
		break;
	}

	if(!aureader) { return; }

	if(aureader->hexserial[0])
	{
		cs_log("%s emm-request sent (reader=%s, caid=%04X, auprovid=%06X)",
			   username(cur_client()), aureader->label, aureader->caid,
			   aureader->auprovid ? aureader->auprovid : b2i(4, aureader->prid[0]));
		mbuf[0] = 0;
		mbuf[1] = aureader->caid >> 8;
		mbuf[2] = aureader->caid & 0xff;
		memcpy(mbuf + 3, aureader->hexserial, 4);
		memcpy(mbuf + 7, &aureader->prid[0][1], 3);
		memcpy(mbuf + 10, &aureader->prid[2][1], 3);
		camd33_send(mbuf, 13);
	}