Hello Erel. Very nice to hear from you and do hope you have been well all these years. As you can see, serial comms again, just as in the basic4ppc days!!
OK, to recap, I have written the PC code at the sending end of things, so can change that around to send whatever characters are needed. All I need at the moment is the Android to receive a string and place it on a label. Simple, no??
I would prefer AsyncStreamsText simply because that looked simple and a single LF or CR could be used to terminate the string at the PC sending end as well as the Android receiving end. This is also the way all machine tool controllers work so I am familiar with this method of transmission.
I tried modifying Chat leaving it in prefix mode, but whatever I did with a prefix set of 4 bytes, nothing changed. The "messages" were still split up when I am trying to place the whole string on a label for display on the Android phone.
In Prefix mode, I understand that the first 4 bytes must be an equivalent 32 bit integer. So, as an example, I would send chr(0), chr(0), chr(0), chr(6) before the 6 bytes/characters of the message. No matter how I do this, or even omit the first 4 bytes, nothing changes at the Android end, the message is always split up.
So, I tried once again to get the AsyncStreamsText working and found that if I added the sample AsycStreamsText.bas code into another tab in the IDE, the class was then added to the project and I could then declare the AsyncStreamsText type instead of the AsnycStreams type. Yippee, I thought. However, I am now trying to work out how to get at the byte buffer that this newly added AsyncStreamsText offers, as now, I do not receive anything. I think I am looking at the original Astream instead of this new one (Astreams). I am also struggling with the initialisation line especially the first parameter which is some sort of object. The rest of the initialise function is OK. I would eventually like this to be a send or recieve stream, so have tried to initialise both as you did in Chat.
I need to learn a lot about the structure of the pages/activities etc as well as the syntax of the various functions/subs that are on these pages. It will all fall into place, but sadly, I do not have lots of time to devote to this. After tomorrow, I will be busy once again and will be forced to leave this alone for quite a while.
I thought it may be easy to get the Chat program tweaked to suit what I am doing, but that has not really happened just yet. I will persevere though and once working, a donation to your cause will follow, just as I did with basic4ppc. That worked really well, so I have high hopes with B4A as well.
I have been looking through all the booklets but nothing in there mentions AsyncStreamsText. The Serial reference only lists the basics and although AsyncStreamsText is mentioned, it is not shown how to implement it. Other projects use a network as an example but I cannot use a network where I will be, so I am tied to using Bluetooth.
Thank you for taking the time to look through this post and hope you have some golden pointers for me to follow!