Exemplo n.º 1
0
/*******************************************************************************
**
** Function         btif_dut_mode_send
**
** Description     Sends a HCI Vendor specific command to the controller
**
** Returns          BT_STATUS_SUCCESS on success
**
*******************************************************************************/
bt_status_t btif_dut_mode_send(uint16_t opcode, uint8_t *buf, uint8_t len)
{
    /* TODO: Check that opcode is a vendor command group */
    BTIF_TRACE_DEBUG1("%s", __FUNCTION__);

    BTM_VendorSpecificCommand(opcode, len, buf);
    return BT_STATUS_SUCCESS;
}
Exemplo n.º 2
0
int receiveIncomingData(int fd)
{
  int i; // r4@4
  int v3; // r8@9
  int v4; // r3@9
  size_t v5; // r4@9
  char *v6; // r5@9
  char *v7; // r11@10
  char *v8; // r7@10
  UINT8 v9; // r4@10
  uint8_t *v10; // r12@10
  int v11; // t1@11
  uint8_t *v12; // ST00_4@12
  int result; // r0@17
  //int *v14; // [sp+4h] [bp-23Ch]@1
  char src[256]; // [sp+14h] [bp-22Ch]@6
  UINT8 v16; // [sp+114h] [bp-12Ch]@12
  uint8_t v17[3]; // [sp+115h] [bp-12Bh]@10

  while ( true )
  {
    v6 = src;
    result = recv(fd, src, 0xFFu, 0);
    v3 = result;
    if ( result <= 0 ) break;
    if ( taillen_8958 )
    {
      for ( i = 0; (uint8_t)src[i] != 252; ++i );
      if ( btif_trace_level > iLevelMessages ) LogMsg(1283, "tail data length = %d, new data length = %d\n");
      v3 = v3 - i - 1;
      v4 = taillen_8958 + 1 + i;
      v5 = i + 1;
      tail_8957[0] = v4;
      memcpy(&tail_8957[taillen_8958 + 1], src, v5);
      taillen_8958 = 0;
      v6 = &src[v5];
      BTM_VendorSpecificCommand(64649, (tail_8957[0] + 1), tail_8957, bta_gps_cback);
    }
    v7 = v6;
    v8 = v6;
    v9 = 0;
    v10 = v17;
    while ( v8 - v7 < v3 )
    {
      v11 = (uint8_t)*v8++;
      ++v9;
      if ( v11 == 252 )
      {
        v12 = v10;
        __memcpy_chk(v10, v6, v9, 254);
        v16 = v9;
        BTM_VendorSpecificCommand(64649, (v9 + 1), &v16, bta_gps_cback);
        v10 = v12;
        v6 = v8;
        v9 = 0;
      }
    }
    if ( v9 )
    {
      __memcpy_chk(&unk_712, v6, v9, 511);
      taillen_8958 = v9;
      if ( btif_trace_level > iLevelMessages )
        LogMsg(1283, "tail data length = %d\n", v9);
    }
  }
  return result;
}