Lines Matching refs:macMsg

24 LoRaMacParserStatus_t LoRaMacParserJoinAccept( LoRaMacMessageJoinAccept_t* macMsg )  in LoRaMacParserJoinAccept()  argument
26 if( ( macMsg == 0 ) || ( macMsg->Buffer == 0 ) ) in LoRaMacParserJoinAccept()
33 macMsg->MHDR.Value = macMsg->Buffer[bufItr++]; in LoRaMacParserJoinAccept()
35 memcpy1( macMsg->JoinNonce, &macMsg->Buffer[bufItr], 3 ); in LoRaMacParserJoinAccept()
38 memcpy1( macMsg->NetID, &macMsg->Buffer[bufItr], 3 ); in LoRaMacParserJoinAccept()
41 macMsg->DevAddr = ( uint32_t ) macMsg->Buffer[bufItr++]; in LoRaMacParserJoinAccept()
42 macMsg->DevAddr |= ( ( uint32_t ) macMsg->Buffer[bufItr++] << 8 ); in LoRaMacParserJoinAccept()
43 macMsg->DevAddr |= ( ( uint32_t ) macMsg->Buffer[bufItr++] << 16 ); in LoRaMacParserJoinAccept()
44 macMsg->DevAddr |= ( ( uint32_t ) macMsg->Buffer[bufItr++] << 24 ); in LoRaMacParserJoinAccept()
46 macMsg->DLSettings.Value = macMsg->Buffer[bufItr++]; in LoRaMacParserJoinAccept()
48 macMsg->RxDelay = macMsg->Buffer[bufItr++]; in LoRaMacParserJoinAccept()
50 if( ( macMsg->BufSize - LORAMAC_MIC_FIELD_SIZE - bufItr ) == LORAMAC_CF_LIST_FIELD_SIZE ) in LoRaMacParserJoinAccept()
52 memcpy1( macMsg->CFList, &macMsg->Buffer[bufItr], LORAMAC_CF_LIST_FIELD_SIZE ); in LoRaMacParserJoinAccept()
55 else if( ( macMsg->BufSize - LORAMAC_MIC_FIELD_SIZE - bufItr ) > 0 ) in LoRaMacParserJoinAccept()
60 macMsg->MIC = ( uint32_t ) macMsg->Buffer[bufItr++]; in LoRaMacParserJoinAccept()
61 macMsg->MIC |= ( ( uint32_t ) macMsg->Buffer[bufItr++] << 8 ); in LoRaMacParserJoinAccept()
62 macMsg->MIC |= ( ( uint32_t ) macMsg->Buffer[bufItr++] << 16 ); in LoRaMacParserJoinAccept()
63 macMsg->MIC |= ( ( uint32_t ) macMsg->Buffer[bufItr++] << 24 ); in LoRaMacParserJoinAccept()
68 LoRaMacParserStatus_t LoRaMacParserData( LoRaMacMessageData_t* macMsg ) in LoRaMacParserData() argument
70 if( ( macMsg == 0 ) || ( macMsg->Buffer == 0 ) ) in LoRaMacParserData()
77 macMsg->MHDR.Value = macMsg->Buffer[bufItr++]; in LoRaMacParserData()
79 macMsg->FHDR.DevAddr = macMsg->Buffer[bufItr++]; in LoRaMacParserData()
80 macMsg->FHDR.DevAddr |= ( ( uint32_t ) macMsg->Buffer[bufItr++] << 8 ); in LoRaMacParserData()
81 macMsg->FHDR.DevAddr |= ( ( uint32_t ) macMsg->Buffer[bufItr++] << 16 ); in LoRaMacParserData()
82 macMsg->FHDR.DevAddr |= ( ( uint32_t ) macMsg->Buffer[bufItr++] << 24 ); in LoRaMacParserData()
84 macMsg->FHDR.FCtrl.Value = macMsg->Buffer[bufItr++]; in LoRaMacParserData()
86 macMsg->FHDR.FCnt = macMsg->Buffer[bufItr++]; in LoRaMacParserData()
87 macMsg->FHDR.FCnt |= macMsg->Buffer[bufItr++] << 8; in LoRaMacParserData()
89 memcpy1( macMsg->FHDR.FOpts, &macMsg->Buffer[bufItr], macMsg->FHDR.FCtrl.Bits.FOptsLen ); in LoRaMacParserData()
90 bufItr = bufItr + macMsg->FHDR.FCtrl.Bits.FOptsLen; in LoRaMacParserData()
93 macMsg->FPort = 0; in LoRaMacParserData()
94 macMsg->FRMPayloadSize = 0; in LoRaMacParserData()
96 if( ( macMsg->BufSize - bufItr - LORAMAC_MIC_FIELD_SIZE ) > 0 ) in LoRaMacParserData()
98 macMsg->FPort = macMsg->Buffer[bufItr++]; in LoRaMacParserData()
100 macMsg->FRMPayloadSize = ( macMsg->BufSize - bufItr - LORAMAC_MIC_FIELD_SIZE ); in LoRaMacParserData()
101 memcpy1( macMsg->FRMPayload, &macMsg->Buffer[bufItr], macMsg->FRMPayloadSize ); in LoRaMacParserData()
102 bufItr = bufItr + macMsg->FRMPayloadSize; in LoRaMacParserData()
105 macMsg->MIC = ( uint32_t ) macMsg->Buffer[( macMsg->BufSize - LORAMAC_MIC_FIELD_SIZE )]; in LoRaMacParserData()
106macMsg->MIC |= ( ( uint32_t ) macMsg->Buffer[( macMsg->BufSize - LORAMAC_MIC_FIELD_SIZE ) + 1] << … in LoRaMacParserData()
107macMsg->MIC |= ( ( uint32_t ) macMsg->Buffer[( macMsg->BufSize - LORAMAC_MIC_FIELD_SIZE ) + 2] << … in LoRaMacParserData()
108macMsg->MIC |= ( ( uint32_t ) macMsg->Buffer[( macMsg->BufSize - LORAMAC_MIC_FIELD_SIZE ) + 3] << … in LoRaMacParserData()