[product] changed price type from float to uint32_t

This commit is contained in:
francescobarbarulo 2019-04-16 15:49:11 +02:00
parent 109c58cb17
commit c38f616feb
2 changed files with 5 additions and 5 deletions

View File

@ -4,6 +4,6 @@
typedef struct product_t {
uint32_t product_id;
char expiration_date[8]; // gg/mm/yy
float price;
uint32_t price;
} product_t;
#endif

View File

@ -21,9 +21,9 @@
static linkaddr_t dest_addr = {{0x00, 0x12, 0x4b, 0x00, 0x0f, 0x24, 0x18, 0x04}};
product_t product_list[] = {
{ 1, "21/12/19", 1.05 },
{ 2, "12/05/19", 3.25 },
{ 3, "05/05/21", 2.50 }
{ 1, "21/12/19", 105 },
{ 2, "12/05/19", 325 },
{ 3, "05/05/21", 250 }
};
PROCESS(product_proc, "product random generator");
@ -38,7 +38,7 @@ void scan_product(product_t* p){
nullnet_len = sizeof(m);
NETSTACK_NETWORK.output(&dest_addr);
LOG_INFO("Product id [%d] scanned from ", (int)p->product_id);
LOG_INFO("Product id [%d, %d] scanned from ", (int)p->product_id, (int)p->price);
LOG_INFO_LLADDR(&dest_addr);
LOG_INFO_("\n");
}