@@ -12,7 +12,6 @@ License: Revised BSD License, see LICENSE.TXT file include in the project
1212
1313Maintainer: Andreas Pella (IMST GmbH), Miguel Luis and Gregory Cristian
1414*/
15-
1615#include <string.h>
1716#include <math.h>
1817#include "board.h"
@@ -342,14 +341,14 @@ static void OnLed2TimerEvent( void )
342341/*!
343342 * \brief MCPS-Confirm event function
344343 *
345- * \param [IN] McpsConfirm - Pointer to the confirm structure,
344+ * \param [IN] mcpsConfirm - Pointer to the confirm structure,
346345 * containing confirm attributes.
347346 */
348- static void McpsConfirm ( McpsConfirm_t * McpsConfirm )
347+ static void McpsConfirm ( McpsConfirm_t * mcpsConfirm )
349348{
350- if ( McpsConfirm -> Status == LORAMAC_EVENT_INFO_STATUS_OK )
349+ if ( mcpsConfirm -> Status == LORAMAC_EVENT_INFO_STATUS_OK )
351350 {
352- switch ( McpsConfirm -> McpsRequest )
351+ switch ( mcpsConfirm -> McpsRequest )
353352 {
354353 case MCPS_UNCONFIRMED :
355354 {
@@ -383,17 +382,17 @@ static void McpsConfirm( McpsConfirm_t *McpsConfirm )
383382/*!
384383 * \brief MCPS-Indication event function
385384 *
386- * \param [IN] McpsIndication - Pointer to the indication structure,
385+ * \param [IN] mcpsIndication - Pointer to the indication structure,
387386 * containing indication attributes.
388387 */
389- static void McpsIndication ( McpsIndication_t * McpsIndication )
388+ static void McpsIndication ( McpsIndication_t * mcpsIndication )
390389{
391- if ( McpsIndication -> Status != LORAMAC_EVENT_INFO_STATUS_OK )
390+ if ( mcpsIndication -> Status != LORAMAC_EVENT_INFO_STATUS_OK )
392391 {
393392 return ;
394393 }
395394
396- switch ( McpsIndication -> McpsIndication )
395+ switch ( mcpsIndication -> McpsIndication )
397396 {
398397 case MCPS_UNCONFIRMED :
399398 {
@@ -430,27 +429,27 @@ static void McpsIndication( McpsIndication_t *McpsIndication )
430429 ComplianceTest .DownLinkCounter ++ ;
431430 }
432431
433- if ( McpsIndication -> RxData == true )
432+ if ( mcpsIndication -> RxData == true )
434433 {
435- switch ( McpsIndication -> Port )
434+ switch ( mcpsIndication -> Port )
436435 {
437436 case 1 : // The application LED can be controlled on port 1 or 2
438437 case 2 :
439- if ( McpsIndication -> BufferSize == 1 )
438+ if ( mcpsIndication -> BufferSize == 1 )
440439 {
441- AppLedStateOn = McpsIndication -> Buffer [0 ] & 0x01 ;
440+ AppLedStateOn = mcpsIndication -> Buffer [0 ] & 0x01 ;
442441 GpioWrite ( & Led3 , ( ( AppLedStateOn & 0x01 ) != 0 ) ? 1 : 0 );
443442 }
444443 break ;
445444 case 224 :
446445 if ( ComplianceTest .Running == false )
447446 {
448447 // Check compliance test enable command (i)
449- if ( ( McpsIndication -> BufferSize == 4 ) &&
450- ( McpsIndication -> Buffer [0 ] == 0x01 ) &&
451- ( McpsIndication -> Buffer [1 ] == 0x01 ) &&
452- ( McpsIndication -> Buffer [2 ] == 0x01 ) &&
453- ( McpsIndication -> Buffer [3 ] == 0x01 ) )
448+ if ( ( mcpsIndication -> BufferSize == 4 ) &&
449+ ( mcpsIndication -> Buffer [0 ] == 0x01 ) &&
450+ ( mcpsIndication -> Buffer [1 ] == 0x01 ) &&
451+ ( mcpsIndication -> Buffer [2 ] == 0x01 ) &&
452+ ( mcpsIndication -> Buffer [3 ] == 0x01 ) )
454453 {
455454 IsTxConfirmed = false;
456455 AppPort = 224 ;
@@ -474,7 +473,7 @@ static void McpsIndication( McpsIndication_t *McpsIndication )
474473 }
475474 else
476475 {
477- ComplianceTest .State = McpsIndication -> Buffer [0 ];
476+ ComplianceTest .State = mcpsIndication -> Buffer [0 ];
478477 switch ( ComplianceTest .State )
479478 {
480479 case 0 : // Check compliance test disable command (ii)
@@ -504,12 +503,12 @@ static void McpsIndication( McpsIndication_t *McpsIndication )
504503 ComplianceTest .State = 1 ;
505504 break ;
506505 case 4 : // (vii)
507- AppDataSize = McpsIndication -> BufferSize ;
506+ AppDataSize = mcpsIndication -> BufferSize ;
508507
509508 AppData [0 ] = 4 ;
510509 for ( uint8_t i = 1 ; i < AppDataSize ; i ++ )
511510 {
512- AppData [i ] = McpsIndication -> Buffer [i ] + 1 ;
511+ AppData [i ] = mcpsIndication -> Buffer [i ] + 1 ;
513512 }
514513 break ;
515514 case 5 : // (viii)
@@ -537,14 +536,14 @@ static void McpsIndication( McpsIndication_t *McpsIndication )
537536/*!
538537 * \brief MLME-Confirm event function
539538 *
540- * \param [IN] MlmeConfirm - Pointer to the confirm structure,
539+ * \param [IN] mlmeConfirm - Pointer to the confirm structure,
541540 * containing confirm attributes.
542541 */
543- static void MlmeConfirm ( MlmeConfirm_t * MlmeConfirm )
542+ static void MlmeConfirm ( MlmeConfirm_t * mlmeConfirm )
544543{
545- if ( MlmeConfirm -> Status == LORAMAC_EVENT_INFO_STATUS_OK )
544+ if ( mlmeConfirm -> Status == LORAMAC_EVENT_INFO_STATUS_OK )
546545 {
547- switch ( MlmeConfirm -> MlmeRequest )
546+ switch ( mlmeConfirm -> MlmeRequest )
548547 {
549548 case MLME_JOIN :
550549 {
@@ -558,8 +557,8 @@ static void MlmeConfirm( MlmeConfirm_t *MlmeConfirm )
558557 if ( ComplianceTest .Running == true )
559558 {
560559 ComplianceTest .LinkCheck = true;
561- ComplianceTest .DemodMargin = MlmeConfirm -> DemodMargin ;
562- ComplianceTest .NbGateways = MlmeConfirm -> NbGateways ;
560+ ComplianceTest .DemodMargin = mlmeConfirm -> DemodMargin ;
561+ ComplianceTest .NbGateways = mlmeConfirm -> NbGateways ;
563562 }
564563 break ;
565564 }
@@ -697,8 +696,8 @@ int main( void )
697696 }
698697 if ( ComplianceTest .Running == true )
699698 {
700- // Schedule next packet transmission as soon as possible
701- TxDutyCycleTime = 300 ; // 300 ms
699+ // Schedule next packet transmission
700+ TxDutyCycleTime = 5000 ; // 5000 ms
702701 }
703702 else
704703 {
0 commit comments