2019-04-11 15:46:54 +00:00
|
|
|
#ifndef SUPERMARKET_NET_H
|
|
|
|
#define SUPERMARKET_NET_H
|
|
|
|
|
|
|
|
enum MsgType {
|
|
|
|
ASSOCIATION_REQUEST_MSG,
|
|
|
|
ASSOCIATION_REPLY_MSG,
|
|
|
|
BATTERY_STATUS_MSG,
|
|
|
|
ASSIGNMENT_MSG,
|
|
|
|
PRODUCT_MSG,
|
|
|
|
CASHOUT_MSG,
|
|
|
|
ITEM_ELEM_MSG
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Msg {
|
|
|
|
enum MsgType type;
|
2019-04-12 14:30:05 +00:00
|
|
|
uint8_t test;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct MsgBatteryStatus {
|
|
|
|
enum MsgType type;
|
|
|
|
uint8_t battery_percentage;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct MsgAssignment {
|
|
|
|
enum MsgType type;
|
|
|
|
uint32_t customer_id;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct MsgProduct {
|
|
|
|
enum MsgType type;
|
|
|
|
uint32_t product_id;
|
|
|
|
float price;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct MsgCashOut {
|
|
|
|
enum MsgType type;
|
|
|
|
uint32_t customer_id;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct MsgItemElem {
|
|
|
|
enum MsgType type;
|
|
|
|
float price;
|
|
|
|
bool last;
|
2019-04-11 15:46:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|