Skip to content

Commit 787b813

Browse files
author
Daniel Jäckle
committed
Apply code conventions to the main applications.
1 parent 8eb8d9b commit 787b813

File tree

9 files changed

+252
-255
lines changed

9 files changed

+252
-255
lines changed

src/apps/LoRaMac/classA/LoRaMote/main.c

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -394,14 +394,14 @@ static void OnLed2TimerEvent( void )
394394
/*!
395395
* \brief MCPS-Confirm event function
396396
*
397-
* \param [IN] McpsConfirm - Pointer to the confirm structure,
397+
* \param [IN] mcpsConfirm - Pointer to the confirm structure,
398398
* containing confirm attributes.
399399
*/
400-
static void McpsConfirm( McpsConfirm_t *McpsConfirm )
400+
static void McpsConfirm( McpsConfirm_t *mcpsConfirm )
401401
{
402-
if( McpsConfirm->Status == LORAMAC_EVENT_INFO_STATUS_OK )
402+
if( mcpsConfirm->Status == LORAMAC_EVENT_INFO_STATUS_OK )
403403
{
404-
switch( McpsConfirm->McpsRequest )
404+
switch( mcpsConfirm->McpsRequest )
405405
{
406406
case MCPS_UNCONFIRMED:
407407
{
@@ -435,17 +435,17 @@ static void McpsConfirm( McpsConfirm_t *McpsConfirm )
435435
/*!
436436
* \brief MCPS-Indication event function
437437
*
438-
* \param [IN] McpsIndication - Pointer to the indication structure,
438+
* \param [IN] mcpsIndication - Pointer to the indication structure,
439439
* containing indication attributes.
440440
*/
441-
static void McpsIndication( McpsIndication_t *McpsIndication )
441+
static void McpsIndication( McpsIndication_t *mcpsIndication )
442442
{
443-
if( McpsIndication->Status != LORAMAC_EVENT_INFO_STATUS_OK )
443+
if( mcpsIndication->Status != LORAMAC_EVENT_INFO_STATUS_OK )
444444
{
445445
return;
446446
}
447447

448-
switch( McpsIndication->McpsIndication )
448+
switch( mcpsIndication->McpsIndication )
449449
{
450450
case MCPS_UNCONFIRMED:
451451
{
@@ -482,27 +482,27 @@ static void McpsIndication( McpsIndication_t *McpsIndication )
482482
ComplianceTest.DownLinkCounter++;
483483
}
484484

485-
if( McpsIndication->RxData == true )
485+
if( mcpsIndication->RxData == true )
486486
{
487-
switch( McpsIndication->Port )
487+
switch( mcpsIndication->Port )
488488
{
489489
case 1: // The application LED can be controlled on port 1 or 2
490490
case 2:
491-
if( McpsIndication->BufferSize == 1 )
491+
if( mcpsIndication->BufferSize == 1 )
492492
{
493-
AppLedStateOn = McpsIndication->Buffer[0] & 0x01;
493+
AppLedStateOn = mcpsIndication->Buffer[0] & 0x01;
494494
GpioWrite( &Led3, ( ( AppLedStateOn & 0x01 ) != 0 ) ? 0 : 1 );
495495
}
496496
break;
497497
case 224:
498498
if( ComplianceTest.Running == false )
499499
{
500500
// Check compliance test enable command (i)
501-
if( ( McpsIndication->BufferSize == 4 ) &&
502-
( McpsIndication->Buffer[0] == 0x01 ) &&
503-
( McpsIndication->Buffer[1] == 0x01 ) &&
504-
( McpsIndication->Buffer[2] == 0x01 ) &&
505-
( McpsIndication->Buffer[3] == 0x01 ) )
501+
if( ( mcpsIndication->BufferSize == 4 ) &&
502+
( mcpsIndication->Buffer[0] == 0x01 ) &&
503+
( mcpsIndication->Buffer[1] == 0x01 ) &&
504+
( mcpsIndication->Buffer[2] == 0x01 ) &&
505+
( mcpsIndication->Buffer[3] == 0x01 ) )
506506
{
507507
IsTxConfirmed = false;
508508
AppPort = 224;
@@ -526,7 +526,7 @@ static void McpsIndication( McpsIndication_t *McpsIndication )
526526
}
527527
else
528528
{
529-
ComplianceTest.State = McpsIndication->Buffer[0];
529+
ComplianceTest.State = mcpsIndication->Buffer[0];
530530
switch( ComplianceTest.State )
531531
{
532532
case 0: // Check compliance test disable command (ii)
@@ -556,12 +556,12 @@ static void McpsIndication( McpsIndication_t *McpsIndication )
556556
ComplianceTest.State = 1;
557557
break;
558558
case 4: // (vii)
559-
AppDataSize = McpsIndication->BufferSize;
559+
AppDataSize = mcpsIndication->BufferSize;
560560

561561
AppData[0] = 4;
562562
for( uint8_t i = 1; i < AppDataSize; i++ )
563563
{
564-
AppData[i] = McpsIndication->Buffer[i] + 1;
564+
AppData[i] = mcpsIndication->Buffer[i] + 1;
565565
}
566566
break;
567567
case 5: // (viii)
@@ -589,14 +589,14 @@ static void McpsIndication( McpsIndication_t *McpsIndication )
589589
/*!
590590
* \brief MLME-Confirm event function
591591
*
592-
* \param [IN] MlmeConfirm - Pointer to the confirm structure,
592+
* \param [IN] mlmeConfirm - Pointer to the confirm structure,
593593
* containing confirm attributes.
594594
*/
595-
static void MlmeConfirm( MlmeConfirm_t *MlmeConfirm )
595+
static void MlmeConfirm( MlmeConfirm_t *mlmeConfirm )
596596
{
597-
if( MlmeConfirm->Status == LORAMAC_EVENT_INFO_STATUS_OK )
597+
if( mlmeConfirm->Status == LORAMAC_EVENT_INFO_STATUS_OK )
598598
{
599-
switch( MlmeConfirm->MlmeRequest )
599+
switch( mlmeConfirm->MlmeRequest )
600600
{
601601
case MLME_JOIN:
602602
{
@@ -610,8 +610,8 @@ static void MlmeConfirm( MlmeConfirm_t *MlmeConfirm )
610610
if( ComplianceTest.Running == true )
611611
{
612612
ComplianceTest.LinkCheck = true;
613-
ComplianceTest.DemodMargin = MlmeConfirm->DemodMargin;
614-
ComplianceTest.NbGateways = MlmeConfirm->NbGateways;
613+
ComplianceTest.DemodMargin = mlmeConfirm->DemodMargin;
614+
ComplianceTest.NbGateways = mlmeConfirm->NbGateways;
615615
}
616616
break;
617617
}
@@ -749,8 +749,8 @@ int main( void )
749749
}
750750
if( ComplianceTest.Running == true )
751751
{
752-
// Schedule next packet transmission as soon as possible
753-
TxDutyCycleTime = 300; // 300 ms
752+
// Schedule next packet transmission
753+
TxDutyCycleTime = 5000; // 5000 ms
754754
}
755755
else
756756
{

src/apps/LoRaMac/classA/SK-iM880A/main.c

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ License: Revised BSD License, see LICENSE.TXT file include in the project
1212
1313
Maintainer: 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

Comments
 (0)