|
Advance Member
|
// ************************************************************************
// Place a case for each user defined endpoint.
// ************************************************************************
default:
// If the command type was something that requested an acknowledge, we could send back
// KVP_INVALID_ENDPOINT here.
break;
}
APLDiscardRx();
}
break;
case APSDE_DATA_confirm:
if (params.APSDE_DATA_confirm.Status)
{
ConsolePutROMString( (ROM char *)"Error " );
PrintChar( params.APSDE_DATA_confirm.Status );
ConsolePutROMString( (ROM char *)" sending message.\r\n" );
}
else
{
ConsolePutROMString( (ROM char *)" Message sent successfully.\r\n" );
}
currentPrimitive = NO_PRIMITIVE;
break;
case NO_PRIMITIVE:
if (!ZigBeeStatus.flags.bits.bNetworkFormed)
{
if (!ZigBeeStatus.flags.bits.bTryingToFormNetwork)
{
ConsolePutROMString( (ROM char *)"Trying to start network...\r\n" );
params.NLME_NETWORK_FORMATION_request.ScanDuration = 8;
params.NLME_NETWORK_FORMATION_request.ScanChannels.Val = ALLOWED_CHANNELS;
params.NLME_NETWORK_FORMATION_request.PANId.Val = 0xFFFF;
params.NLME_NETWORK_FORMATION_request.BeaconOrder = MAC_PIB_macBeaconOrder;
params.NLME_NETWORK_FORMATION_request.SuperframeOrder = MAC_PIB_macSuperframeOrder;
params.NLME_NETWORK_FORMATION_request.BatteryLifeExtension = MAC_PIB_macBattLifeExt;
currentPrimitive = NLME_NETWORK_FORMATION_request;
}
}
else
{
if (ZigBeeReady())
{
// ************************************************************************
// Place all processes that can send messages here. Be sure to call
// ZigBeeBlockTx() when currentPrimitive is set to APSDE_DATA_request.
// ************************************************************************
}
}
break;
default:
PrintChar( currentPrimitive );
ConsolePutROMString( (ROM char *)" Unhandled primitive.\r\n" );
currentPrimitive = NO_PRIMITIVE;
break;
}
|