/**
 * \brief This function is called to abort the packet streaming mode inprogress
 */
void stop_pkt_streaming(void * parameter)
{
	pkt_stream_stop = true;
	sw_timer_stop(T_APP_TIMER);
	if(sw_timer_is_running(CW_TX_TIMER))
	{
		sw_timer_stop(CW_TX_TIMER);
	}			
	usr_pkt_stream_confirm(MAC_SUCCESS,false);
	if(node_info.main_state == PER_TEST_RECEPTOR)
	{
		sw_timer_start(T_APP_TIMER,
		LED_BLINK_RATE_IN_MICRO_SEC,
		SW_TIMEOUT_RELATIVE,
		(FUNC_PTR)led_blinker_timer_handler_cb,
		NULL);
	}
}
Exemple #2
0
/**
 * \brief Application task handling peer request send
 *
 */
static void peer_req_send_task()
{
    static uint8_t count = 0;

    if (sw_timer_is_running(APP_TIMER_TO_TX))
    {
        return;
    }

    if (MAX_NUMBER_PEER_REQ_RETRY == count)
    {
        count = 0;
        switch (node_info.main_state)
        {
            case PEER_SEARCH_PER_TX:
                {
                    /* In confiuration mode allow the user to do peer search again */
                    if (node_info.configure_mode == true)
                    {
                        /* PEER REQ command failed - so change to WAIT_FOR_EVENT state */
                        set_main_state(WAIT_FOR_EVENT, NULL);
                    }
                    else
                    {
                        /* Peer search was failed in PER mode - so change to SINGLE_NODE_TESTS state */
                        set_main_state(SINGLE_NODE_TESTS, NULL);
                    }
                }
                break;

            case PEER_SEARCH_RANGE_TX:
                {
                    print_event(PRINT_PEER_SEARCH_FAILED);
                    /* PEER REQ command failed - so change to WAIT_FOR_EVENT state */
                    set_main_state(WAIT_FOR_EVENT, NULL);
                }
                break;
                /* To keep the GCC compiler happy */
            case INIT:
            case WAIT_FOR_EVENT:
            case PEER_SEARCH_RANGE_RX:
            case PEER_SEARCH_PER_RX:
            case RANGE_TEST_TX_ON:
            case RANGE_TEST_TX_OFF:
            case SINGLE_NODE_TESTS:
            case PER_TEST_INITIATOR:
            case PER_TEST_RECEPTOR:
            case NUM_MAIN_STATES:
                break;
            default:
                /* Do nothing */
                break;
        }
        return;
    }
    count++;
    /* Print messge if the Peer search is in progress in Range mode  */
    if (PEER_SEARCH_RANGE_TX == node_info.main_state)
    {
        print_event(PRINT_PEER_SEARCH_IN_PROGRESS);
    }
    /* Send Peer Requests */
    if (!send_peer_req())
    {
        sw_timer_start(APP_TIMER_TO_TX,
                        PEER_REQUEST_SEND_INTERVAL_IN_MICRO_SEC,
                        SW_TIMEOUT_RELATIVE,
                        (FUNC_PTR)app_peer_req_tmr_handler_cb,
                        NULL);
    }
}
Exemple #3
0
bool pal_is_timer_running(uint8_t timer_id)
{
	return sw_timer_is_running(timer_id);
}