1. Chocos
  2. ChocoOS
  3. chocos
  4. Pull requests

[BLOCKER] Implement datapackage library

#41 · Created  · Last updated

Merged pull request

Merged in implement-datapackage-library (pull request #41)

  • 4584e25
  • Author:
  • Closed by:
  • 2017-09-24

General Description:

There is a lot of functions in the system that handles read/write operations on buffers. Very often it is required to pass the buffer size and address to the function and also request about number of bytes that has been read/written. It has to be implemented in each module separately. The idea of the task is to prepare a simple module that helps in such operations. The module should be implemented as part of the Library Space in files oc_datapackage.h and oc_datapackage.c.

Example of usage

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 void WriteData( const void * Buffer, oC_MemorySize_t * Size ) { oC_DataPackage_t dataPackage; // We give here pointer to the dataPackage, // pointer to the buffer with data, // size of the buffer, // number of bytes of data in the buffer // And flag set to true if the buffer is for reading only oC_DataPackage_Initialize( &dataPackage, Buffer, *Size, *Size, true ); // We read data from the buffer as long as it is no empty and we can send the byte while( !oC_DataPackage_IsEmpty( &dataPackage ) && SendByte( oC_DataPackage_GetDataU8( &dataPackage ) ) ); // At the end we can set the number of sent data in the `Size` function parameter *Size -= oC_DataPackage_GetLeftSize( &dataPackage ); }

Pull Request Description

The pull request is implementation of the task #188 Trello requirements you can find here: https://trello.com/c/dTYHKFkE

Release notes:

  • Add -Werror to libraries space and replace type of <stdbool.h> include to allow eclipse for correctly interpretation in indexer

  • Implementation of DataPackage library

0 attachments


Loading commits...