Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sp_blocking_read_next return 0 #45

Open
patoskhy opened this issue May 19, 2020 · 3 comments
Open

sp_blocking_read_next return 0 #45

patoskhy opened this issue May 19, 2020 · 3 comments
Assignees

Comments

@patoskhy
Copy link

Dear

I have a problem with sp_blocking_read_next, it doesn't return anything. There is some configuration that should be considered for it to respond correctly.

I have msys64 installed, libserialport. in trasnbank-pos-sdc-c I run "make run example = poll".

If you have any advice, I would appreciate it.

@afiebig
Copy link

afiebig commented Jun 18, 2020

Hi @patoskhy can you please try make debug example=poll

@patoskhy
Copy link
Author

patoskhy commented Jul 1, 2020

hi @afiebig
ok, this is the result

sp: sp_list_ports(00CFF914) called.
sp: Enumerating ports.
sp: Opening registry key.
sp: Querying registry key value and data sizes.
sp: Iterating over values.
sp: Found port COM1.
sp: sp_get_port_by_name(COM1, 00E70D90) called.
sp: Building structure for port COM1.
sp: get_port_details returning SP_OK.
sp: sp_get_port_by_name returning SP_OK.
sp: sp_list_ports returning SP_OK.
sp: sp_get_port_name(00E6AB10) called.
sp: sp_get_port_name returning COM1.
sp: sp_get_port_name(00E6AB10) called.
sp: sp_get_port_name returning COM1.
sp: sp_free_port_list(00E70D90) called.
sp: Freeing port list.
sp: sp_free_port(00E6AB10) called.
sp: Freeing port structure.
sp: sp_free_port returning.
sp: sp_free_port_list returning.
Available ports :

  1. COM1
    Please insert port option:1
    Using option: 1 -> "COM1" port ...
    =================
    sp: sp_get_port_by_name(COM1, 005A9484) called.
    sp: Building structure for port COM1.
    sp: get_port_details returning SP_OK.
    sp: sp_get_port_by_name returning SP_OK.
    sp: sp_open(00E6AB10, 0x3) called.
    sp: Opening port COM1.
    sp: New wait running in background.
    sp: restart_wait returning SP_OK.
    sp: get_config(00E6AB10, 00CFF96C, 00CFF940) called.
    sp: Getting configuration for port COM1.
    sp: get_config returning SP_OK.
    sp: set_config(00E6AB10, 00CFF96C, 00CFF940) called.
    sp: Setting configuration for port COM1.
    sp: await_write_completion(00E6AB10) called.
    sp: await_write_completion returning SP_OK.
    sp: set_config returning SP_OK.
    sp: sp_open returning SP_OK.
    sp: sp_new_config(00CFF97C) called.
    sp: sp_new_config returning SP_OK.
    sp: sp_set_config_baudrate(00E752E0, 115200) called.
    sp: sp_set_config_baudrate returning SP_OK.
    sp: sp_set_config_bits(00E752E0, 8) called.
    sp: sp_set_config_bits returning SP_OK.
    sp: sp_set_config_parity(00E752E0, 0) called.
    sp: sp_set_config_parity returning SP_OK.
    sp: sp_set_config_stopbits(00E752E0, 1) called.
    sp: sp_set_config_stopbits returning SP_OK.
    sp: sp_set_config_flowcontrol returning SP_OK.
    sp: sp_set_config(00E6AB10, 00E752E0) called.
    sp: get_config(00E6AB10, 00CFF878, 00CFF84C) called.
    sp: Getting configuration for port COM1.
    sp: get_config returning SP_OK.
    sp: set_config(00E6AB10, 00CFF878, 00E752E0) called.
    sp: Setting configuration for port COM1.
    sp: await_write_completion(00E6AB10) called.
    sp: await_write_completion returning SP_OK.
    sp: set_config returning SP_OK.
    sp: sp_set_config returning SP_OK.
    sp: sp_flush(00E6AB10, 0x3) called.
    sp: Flushing both buffers on port COM1.
    sp: Previous wait still running.
    sp: restart_wait returning SP_OK.
    sp: sp_flush returning SP_OK.
    sp: sp_free_config(00E752E0) called.
    sp: sp_free_config returning.
    Serial port successfully opened.

