Commit 286e3540 authored by 周尚's avatar 周尚

流程精简, 补充编译说明

parent cf6083c3
No preview for this file type
...@@ -5,3 +5,6 @@ ...@@ -5,3 +5,6 @@
** V1_0_0 ** V1_0_0
初版程序 初版程序
** 注
VS 编译时如有库依赖问题, 先注释相关代码, 运行后在使用 PAXPAYPRO2014 编译前解注释
...@@ -198,8 +198,6 @@ void setup() ...@@ -198,8 +198,6 @@ void setup()
memset(&act_st, 0, sizeof(ACT_ST)); memset(&act_st, 0, sizeof(ACT_ST));
memset(&pay_st, 0, sizeof(PAY_ST)); memset(&pay_st, 0, sizeof(PAY_ST));
strcpy(shop_st.serialNo, SN);
strcpy(shop_st.posKey, "65E6B6C46F7A039CCC571AF0BD8A22EA61785FDD250E32DE1AFAE82844F353BA");
memcpy(pay_st.spbillCreateIp, "8.8.8.8", strlen("8.8.8.8")); memcpy(pay_st.spbillCreateIp, "8.8.8.8", strlen("8.8.8.8"));
zx_config_read_shop(); zx_config_read_shop();
......
...@@ -28,14 +28,14 @@ int zx_config_read_shop() ...@@ -28,14 +28,14 @@ int zx_config_read_shop()
ret = seek(fd, 0, SEEK_SET); ret = seek(fd, 0, SEEK_SET);
if (ret < 0) { if (ret < 0) {
zx_common_disp_str((uchar *)"seek", 4, 0, 0, 0); zx_common_disp_str((uchar *)"seek", 4, 0, 0, 0);
// zx_err_file(); // zx_err_file();
goto end; goto end;
} }
ret = read(fd, (void *)buf, sizeof(SHOP_ST)); ret = read(fd, (void *)buf, sizeof(SHOP_ST));
if (ret == -1) { if (ret == -1) {
zx_common_disp_str((uchar *)"read", 4, 0, 0, 0); zx_common_disp_str((uchar *)"read", 4, 0, 0, 0);
// zx_err_file(); // zx_err_file();
goto end; goto end;
} else if (ret == sizeof(SHOP_ST)) } else if (ret == sizeof(SHOP_ST))
memcpy(&shop_st, buf, sizeof(SHOP_ST)); memcpy(&shop_st, buf, sizeof(SHOP_ST));
...@@ -55,14 +55,14 @@ int zx_config_write_shop() ...@@ -55,14 +55,14 @@ int zx_config_write_shop()
fd = open("shopData", O_CREATE | O_RDWR); fd = open("shopData", O_CREATE | O_RDWR);
if (fd < 0) { if (fd < 0) {
zx_common_disp_str((uchar *)"open", 4, 0, 0, 0); zx_common_disp_str((uchar *)"open", 4, 0, 0, 0);
// zx_err_file(); // zx_err_file();
goto end; goto end;
} }
ret = write(fd, (void *)&shop_st, sizeof(SHOP_ST)); ret = write(fd, (void *)&shop_st, sizeof(SHOP_ST));
if (ret == -1) { if (ret == -1) {
zx_common_disp_str((uchar *)"write", 4, 0, 0, 0); zx_common_disp_str((uchar *)"write", 4, 0, 0, 0);
// zx_err_file(); // zx_err_file();
goto end; goto end;
} }
...@@ -104,7 +104,6 @@ int zx_config_set_shop_param() ...@@ -104,7 +104,6 @@ int zx_config_set_shop_param()
if (ret > 0) { if (ret > 0) {
zx_code_urlstr_keyval_get((uchar const *)buff, "&", "shopId", shopId); zx_code_urlstr_keyval_get((uchar const *)buff, "&", "shopId", shopId);
zx_code_urlstr_keyval_get((uchar const *)buff, "&", "shopName", shopName); zx_code_urlstr_keyval_get((uchar const *)buff, "&", "shopName", shopName);
strcpy(shop_st.serialNo, SN);
strcpy(shop_st.shopId, shopId); strcpy(shop_st.shopId, shopId);
strcpy(shop_st.shopName, shopName); strcpy(shop_st.shopName, shopName);
zx_config_write_shop(); zx_config_write_shop();
...@@ -137,14 +136,14 @@ int zx_config_read_wifi() ...@@ -137,14 +136,14 @@ int zx_config_read_wifi()
ret = seek(fd, 0, SEEK_SET); ret = seek(fd, 0, SEEK_SET);
if (ret < 0) { if (ret < 0) {
zx_common_disp_str((uchar *)"seek", 4, 0, 0, 0); zx_common_disp_str((uchar *)"seek", 4, 0, 0, 0);
// zx_err_file(); // zx_err_file();
goto end; goto end;
} }
ret = read(fd, (void *)buf, sizeof(WIFI_ST)); ret = read(fd, (void *)buf, sizeof(WIFI_ST));
if (ret == -1) { if (ret == -1) {
zx_common_disp_str((uchar *)"read", 4, 0, 0, 0); zx_common_disp_str((uchar *)"read", 4, 0, 0, 0);
// zx_err_file(); // zx_err_file();
goto end; goto end;
} else if (ret == sizeof(WIFI_ST)) { } else if (ret == sizeof(WIFI_ST)) {
memcpy(&wifi_st, buf, sizeof(WIFI_ST)); memcpy(&wifi_st, buf, sizeof(WIFI_ST));
...@@ -167,13 +166,13 @@ int zx_config_write_wifi() ...@@ -167,13 +166,13 @@ int zx_config_write_wifi()
fd = open("wifi", O_CREATE | O_RDWR); fd = open("wifi", O_CREATE | O_RDWR);
if (fd < 0) { if (fd < 0) {
zx_common_disp_str((uchar *)"open", 4, 0, 0, 0); zx_common_disp_str((uchar *)"open", 4, 0, 0, 0);
// zx_err_file(); // zx_err_file();
goto end; goto end;
} }
ret = write(fd, (void *)&wifi_st, sizeof(WIFI_ST)); ret = write(fd, (void *)&wifi_st, sizeof(WIFI_ST));
if (ret == -1) { if (ret == -1) {
zx_common_disp_str((uchar *)"write", 4, 0, 0, 0); zx_common_disp_str((uchar *)"write", 4, 0, 0, 0);
// zx_err_file(); // zx_err_file();
goto end; goto end;
} }
...@@ -200,14 +199,14 @@ int zx_config_read_host() ...@@ -200,14 +199,14 @@ int zx_config_read_host()
ret = seek(fd, 0, SEEK_SET); ret = seek(fd, 0, SEEK_SET);
if (ret < 0) { if (ret < 0) {
zx_common_disp_str((uchar *)"seek", 4, 0, 0, 0); zx_common_disp_str((uchar *)"seek", 4, 0, 0, 0);
// zx_err_file(); // zx_err_file();
goto end; goto end;
} }
ret = read(fd, (void *)buf, HOSTLEN); ret = read(fd, (void *)buf, HOSTLEN);
if (ret == -1) { if (ret == -1) {
zx_common_disp_str((uchar *)"read", 4, 0, 0, 0); zx_common_disp_str((uchar *)"read", 4, 0, 0, 0);
// zx_err_file(); // zx_err_file();
goto end; goto end;
} else if (ret == HOSTLEN) { } else if (ret == HOSTLEN) {
strcpy(hosturl, buf); strcpy(hosturl, buf);
...@@ -228,7 +227,7 @@ int zx_config_write_host() ...@@ -228,7 +227,7 @@ int zx_config_write_host()
fd = open("hosturl", O_CREATE | O_RDWR); fd = open("hosturl", O_CREATE | O_RDWR);
if (fd < 0) { if (fd < 0) {
zx_common_disp_str((uchar *)"open", 4, 0, 0, 0); zx_common_disp_str((uchar *)"open", 4, 0, 0, 0);
// zx_err_file(); // zx_err_file();
goto end; goto end;
} }
......
...@@ -11,15 +11,11 @@ ...@@ -11,15 +11,11 @@
int zx_trans_send_shop(const SHOP_ST *shop_st, uchar *out) int zx_trans_send_shop(const SHOP_ST *shop_st, uchar *out)
{ {
uchar serialNo[20] = {0};
uchar const *ptr = NULL; uchar const *ptr = NULL;
int len = 0; int len = 0;
{ {
if (!shop_st->serialNo[0]) { ReadSN(shop_st->serialNo);
ReadSN(serialNo);
strcpy((void *)shop_st->serialNo, serialNo);
}
} }
{ {
...@@ -229,7 +225,7 @@ int zx_trans_biz(int trans_no) ...@@ -229,7 +225,7 @@ int zx_trans_biz(int trans_no)
memset(recvbuf, 0, sizeof(recvbuf)); memset(recvbuf, 0, sizeof(recvbuf));
ScrCls(); ScrCls();
zx_common_disp_str(" 易处理中 ", 0, LEFT, 0, 1); zx_common_disp_str(" 交易处理中 ", 0, LEFT, 0, 1);
ret = zx_wifi_check(); ret = zx_wifi_check();
if (ret < 0) { if (ret < 0) {
...@@ -237,13 +233,13 @@ int zx_trans_biz(int trans_no) ...@@ -237,13 +233,13 @@ int zx_trans_biz(int trans_no)
} }
if (!shop_st.posKey[0] && trans_no != TRANS_POSKEY) { if (!shop_st.posKey[0] && trans_no != TRANS_POSKEY) {
zx_common_disp_str("无KEY", 4, LEFT, 0, 0); zx_common_disp_str("KEY", 4, LEFT, 0, 0);
getkey(); getkey();
return -1; return -1;
} }
if (!hosturl[0]) { if (!hosturl[0]) {
zx_common_disp_str("请设置通讯地址", 0, LEFT, 0, 0); zx_common_disp_str("请设置通讯地址", 0, LEFT, 0, 0);
getkey(); getkey();
return -1; return -1;
} }
...@@ -280,7 +276,7 @@ int zx_trans_biz(int trans_no) ...@@ -280,7 +276,7 @@ int zx_trans_biz(int trans_no)
strcpy(para, "60"); strcpy(para, "60");
HttpParaCtl(s, HTTP_CMD_SET_TIMEOUT, para, strlen(para)); HttpParaCtl(s, HTTP_CMD_SET_TIMEOUT, para, strlen(para));
zx_common_disp_str("连接中, 请稍候...", 4, LEFT, 0, 0); zx_common_disp_str("连接中, 请稍候...", 4, LEFT, 0, 0);
ret = HttpPost(s, hosturl, sendbuf, sendlen); ret = HttpPost(s, hosturl, sendbuf, sendlen);
if (ret < 0) { if (ret < 0) {
zx_common_disp_str("HttpPost", 2, LEFT, 0, 0); zx_common_disp_str("HttpPost", 2, LEFT, 0, 0);
...@@ -320,7 +316,7 @@ int zx_trans_biz(int trans_no) ...@@ -320,7 +316,7 @@ int zx_trans_biz(int trans_no)
} }
HttpClose(s); HttpClose(s);
zx_common_disp_str("通讯结束", 4, 0, 0, 0); zx_common_disp_str("通讯结束", 4, 0, 0, 0);
zx_err_trans(rspCode); zx_err_trans(rspCode);
return ret; return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment