diff options
| author | Shlomo Hecht <shlomo@twine-s.com> | 2020-05-20 11:52:10 +0300 |
|---|---|---|
| committer | Shlomo Hecht <shlomo@twine-s.com> | 2020-05-20 11:52:10 +0300 |
| commit | 4f5f566c04f9ae11fe871e20eaeb4adf43504bb7 (patch) | |
| tree | c84b43b8c3d46a335bbeb7c8bcf3fca5cf1c091c /Software/Embedded_SW/Embedded/Common/Utilities | |
| parent | 231591bb23fc74ffd038c2d58af1c8669e6cf61b (diff) | |
| download | Tango-4f5f566c04f9ae11fe871e20eaeb4adf43504bb7.tar.gz Tango-4f5f566c04f9ae11fe871e20eaeb4adf43504bb7.zip | |
fix current alarms (PP only). RFID stubs,
Diffstat (limited to 'Software/Embedded_SW/Embedded/Common/Utilities')
3 files changed, 132 insertions, 60 deletions
diff --git a/Software/Embedded_SW/Embedded/Common/Utilities/RFIDTagHandling.c b/Software/Embedded_SW/Embedded/Common/Utilities/RFIDTagHandling.c index 1e6550da4..39c2592ee 100644 --- a/Software/Embedded_SW/Embedded/Common/Utilities/RFIDTagHandling.c +++ b/Software/Embedded_SW/Embedded/Common/Utilities/RFIDTagHandling.c @@ -13,7 +13,7 @@ #include "PMR/Diagnostics/CartridgeValidationResponse.pb-c.h" #include "PMR/Diagnostics/CartridgeTagContent.pb-c.h" #include <PMR/Diagnostics/EventType.pb-c.h> -#include <Utilities/RfidTagContent.h> +#include <Utilities/RfidTagHandling.h> #include <Drivers/I2C_Communication/RFID_NFC/RFIDTagInfo.h> #include "drivers/Valves/Valve.h" #include "Modules/Waste/Waste.h" @@ -244,7 +244,7 @@ CartridgeTagContent * NFCTag_Tag2PPC(NFCTag_t *Tag) return Tag; } -CartridgeTagContent * RFID_Tag2PPC(RfidTagContent *Tag) +/*CartridgeTagContent * RFID_Tag2PPC(RfidTagContent *Tag) { CartridgeTagContent *PpcTag = my_malloc(sizeof(CartridgeTagContent)); @@ -350,4 +350,5 @@ RfidTagContent * RFID_PPC2Tag( CartridgeTagContent *PpcTag) return Tag; -} +}*/ + diff --git a/Software/Embedded_SW/Embedded/Common/Utilities/RFIDTagHandling.h b/Software/Embedded_SW/Embedded/Common/Utilities/RFIDTagHandling.h new file mode 100644 index 000000000..192f1e075 --- /dev/null +++ b/Software/Embedded_SW/Embedded/Common/Utilities/RFIDTagHandling.h @@ -0,0 +1,128 @@ +/* + * RFIDTagHandling.h + * + * Created on: May 8, 2020 + * Author: shlomo + */ +#include "include.h" + +#include "PMR/Diagnostics/CartridgeTagContent.pb-c.h" +#include <Drivers/I2C_Communication/RFID_NFC/RFIDTagInfo.h> + +/* + typedef struct +{ + uint8_t TagUniqueID[8]; //RFID Tag unique ID + char SerialNumber[16]; + char FactoryId[3]; + int32_t FillingSystemId; + char ColorName[12]; + int32_t ColorCategory; + int32_t ColorTypeRevision; + int32_t CartridgeSize; + int32_t FilledInkVolume; + char InkBatchNum[10]; + char InkMFGDate[6]; + char InkEOLDate[6]; + char CartridgeFillingDate[6]; + char WasteFilledDate[6]; + int32_t PlugInCounter; + bool Inkfill; + bool InkUsed; + bool InkEmpty; + bool WasteEmpty; + bool WasteFilling; + bool WasteFull; + bool Blocked; + bool Fail; + int32_t WasteCounter; + char MachineIdInkUsed[16]; + char MachineIdWasteUsed[16]; +}RfidTagContent; +typedef struct +{ + uint8_t TagUniqueID[8]; //RFID Tag unique ID + uint8_t CartSN[16]; //Cartridge serial number + uint32_t InkFactoryID:24; //Ink factory ID + uint32_t FillSysID:16; //Filling system ID number + uint8_t WorkOrder[10]; //Color description / ID + uint8_t ColorName[12]; //Color description / ID + uint32_t InkCategory:16; //Ink category (TBD) + uint32_t Type_Rev; //TBD – can be formulation # + uint32_t CartridgeSize; //Size in cc + uint32_t FiledInkVol; //Size in cc + uint8_t InkBatchNo[10]; //MFG batch No’ + uint8_t InkMFGDate[6]; //Date Ink was manufactured (20L container bar-code) + uint8_t InkEOLDate[6]; //Ink end of life date + uint8_t CartFillDate[6]; //Date cartridge was filled with ink (CFS) + uint8_t WasteFillDate[6]; //Date cartridge was filled with waste (Machine) + uint32_t Misc; + uint32_t PluginCounter:16; //Number of times cartridge was plugged in INK Slot + uint8_t InkFillStatus; //State indicator - successful state change when starting to fill mid. tank + uint8_t InkUsedStatus; + uint8_t InkEmptyStatus; + uint8_t WasteEmptyStatus; + uint8_t WasteFillingStatus; + uint8_t WasteFullStatus; + uint8_t Blocked; + uint8_t Fail; + uint32_t WasteCounter:16; + uint8_t MachineIdINL[16]; + uint8_t MachineIdWST[16]; + uint8_t Spare[13]; + uint32_t Counter; + uint8_t TagValid; + uint8_t HashValue[32]; + uint32_t Checksum_CRC16:16; +}NFCTag_t; + + struct _CartridgeTagContent +{ + ProtobufCMessage base; + protobuf_c_boolean has_uniqueid; + uint32_t uniqueid; + char *serialnumber; + char *factoryid; + protobuf_c_boolean has_fillingsystemid; + int32_t fillingsystemid; + char *colorname; + protobuf_c_boolean has_colorcategory; + int32_t colorcategory; + protobuf_c_boolean has_colortyperevision; + int32_t colortyperevision; + protobuf_c_boolean has_cartridgesize; + int32_t cartridgesize; + protobuf_c_boolean has_filledinkvolume; + int32_t filledinkvolume; + char *inkbatchnum; + char *inkmfgdate; + char *inkeoldate; + char *cartridgefillingdate; + char *wastefilleddate; + protobuf_c_boolean has_plugincounter; + int32_t plugincounter; + protobuf_c_boolean has_inkfill; + protobuf_c_boolean inkfill; + protobuf_c_boolean has_inkused; + protobuf_c_boolean inkused; + protobuf_c_boolean has_inkempty; + protobuf_c_boolean inkempty; + protobuf_c_boolean has_wasteempty; + protobuf_c_boolean wasteempty; + protobuf_c_boolean has_wastefilling; + protobuf_c_boolean wastefilling; + protobuf_c_boolean has_wastefull; + protobuf_c_boolean wastefull; + protobuf_c_boolean has_blocked; + protobuf_c_boolean blocked; + protobuf_c_boolean has_fail; + protobuf_c_boolean fail; + protobuf_c_boolean has_wastecounter; + int32_t wastecounter; + char *machineidinkused; + char *machineidwasteused; +}; + */ +CartridgeTagContent * NFCTag_Tag2PPC(NFCTag_t *Tag); + NFCTag_t * NFCTag_PPC2Tag( CartridgeTagContent *PpcTag); + diff --git a/Software/Embedded_SW/Embedded/Common/Utilities/RfidTagContent.h b/Software/Embedded_SW/Embedded/Common/Utilities/RfidTagContent.h deleted file mode 100644 index daebf8e68..000000000 --- a/Software/Embedded_SW/Embedded/Common/Utilities/RfidTagContent.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * RfidTagContent.h - * - * Created on: Jul 8, 2019 - * Author: shlomo - */ - -#ifndef MODULES_IFS_RFIDTAGCONTENT_H_ -#define MODULES_IFS_RFIDTAGCONTENT_H_ - -#include "PMR/Diagnostics/CartridgeSlot.pb-c.h" -#include "PMR/Diagnostics/CartridgeTagContent.pb-c.h" -#include <Drivers/I2C_Communication/RFID_NFC/RFIDTagInfo.h> - -#include <DataDef.h> -#include "include.h" - - -#define MAX_CARTRIDGES (CARTRIDGE_SLOT__WasteLower+1) -typedef struct -{ - char uniqueid[8]; - char serialnumber[16]; - int32_t factoryid; - int32_t fillingsystemid; - char colorname[12]; - int32_t colorcategory; - int32_t colortyperevision; - int32_t cartridgesize; - int32_t filledinkvolume; - char inkbatchnum[10]; - char inkmfgdate[6]; - char inkeoldate[6]; - char cartridgefillingdate[6]; - char wastefilleddate[6]; - int32_t plugincounter; - bool inkfill; - bool inkused; - bool inkempty; - bool wasteempty; - bool wastefilling; - bool wastefull; - bool blocked; - bool fail; - int32_t wastecounter; - char machineidinkused[16]; - char machineidwasteused[16]; -}RfidTagContent; - -CartridgeTagContent * RFID_Tag2PPC(RfidTagContent *Tag); -RfidTagContent * RFID_PPC2Tag( CartridgeTagContent *PpcTag); - -NFCTag_t * NFCTag_PPC2Tag( CartridgeTagContent *PpcTag); -CartridgeTagContent * NFCTag_Tag2PPC(NFCTag_t *Tag); - - -#endif /* MODULES_IFS_RFIDTAGCONTENT_H_ */ |
