This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

where to see the output of recieved data packets using Gazell protocol

hey, I am new to eval kit and i am asking a very basic question, i want to send the RSSI from PCA10001 board to usb dongle PCA10000.i am looking the examples in sdk for this purpose. now my question is that where we see the packets or bytes recieved in usb dongle...... whether we have to see in nrfgo studio, or some where else.

Parents
  • HI Hakon..no its not working... im pasting my code check if some thing i am missing.... #define PIPE_NUMBER 0 ///< We use pipe 0 in this example

    // GPIO #define BUTTONS BUTTON_0 #define LEDS LED_0 #define TX_PAYLOAD_LENGTH 1 static uint8_t data_payload [TX_PAYLOAD_LENGTH];
    static uint8_t ack_payload [NRF_GZLL_CONST_MAX_PAYLOAD_LENGTH]; static volatile bool init_ok, enable_ok, push_ok, pop_ok, tx_success;
    static nrf_gzll_device_tx_info_t tx_info;

    int main() { uint8_t rss_check; uint8_t chk; uint8_t pipe; nrf_gpio_cfg_output(LED_1); nrf_gpio_cfg_sense_input(BUTTON_0,BUTTON_PULL, NRF_GPIO_PIN_SENSE_LOW); uint8_t debug_led_output;

    // Setup port directions
    nrf_gpio_pin_dir_set(BUTTONS,NRF_GPIO_PIN_DIR_INPUT);
    nrf_gpio_pin_dir_set(LEDS,NRF_GPIO_PIN_DIR_OUTPUT);
    
    // Initialize Gazell
    init_ok = nrf_gzll_init(NRF_GZLL_MODE_HOST);  
    
    // Load data into TX queue
    ack_payload[0] = nrf_gpio_pin_read(BUTTONS);  
    

    push_ok1 = nrf_gzll_add_packet_to_tx_fifo(PIPE_NUMBER , data_payload1, TX_PAYLOAD_LENGTH); enable_ok = nrf_gzll_enable(); while(1) { nrf_gzll_host_rx_data_ready(PIPE_NUMBER ,rx_info1); // Error handling// it also needs the full four device support error handling debug_led_output = ((uint8_t)packet_received << 4) + ((uint8_t)pop_ok1 << 3) + ((uint8_t)push_ok1 << 2) + ((uint8_t)enable_ok << 1) + (uint8_t)init_ok;

        // If an error has occured
        if(debug_led_output != 0x1F)
        {
    				nrf_gpio_pin_toggle(LED_1);
            nrf_gpio_pin_write(LEDS,0xFF);      
            nrf_delay_us(1000000); // 1 second delay 
            nrf_gpio_pin_write(LEDS, debug_led_output);
            nrf_delay_us(1000000); // 1 second delay 
            nrf_gpio_pin_write(LEDS,0xF0 + (uint32_t)nrf_gzll_get_error_code()); 
            nrf_delay_us(1000000); // 1 second delay 
        }
    
        // Optionally send the CPU to sleep while waiting for a callback.
        // __WFI();
    

    }

    }

    void nrf_gzll_host_rx_data_ready(uint32_t pipe, nrf_gzll_host_rx_info_t rx_info) {
    //uint8_t rss; volatile int16_t rss2; uint32_t data_payload_length = NRF_GZLL_CONST_MAX_PAYLOAD_LENGTH; packet_received = true;

    // Pop packet and write first byte of the payload to the GPIO port.
    pop_ok1 = nrf_gzll_fetch_packet_from_rx_fifo(PIPE_NUMBER, data_payload1, &data_payload_length);
    

    rx_info.rssi=rx_info.rssi;

    if (data_payload_length > 0)
    {
    		nrf_gpio_pin_set(LED_1);
        nrf_gpio_pin_write(LEDS,~data_payload1[0]);
    }
    
    // Read buttons and load ACK payload into TX queue
    ack_payload[0] = nrf_gpio_pin_read(BUTTONS);  // Button logic is inverted.
    push_ok1 = nrf_gzll_add_packet_to_tx_fifo(PIPE_NUMBER, ack_payload, TX_PAYLOAD_LENGTH);
    

    }

  • please tell me if I am wrong........ as soon as possible

Reply Children
No Data
Related