扫码出水添加参数判断
diff --git a/supwisdom/sp_communicate.c b/supwisdom/sp_communicate.c
index 98d6096..79b5601 100644
--- a/supwisdom/sp_communicate.c
+++ b/supwisdom/sp_communicate.c
@@ -363,10 +363,22 @@
{
card->feepara.fee_unit = (uint8)field.val.intval;
}
+ else if(IS_KEY(PK_INT_FEESTART,field.key))
+ {
+ card->feepara.fee_start = (uint8)field.val.intval;
+ }
+ else if(IS_KEY(PK_INT_WAITTIME,field.key))
+ {
+ card->qrcode.waittime = (uint32)field.val.intval;
+ }
else if(IS_KEY(PK_INT_WATERLIMIT, field.key))
{
card->waterlimit = (uint16)field.val.intval;
}
+ else if(IS_KEY(PK_INT_AMOUNT_LIMIT,field.key))
+ {
+ card->amountlimit = (uint16)field.val.intval;
+ }
}
return resp.retcode;
}
diff --git a/supwisdom/sp_communicate.h b/supwisdom/sp_communicate.h
index 2885435..c065f20 100644
--- a/supwisdom/sp_communicate.h
+++ b/supwisdom/sp_communicate.h
@@ -82,6 +82,7 @@
#define PK_INT_PERMIT "18"
#define PK_STR_LIMITMSG "19"
#define PK_INT_AMOUNT_LIMIT "20"
+#define PK_INT_WAITTIME "21"
#define SP_CMD_UPGRADE 0x20 //ÔÚÏßÉý¼¶
#define SP_CMD_TRANSDTL_ACCOUNT 0x22 //¼ÇÕËÁ÷Ë®
diff --git a/supwisdom/sp_config.h b/supwisdom/sp_config.h
index a277477..3daed08 100644
--- a/supwisdom/sp_config.h
+++ b/supwisdom/sp_config.h
@@ -159,6 +159,7 @@
uint32 starttime; //¶þάÂ뿪ʼʱ¼ä
uint32 nowtime; //¶þάÂ뵱ǰʱ¼ä
uint32 validtime; //¶þάÂëÓÐЧʱ¼ä
+ uint32 waittime; //³öË®µÈ´ýʱ¼ä
uint8 authstatus; //Óû§È·ÈÏ״̬£¨0-δȷÈÏ£¬1-ÒÑÈ·ÈÏ£©
uint8 paystatus; //Ö§¸¶×´Ì¬£¨0-´ýÖ§¸¶£¬ 1-ÒÑÖ§¸¶£¬ 2-´ú¿Û£¬3 - ¹Ø±Õ£©
uint8 paidAmount; //µ±¶©µ¥ÊÇÒÑÖ§¸¶×´Ì¬£¬·µ»ØÖ§¸¶³É¹¦½ð¶î £¬ ·ñÔòÊÇ 0
diff --git a/supwisdom/sp_consume.c b/supwisdom/sp_consume.c
index 368b45c..a141247 100644
--- a/supwisdom/sp_consume.c
+++ b/supwisdom/sp_consume.c
@@ -328,6 +328,14 @@
char msg[32];
sp_valve_off();
+ /**
+ **ÓÉÓÚÊÇÏȿ۷ѺóʹÓ㬷ÀÖ¹Ö»²å¿¨Ê±¿Û·Ñ
+ **/
+ if(pos->purchase.used_num == 0)
+ {
+ pos->purchase.paid_num = 0;
+ pos->purchase.paid_sum = 0;
+ }
ret = sp_prepare_below_transdtl(pos, card);
if(ret)
{
@@ -640,7 +648,7 @@
break;
}
disp_hint_info_two(pos, "ÇëÇó¶þάÂë","ÇëÉÔµÈ...",0);
- MEMCLEAR(&CARD,sizeof(sp_card_t));
+ MEMCLEAR(&CARD,sizeof(sp_card_t));
ret = sp_qrcode_init(pos, &CARD);
if(ret)
{
@@ -680,6 +688,7 @@
else
{
do_start(pos);
+ CARD.qrcode.starttime = CARD.qrcode.nowtime;
cardWorkState->last_state = cardWorkState->current_state;
cardWorkState->current_state = CARDWORKSTATUS_WORKING;
}
@@ -715,6 +724,17 @@
disp_hint_info_two(pos, "Í£Ö¹³öË®","ÒÑ´ïµ¥´Î½ð¶îÉÏÏÞ", DELAY_TIME2s);
cardWorkState->current_state = CARDWORKSTATUS_STOPPING;
}
+ /**È·ÈϳöË®ºó³¬¹ýµÈ´ýʱ¼äδ³öˮֹͣ³öË®**/
+ CARD.qrcode.nowtime = sp_get_ticker();
+ if((CARD.qrcode.nowtime - CARD.qrcode.starttime) > CARD.qrcode.waittime*DELAY_TIME1s)
+ {
+ if(pos->purchase.used_num == 0)
+ {
+ disp_hint_info_two(pos, "Í£Ö¹³öË®","δ¼ì²âµ½³öË®", DELAY_TIME2s);
+ cardWorkState->current_state = CARDWORKSTATUS_STOPPING;
+ }
+ }
+
cardWorkState->last_state = cardWorkState->current_state;
cardWorkState->pause_tick = sp_get_ticker();
break;