#Olly

1 messages ยท Page 1 of 1 (latest)

plain wigeonBOT
sterile ruin
#

Hi there

#

Hmmm have you added some logs to ensure you are calling discoverReaders prior to attempting to connect?

hidden charm
#

Hi! I didn't expect a fast answer ๐Ÿ™‚ I'll provide u some logs about discovery from terminal and xcode a bit later. Thank you!

sterile ruin
#

Sure

hidden charm
sterile ruin
#

Can you show me your code for dicoverReaders and connecting?

#

Also what type of reader are you using?

#

Ah those logs have simulated reader

#

So you are using a bluetooth connection, correct?

hidden charm
#

correct

#

these are simulated, but same behaviour on real devices: I have BBPOS, M2 and WisePad 3

sterile ruin
#

Gotcha.

#

Can you show me your code snippets?

hidden charm
#

do you think it can be because I don cancel discovery before connecting to bluetoothreader?

sterile ruin
#

Yeah what is cancelDiscovering()

#

Don't think you want that

hidden charm
sterile ruin
#

Can you remove that from your connection flow and then test again?

hidden charm
#

ok

#

now this one

#

and also if I'm not adding that cancelDiscoverying looks like it stucks on discovery process because I'm using it in a react native modal

#

and every time I open modal and do discoverReaders it shows me that error

sterile ruin
#

Was this working previously and then stopped working? Or you have just encountered this in the development process?

#

Also have you tried separating out your discovery from your connection?

#

Like you would discover on load

#

Then use a button or something to connect once you have successful discovery

plain wigeonBOT
hidden charm
#

I connect on tap one of the readers from list

#

that's right, whats was working now looks like it doesn't want to work

#

if is helpful for you I can send you my file/code

quaint lintel
#

Hi there ๐Ÿ‘‹ taking over, as my colleague needs to step away

Give me a few minutes to get caught up.

#

I connect on tap one of the readers from list
I don't know what this means. bismarck recommended discovering readers on page load (e.g. when the page renders), then having a separate event like onClick() to trigger the actually connect the reader. Have you tried that?

hidden charm
#

yes

#

I have an useEffect on discoverReaders process

#

and a separate function for connecting to reader

quaint lintel
#

Okay, but is the function for connecting the reader triggered by another event?

hidden charm
#

nope

#

Just the above one triggers it

#

I have some ideas, what might go wrong

hidden charm
# hidden charm

since all of them are promises, I'm gonna move into separate functions that will await for every event call in here to remove any other bad practices

#

but the weirdest part is this was working.....

#

now it is late for me, but tomorrow morning I'll come up with a result