Polling the POS...
sp: sp_flush(00E6AB10, 0x3) called.
sp: Flushing both buffers on port COM1.
sp: Previous wait still running.
sp: restart_wait returning SP_OK.
sp: sp_flush returning SP_OK.
sp: sp_blocking_write(00E6AB10, 005A9020, 7, 1500) called.
sp: Writing 7 bytes to port COM1, timeout 1500 ms.
sp: await_write_completion(00E6AB10) called.
sp: await_write_completion returning SP_OK.
sp: Waiting for write to complete.
sp: Write completed, 7/7 bytes written.
sp: sp_blocking_write returning 7.
sp: sp_drain(00E6AB10) called.
sp: Draining port COM1.
sp: sp_drain returning SP_OK.
sp: sp_flush(00E6AB10, 0x2) called.
sp: Flushing output buffers on port COM1.
sp: sp_flush returning SP_OK.
sp: sp_blocking_read_next(00E6AB10, 00CFF987, 1, 1500) called.
sp: Reading next max 1 bytes from port COM1, timeout 1500 ms.
sp: Waiting for read to complete.
sp: Read timed out.
sp: restart_wait_if_needed returning SP_OK.
sp: sp_blocking_read_next returning 0.
sp: sp_flush(00E6AB10, 0x3) called.
sp: Flushing both buffers on port COM1.
sp: Previous wait still running.
sp: restart_wait returning SP_OK.
sp: sp_flush returning SP_OK.
sp: sp_blocking_write(00E6AB10, 005A9020, 7, 1500) called.
sp: Writing 7 bytes to port COM1, timeout 1500 ms.
sp: await_write_completion(00E6AB10) called.
sp: await_write_completion returning SP_OK.
sp: Waiting for write to complete.
sp: Write completed, 7/7 bytes written.
sp: sp_blocking_write returning 7.
sp: sp_drain(00E6AB10) called.
sp: Draining port COM1.
sp: sp_drain returning SP_OK.
sp: sp_flush(00E6AB10, 0x2) called.
sp: Flushing output buffers on port COM1.
sp: sp_flush returning SP_OK.
sp: sp_blocking_read_next(00E6AB10, 00CFF987, 1, 1500) called.
sp: Reading next max 1 bytes from port COM1, timeout 1500 ms.
sp: Waiting for read to complete.
sp: Read timed out.
sp: restart_wait_if_needed returning SP_OK.
sp: sp_blocking_read_next returning 0.
sp: sp_flush(00E6AB10, 0x3) called.
sp: Flushing both buffers on port COM1.
sp: Previous wait still running.
sp: restart_wait returning SP_OK.
sp: sp_flush returning SP_OK.
sp: sp_blocking_write(00E6AB10, 005A9020, 7, 1500) called.
sp: Writing 7 bytes to port COM1, timeout 1500 ms.
sp: await_write_completion(00E6AB10) called.
sp: await_write_completion returning SP_OK.
sp: Waiting for write to complete.
sp: Write completed, 7/7 bytes written.
sp: sp_blocking_write returning 7.
sp: sp_drain(00E6AB10) called.
sp: Draining port COM1.
sp: sp_drain returning SP_OK.
sp: sp_flush(00E6AB10, 0x2) called.
sp: Flushing output buffers on port COM1.
sp: sp_flush returning SP_OK.
sp: sp_blocking_read_next(00E6AB10, 00CFF987, 1, 1500) called.
sp: Reading next max 1 bytes from port COM1, timeout 1500 ms.
sp: Waiting for read to complete.
sp: Read timed out.
sp: restart_wait_if_needed returning SP_OK.
sp: sp_blocking_read_next returning 0.
Unable to poll the pos
sp: sp_flush(00E6AB10, 0x3) called.
sp: Flushing both buffers on port COM1.
sp: Previous wait still running.
sp: restart_wait returning SP_OK.
sp: sp_flush returning SP_OK.
sp: sp_close(00E6AB10) called.
sp: Closing port COM1.
sp: sp_close returning SP_OK.
sp: sp_free_port(00E6AB10) called.
sp: Freeing port structure.
sp: sp_free_port returning.
Serial port closed.

/**************************************************************************/

I have used doclight emulating the poll and this is result

image005
image007

I appreciate if you could help me

@afiebig
Copy link

afiebig commented Jul 3, 2020

It seems to me that the POS is not geting the message, are you sure it is in integrated mode and you are opening the right port?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants