/****************************************************************************
 * This file is part of the project AqHome.
 * AqHome (c) by 2023 Martin Preuss, all rights reserved.
 *
 * The license for this file can be found in the file COPYING which you
 * should have received along with this file.
 ****************************************************************************/

#ifndef AQH_FLASHRECORD_H
#define AQH_FLASHRECORD_H


#include <aqhome/api.h>
#include <aqhome/hexfile/hexfilerecord.h>

#include <gwenhywfar/list.h>


typedef struct AQH_FLASHRECORD AQH_FLASHRECORD;
GWEN_LIST_FUNCTION_LIB_DEFS(AQH_FLASHRECORD, AQH_FlashRecord, AQHOME_API)


AQHOME_API AQH_FLASHRECORD *AQH_FlashRecord_new();
AQHOME_API AQH_FLASHRECORD_LIST *AQH_FlashRecord_fromHexfileRecords(const AQH_HEXFILERECORD_LIST *hexFileRecordList);

AQHOME_API void AQH_FlashRecord_free(AQH_FLASHRECORD *fr);

AQHOME_API uint32_t AQH_FlashRecord_GetAddress(const AQH_FLASHRECORD *fr);
AQHOME_API void AQH_FlashRecord_SetAddress(AQH_FLASHRECORD *fr, uint32_t a);

AQHOME_API uint32_t AQH_FlashRecord_GetDataLength(const AQH_FLASHRECORD *fr);
AQHOME_API uint8_t *AQH_FlashRecord_GetDataPointer(const AQH_FLASHRECORD *fr);
AQHOME_API void AQH_FlashRecord_DirectlySetData(AQH_FLASHRECORD *fr, uint32_t dataLength, uint8_t *dataPtr);
AQHOME_API void AQH_FlashRecord_CopyAndSetData(AQH_FLASHRECORD *fr, uint32_t dataLength, const uint8_t *dataPtr);





#endif


