Vault 7: Projects
This publication series is about specific projects related to the Vault 7 main publication.
break;
}
}
Function
uint8_t DRV_UART4_Peek(uint16_t offset)
1.2.3.1.17 DRV_UART4_Read Function
Returns the number of bytes read by the UART4 peripheral
File
drv_uart4.h
Syntax
unsigned int DRV_UART4_Read(uint8_t * buffer, const unsigned int numbytes);
Returns
Number of bytes actually copied into the caller's buffer or -1 if there is an error.
Description
This routine returns the number of bytes read by the Peripheral and fills the application read buffer with the read data.
Preconditions
DRV_UART4_InitializerDefault function should have been called before calling this function
Example
char myBuffer[MY_BUFFER_SIZE];
unsigned int numBytes;
DRV_UART4_TRANSFER_STATUS status ;
// Pre-initialize myBuffer with MY_BUFFER_SIZE bytes of valid data.
numBytes = 0;
while( numBytes < MY_BUFFER_SIZE);
{
status = DRV_UART4_TransferStatus ( ) ;
if (status & DRV_UART4_TRANSFER_STATUS_RX_FULL)
{
numBytes += DRV_UART4_Read( myBuffer + numBytes, MY_BUFFER_SIZE - numBytes ) ;
if(numBytes < readbufferLen)
{
continue;
}
else
{
break;
}
}
else
{
continue;
}
// Do something else...
}
Parameters
Parameters Description
buffer Buffer into which the data read from the UART4
numbytes Total number of bytes that need to be read from the UART4
(must be equal to or less than the size of the buffer)
1.2 UART Driver MLA - Drivers Help Driver Interface
36
Protego_Release_01_05-Related-OEM-Documentation-MLA_v2013_12_20-help_mla_driver.pdf