Use this routine E:\nordic\nRF5_SDK_12.2.0_f012efa3\examples\proprietary_rf\gzll\experimental\gzp_desktop_emulator To modify the can communicate with PC nrf24luep pairing, Communication data fetching use BUSHOND
Gzp_desktop_emulator the main code of the modified as follows
int main()
{
bool init_ok = false;
uint32_t err_code;
init_ok = true;
// Initialize and enable Gazell
init_ok &= nrf_gzll_init(NRF_GZLL_MODE_DEVICE);
unsigned char ch_table[] = {3, 23, 40, 61, 75};
init_ok &= nrf_gzll_set_max_tx_attempts(20);
init_ok &= nrf_gzll_set_device_channel_selection_policy(NRF_GZLL_DEVICE_CHANNEL_SELECTION_POLICY_USE_SUCCESSFUL);
init_ok &= nrf_gzll_set_timeslot_period(540);
init_ok &=nrf_gzll_set_timeslots_per_channel(2);
init_ok &= nrf_gzll_set_timeslots_per_channel_when_device_out_of_sync(2);
init_ok &= nrf_gzll_set_sync_lifetime(0);
init_ok &= nrf_gzll_set_datarate(NRF_GZLL_DATARATE_2MBIT);
init_ok &= nrf_gzll_set_channel_table(ch_table, sizeof(ch_table));
gzp_init();
init_ok &= nrf_gzll_enable();
while(!system_addr_received)
{
system_addr_received = gzp_address_req_send();
nrf_delay_ms(10);
}
nrf_gzp_disable_gzll();
init_ok &= nrf_gzll_set_max_tx_attempts(3);
init_ok &= nrf_gzll_set_device_channel_selection_policy(NRF_GZLL_DEVICE_CHANNEL_SELECTION_POLICY_USE_CURRENT);
init_ok &= nrf_gzll_set_timeslot_period(750);
init_ok &= nrf_gzll_set_sync_lifetime(100);
nrf_gzll_set_tx_power(NRF_GZLL_TX_POWER_4_DBM);
nrf_gzll_enable();
uint32_t result;
if(init_ok)
{
while(1)
{
buff[4]+=1;
buff[5]+=1;
while(!nrf_gzll_ok_to_add_packet_to_tx_fifo(NRFR_MOUSE_EP))
{}
// Add mouse packet to the mouse pipe's TX FIFO.
nrf_gzll_add_packet_to_tx_fifo(NRFR_MOUSE_EP, buff, 32);
}
}
}
Above GZLL agreement in gzp_desktop_emulator this routine can be used in matching and communications, Use this experimental_ble_app_gzll routines in the also not line, but don't know why, troubled for a long time
You need to add in the gzp_desktop_emulator this routine
nrf_gzp.c
nrf_gzp_device.c
#if GZP_PARAMS_DB_ADR == 0x20000
#define GZP_PARAMS_STORAGE_ADR 0x00020000
after
void gzll_app_start(void)
{
// GAZELLE_ERROR_CODE_CHECK(nrf_gzll_init(NRF_GZLL_MODE_DEVICE));
// GAZELLE_ERROR_CODE_CHECK(nrf_gzll_set_max_tx_attempts(MAX_TX_ATTEMPTS));
// GAZELLE_ERROR_CODE_CHECK(nrf_gzll_enable());
// // Add a packet to the TX FIFO to start the data transfer.
// // Next packets to send will be added.
// m_gzll_packet[0] = DUMMY_PACKET;
// GAZELLE_ERROR_CODE_CHECK(nrf_gzll_add_packet_to_tx_fifo(PIPE_TO_HOST,
// m_gzll_packet,
// PAYLOAD_SIZE));
unsigned char ch_table[] = {3, 23, 40, 61, 75};
bool init_ok = false;
uint32_t err_code;
init_ok = true;
init_ok &= nrf_gzll_init(NRF_GZLL_MODE_DEVICE);
// // Ensure Gazell parameters are configured.
// init_ok &= nrf_gzll_set_max_tx_attempts(10);
// init_ok &= nrf_gzll_set_device_channel_selection_policy(NRF_GZLLDE_DEVICE_CHANNEL_SELECTION_POLICY);
// init_ok &= nrf_gzll_set_timeslot_period(NRF_GZLLDE_RXPERIOD_DIV_2);
// init_ok &= nrf_gzll_set_sync_lifetime(0); // Asynchronous mode, more efficient for pairing.
init_ok &= nrf_gzll_set_max_tx_attempts(20);
init_ok &= nrf_gzll_set_device_channel_selection_policy(NRF_GZLLDE_DEVICE_CHANNEL_SELECTION_POLICY);
init_ok &= nrf_gzll_set_timeslot_period(540);
init_ok &=nrf_gzll_set_timeslots_per_channel(2);
init_ok &= nrf_gzll_set_timeslots_per_channel_when_device_out_of_sync(2);
init_ok &= nrf_gzll_set_sync_lifetime(0);
init_ok &= nrf_gzll_set_datarate(NRF_GZLL_DATARATE_2MBIT);
init_ok &= nrf_gzll_set_channel_table(ch_table, sizeof(ch_table));
gzp_init();
init_ok &= nrf_gzll_enable();
while(!system_addr_received)
{
system_addr_received = gzp_address_req_send();
nrf_delay_ms(10);
}
nrf_gzp_disable_gzll();
init_ok &= nrf_gzll_set_max_tx_attempts(3);
init_ok &= nrf_gzll_set_device_channel_selection_policy(NRF_GZLL_DEVICE_CHANNEL_SELECTION_POLICY_USE_CURRENT);
init_ok &= nrf_gzll_set_timeslot_period(750);
init_ok &= nrf_gzll_set_sync_lifetime(100);
nrf_gzll_set_tx_power(NRF_GZLL_TX_POWER_4_DBM);
nrf_gzll_enable();
uint32_t result;
if(init_ok)
{
while(1)
{
buff[4]+=1;
buff[5]+=1;
while(!nrf_gzll_ok_to_add_packet_to_tx_fifo(NRFR_MOUSE_EP))
{}
// Add mouse packet to the mouse pipe's TX FIFO.
nrf_gzll_add_packet_to_tx_fifo(NRFR_MOUSE_EP, buff, 32);
}
}
}
There is no matching success in experimental_ble_app_gzll this routine. So always here
while(!system_addr_received)
{
system_addr_received = gzp_address_req_send();
nrf_delay_ms(10);
}
Tx_succes here have been zero,Pairing is not successful. Using NRF5_SDK12. 2 experimental_ble_app_gzll GZLL matching function is added to the routine. E:\nordic\nRF5_SDK_12.2.0_f012efa3\examples\multiprotocol\experimental_ble_app_gzll