SAMR21 Xplained Pro Board Lightweight Mesh ACK Request

Moderator: nferre

ricardogomes
Posts: 13
Joined: Thu Jan 22, 2015 7:36 pm

SAMR21 Xplained Pro Board Lightweight Mesh ACK Request

Tue Jun 30, 2015 12:43 pm

Hi, I'm having some trouble with an ACK request. What I want to do is send a uint8_t from one SAM R21 Board to another SAM R21 Board when I press the SW0 button. But, the receiver board is in sleep mode and wakes up from 10 to 10 seconds. When the receiver board is asleep, the request can not be completed so I want to retry until the receiver board receives the request. So I have the following code in the APP_TaskHandler:

Code: Select all

	case APP_STATE_IDLE:
	{
		if(!port_pin_get_input_level(BUTTON_0_PIN))
		{
			uint8_t order = 1;
			appSendOrder(order);
		}
	}
and in the appSendOrder:

Code: Select all

static void appSendOrder(uint8_t order)
{
	if (appDataReqBusy) {
		return;
	}
	
	appDataReq.dstAddr = 0x8001;
	appDataReq.dstEndpoint = APP_ENDPOINT;
	appDataReq.srcEndpoint = APP_ENDPOINT;
	appDataReq.options = NWK_OPT_ENABLE_SECURITY | NWK_OPT_ACK_REQUEST;
	appDataReq.data = order;
	appDataReq.size = sizeof(order);
	appDataReq.confirm = appDataConf;
	NWK_DataReq(&appDataReq);
	appDataReqBusy = true;
	LED_Toggle(LED0);
}
I want something like:

Code: Select all

	while (req->status != NWK_NO_ACK_STATUS){
		appSendOrder(order);
	}
I tried to put this in appDataConf and in AppTaskHandler but it doesn't work. Can anybody help me?

Thanks in advance
ricardogomes
Posts: 13
Joined: Thu Jan 22, 2015 7:36 pm

Re: SAMR21 Xplained Pro Board Lightweight Mesh ACK Request

Tue Jun 30, 2015 2:33 pm

Ok, sorry... But I don't know how to make the board to be retrying to send the frame until it gets the ACK flag. I explained what was my problem, I don't know what more can I say to explain what is the objective that I want to achieve.

Return to “SAM9-based”

Who is online

Users browsing this forum: No registered users and 2 guests