cancel
Showing results for 
Search instead for 
Did you mean: 

details are needed for HAL_LE_TX_TEST_PACKET_NUMBER

hui
Associate II
Posted on April 17, 2015 at 22:20

In AN4494, Bring up BlueNRG app note, both Chapter 8 and 9 mention that

Send a further command to determine the number of packets sent by the Tx board: HAL_LE_TX_TEST_PACKET_NUMBER

What is the LE command above? Where can I find relevant code for it? I need it to get the actual number of TX packet sent for board RF tuning. I have code from DK1.6.0 for

HCI_LE_TRANSMITTER_TEST,

and

HCI_LE_TEST_END .

Thanks!

Hui

#tx-test-packet-number-sensitivit
1 REPLY 1
Posted on May 11, 2015 at 15:36

Hi Hui,

I suggest to download the latest version of DK 1.7.0, anyway you have to add the following code:

-> in the file bluenrg_aci_const.h:

#define OCF_HAL_LE_TX_TEST_PACKET_NUMBER    0x0014

typedef __packed struct _hal_le_tx_test_packet_number_rp{

  uint8_t status;

  uint32_t number_of_packets;

} PACKED hal_le_tx_test_packet_number_rp;

- in the file bluenrg_hal_aci.c

tBleStatus aci_hal_le_tx_test_packet_number(uint32_t *number_of_packets)

{

  struct hci_request rq;

  hal_le_tx_test_packet_number_rp resp;

  Osal_MemSet(&rq, 0, sizeof(rq));

  rq.ogf = OGF_VENDOR_CMD;

  rq.ocf = OCF_HAL_LE_TX_TEST_PACKET_NUMBER;

  rq.rparam = &resp;

  rq.rlen = sizeof(resp);

  if (hci_send_req(&rq, FALSE) < 0)

    return BLE_STATUS_TIMEOUT;

  if (resp.status) {

    return resp.status;

  }

 

  *number_of_packets = btohl(resp.number_of_packets);

  return 0;

}

-> in the file bluenrg_hal_aci.h:

/**

 * @brief This command returns the number of packets sent in Direct Test Mode.

 * @note  When the Direct TX test is started, a 32-bit counter is used to count how many packets

 *        have been transmitted. This command can be used to check how many packets have been sent

 *        during the Direct TX test.\n

 *        The counter starts from 0 and counts upwards. The counter can wrap and start from 0 again.

 *        The counter is not cleared until the next Direct TX test starts.

 * @param[out] number_of_packets Number of packets sent during the last Direct TX test.

 * @return Value indicating success or error code.

 */

tBleStatus aci_hal_le_tx_test_packet_number(uint32_t *number_of_packets);

Regards,

GM

In AN4494, Bring up BlueNRG app note, both Chapter 8 and 9 mention that

Send a further command to determine the number of packets sent by the Tx board: HAL_LE_TX_TEST_PACKET_NUMBER

What is the LE command above? Where can I find relevant code for it? I need it to get the actual number of TX packet sent for board RF tuning. I have code from DK1.6.0 for

HCI_LE_TRANSMITTER_TEST,

and

HCI_LE_TEST_END .

Thanks!

Hui