void SimpleLinkWaitEvent(UINT16 usOpcode, void *pRetParams)
{
	// In the blocking implementation the control to caller will be returned only
	// after the end of current transaction
	tSLInformation.usRxEventOpcode = usOpcode;
	hci_event_handler(pRetParams, 0, 0);
}
void SimpleLinkWaitData(UINT8 *pBuf, UINT8 *from, UINT8 *fromlen)
{
	// In the blocking implementation the control to caller will be returned only
	// after the end of current transaction, i.e. only after data will be received
	tSLInformation.usRxDataPending = 1;
	hci_event_handler(pBuf, from, fromlen);
}
예제 #3
0
void 
SimpleLinkWaitEvent(unsigned short usOpcode, void *pRetParams)
{
	// In the blocking implementation the control to caller will be returned only 
	// after the end of current transaction
	tSLInformation.usRxEventOpcode = usOpcode;
//	TM_DEBUG("simple link wait event, waiting for %ul", tSLInformation.usRxEventOpcode);
	hci_event_handler(pRetParams, 0, 0);
}
예제 #4
0
void SimpleLinkWaitData(uint8_t *pBuf, uint8_t *from, uint8_t *fromlen)
{
  /* In the blocking implementation the control to caller will be returned only
   * after the end of current transaction, i.e. only after data will be received
   */

  nllvdbg("Looking for Data\n");
  uint16_t event_type;
  uint16_t opcode = tSLInformation.usRxEventOpcode;

  do
    {
      tSLInformation.pucReceivedData = cc3000_wait();
      tSLInformation.usEventOrDataReceived = 1;

      if (*tSLInformation.pucReceivedData == HCI_TYPE_DATA)
        {
          tSLInformation.usRxDataPending = 1;
          hci_event_handler(pBuf, from, fromlen);
          break;
        }
      else
        {
          STREAM_TO_UINT16((char *)tSLInformation.pucReceivedData, HCI_EVENT_OPCODE_OFFSET, event_type);
          nllvdbg("Evtn:0x%x\n", event_type);

          if (hci_unsolicited_event_handler() == 1)
            {
              nllvdbg("Processed Event  0x%x want Data! Opcode 0x%x\n", event_type, opcode);
            }
          else
            {
              nllvdbg("!!!!!opcode 0x%x\n", opcode);
            }

          UNUSED(event_type);
        }
    }
  while (*tSLInformation.pucReceivedData == HCI_TYPE_EVNT);

  nllvdbg("Done for Data 0x%x\n", opcode);
  UNUSED(opcode);
}
예제 #5
0
void SimpleLinkWaitEvent(uint16_t opcode, void *pRetParams)
{
  /* In the blocking implementation the control to caller will be returned only
   * after the end of current transaction
   */

  tSLInformation.usRxEventOpcode = opcode;
  nllvdbg("Looking for opcode 0x%x\n", opcode);
  uint16_t event_type;

  do
    {
      nllvdbg("cc3000_wait\n");
      tSLInformation.pucReceivedData = cc3000_wait();
      tSLInformation.usEventOrDataReceived = 1;
      STREAM_TO_UINT16((FAR char *)tSLInformation.pucReceivedData,
                       HCI_EVENT_OPCODE_OFFSET, event_type);

      if (*tSLInformation.pucReceivedData == HCI_TYPE_EVNT)
        {
          nllvdbg("Evtn:0x%x\n", event_type);
        }

      if (event_type != opcode)
        {
          if (hci_unsolicited_event_handler() == 1)
            {
              nllvdbg("Processed Event  0x%x want 0x%x\n", event_type, opcode);
            }
        }
      else
        {
          nllvdbg("Processing opcode 0x%x\n", opcode);
          hci_event_handler(pRetParams, 0, 0);
        }
    }
  while (tSLInformation.usRxEventOpcode != 0);

  nllvdbg("Done for opcode 0x%x\n", opcode);
}
void cc3000_event::simplelink_wait_data(uint8_t *pBuf, uint8_t *from, uint8_t *fromlen) {
    // In the blocking implementation the control to caller will be returned only
    // after the end of current transaction, i.e. only after data will be received
    _simple_link.set_pending_data(1);
    hci_event_handler(pBuf, from, fromlen);
}
void cc3000_event::simplelink_wait_event(uint16_t op_code, void *ret_param) {
    // In the blocking implementation the control to caller will be returned only
    // after the end of current transaction
    _simple_link.set_op_code(op_code);
    hci_event_handler(ret_param, 0, 0);
}