Mlme_Main return value

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Mlme_Main return value

1,088 Views
RoyVersteeg
Contributor I

Hello,

 

I'm trying to make an application that uses de 802.15.4 MacPhy on the freescale MC13224, but I don't want to use the complete freescale beekit MAC codebase.

 

I tried removing a lot of code-files generated by the beekit to get some idea of how the MacPhy.a library works, but I'm having some difficulties understanding how I should call Mlme_Main. The NwkMacInterface.h file says the following

 

/************************************************************************************* MAC main function. Must be called by the NWK loop until it returns FALSE. The * function will examine the MAC input queues, and handle incoming/outgoing* MAC/MCPS messages.*   * Interface assumptions:*   None*   * Return value:*   TRUE if there are more messages for the Mlme_Main function process.*   FALSE otherwise.* ************************************************************************************///bool_t Mlme_Main(uint16_t events);void Mlme_Main(event_t events);

 

 

So the bool_t version is commented out, but it seems that is the one I need. So i commented the function returning a void and use the one returning an bool_t.

 

The problem I'm having is that it always returns TRUE, even if I haven't sent any message to the MAC layer.

 

I'm having some other concerns as to the dependency's of MACPHY.a as it has a dependancy to the gbTaskMode, gMacTaskID_c, TS_SendEvent, TMR_StartTimer, TMR_IsTimerActive, TMR_StopTimer and TMR_AllocateTimer.

 

I call Init_802_15_4(FALSE) so the global gbTaskMode variable is set to FALSE ( because i don't want to use the TS )

 

When I call MacPhyInit_Initialize this triggers an TMR_AllocateTimer(), but no timers are started, so that should not be a problem.

 

But now I'm still not sure how I should use Mlme_Main without using the Timer and TaskScheduler module from freescale. And I can't seem to find any documentation for that.

 

My Main in MApp_init now looks like this

 

uint32_t mlme_mainCalls = 0x00;void Main(void){  InterruptInit();  IntDisableAll();  Platform_Init();    /* Don't use TS for MAC*/  Init_802_15_4(FALSE);    for(;;) {    DelayMs(1000);    while(Mlme_Main(0)) {      mlme_mainCalls++;    }            }}

 

 

 

Can somebody help me?

0 Kudos
Reply
2 Replies

710 Views
redbee
Contributor III

 


Roy Versteeg wrote:

Hello,

 

I'm trying to make an application that uses de 802.15.4 MacPhy on the freescale MC13224, but I don't want to use the complete freescale beekit MAC codebase.

 

 

Roy,

 

Checkout my code at mc13224.devl.org, specifically libmc1322x.

 

It doesn't use any of the beekit codebase.

 

-Mar.

 

 

0 Kudos
Reply

710 Views
RoyVersteeg
Contributor I

Thanks Redbee,

 

That looks realy promising, although i haven't got it working on windows yet. I'll definitely look into this.

 

In the meantime I hope someone has an answer to my question above.

 

Regards Roy 

0 Kudos
Reply