#ifndef _SELECT_GUN_H_
#define _SELECT_GUN_H_

#include <stdint.h>

//------------------------------------------------------------------------------
//--- //For Audi for Audi customization ---
//------------------------------------------------------------------------------
#define ShmSelectGunInfoKey                     (1014)

#define SEL_GUN_RELEASE                         (0x00)
#define SEL_GUN_CONFIRM                         (0x01)
#define SEL_GUN_ATHOR                           (0x02)
#define SEL_GUN_PLUG_IT                         (0x03)
//#define SEL_GUN_CHARGING                        (0x04)
//#define SEL_GUN_CHARGING_COMP                   (0x05)

#define LEFT_GUN_NUM                            (0)
#define RIGHT_GUN_NUM                           (1)

#define SEL_GUN_TIMEOUT                         (120)

#define DESTROY_ALL_SEL                         (0x03)

#define FAIL_BALANCE_PRICES                     (-65535.00)

//------------------------------------------------------------------------------
//--- remote control ---
//------------------------------------------------------------------------------
//#define RT_NON_ACTION                           0x00
//#define RT_HARDWARE_REBOOT                      0x01
//#define RT_SOFTWARE_RESTART                     0x02

//------------------------------------------------------------------------------
//--- power cabinet Ethernet device status ---
//------------------------------------------------------------------------------
#define DEV_ST_DISABLE                          0x00
#define DEV_ST_ENABLE_USE                       0x01
#define DEV_ST_ENABLE_NO_USE                    0x02

#define EV_BOARD_STOP_CHARGING                  1
#define POWER_CABINET_STOP_CHARGING             2

//------------------------------------------------------------------------------
typedef struct StEthDevStatus {
    uint8_t Backend;
    uint8_t Ethernet;
    uint8_t Wifi;
    uint8_t FourG;
} EthDevStatus;

typedef struct StSelGunInfo {
    uint8_t LeftGun;
    uint8_t RightGun;
    uint8_t Reserved[2];
} SelGunInfo;

typedef struct StPricesInfo {
    //uint8_t Currency;
    float UserPrices;           //unit = 0.01 dollar, value / 100
    //float TotalCost;            //unit = 0.01 dollar, value / 100
    float Balance;              //unit = 0.01 dollar, value / 100
    //float DefaultPrices;        //unit = 0.01 dollar, value / 100
    float Discount;
    int TransactionId;
    float EnergyCost;
    float ParkingFee;
    float RemainAmount;
} PricesInfo;

//typedef struct StOperativeInfo {
//    uint8_t ChangeReq;
//    uint8_t ConnectorID;
//    uint8_t AvailabilityReq;
//    uint8_t Reserved;
//} OperativeInfo;

//typedef struct StStartCharge {
//    uint8_t ConnectorID;
//    uint8_t Status;
//    uint8_t Reserved[2];
//} StartCharge;

typedef struct StRemoteSetup {
    //uint8_t Execution;
    //uint8_t BtnStopCharging;
    uint16_t ConnectionTimeout;
    //float DefaultPrices;
    //OperativeInfo Operative;
    //StartCharge StartCharge;
    uint8_t Reserved[2];
} RemoteSetup;

typedef struct StAudiCustInfo {
    SelGunInfo SelGunInfo;
    PricesInfo PricesInfo[2];
    RemoteSetup RemoteSetup;
    EthDevStatus EthDevStatus;
    uint8_t AuthorStateFromCabinet[2];
    uint8_t WaitDoCommPermission[2]; //等待主櫃回覆再進入充電檢測
    //uint8_t Reserved; //保留
} SelectGunInfo;

//------------------------------------------------------------------------------
//int WaitAuthorPageState(void);
//void destroySelGun(uint8_t curGun);
//int waitRightGunPlugIt(uint8_t curGun);
//int waitLeftGunPlugIt(uint8_t curGun);
//void setSelGunWaitToAuthor(uint8_t curSel);
//int getConfirmSelectedGun(uint8_t curSel);
//void confirmSelGun(uint8_t selGun);

#endif /* _SELECT_GUN_H_ */