0

I am trying to develop alljoyn applications using C as my language binding. I have understood and implemented the basic tutorial, customized it and able to build applications at both server and client. Now comes the second part of my development to program a file transfer server and client by reading the files and putting them onto alljoyn bus reply.

Since Alljoyn reply can be only of 65536 bytes I framed my own protocol between server and client where server breaks down the message and the client receives the message chunks sequentially one after another. Now I am facing a problem here which I would like to describe briefly.

(1) If I transmit text messages I receive them perfectly.

(2) If I transmit a binary data I would loose data. My understanding is that the alljoyn bus reply is a string and whenever I am receiving a NULL all the subsequent characters are read as zeros at the receiver.

What to do for mitigating this.

I want to know if there any ways where I can mask off the NULL characters in my binary data string or the approach what I am following itself is flawed.

I just started to use this alljoyn framework and I am very much newbie. Any help would be greatly helpful.

Harsha
  • 13
  • 1
  • 5

1 Answers1

0

You should be using an array of bytes (signature of 'ay') to send as binary data. That should prevent alljoyn from truncating your strings when it sees a NULL. AllJoyn can handle binary data as long as you tell it that's what you're using.

John Sampson
  • 544
  • 4
  • 11
  • Hi, I Understand your suggestion but please clarify me on whether I can define two replies on alljoyn bus. One a string and other an array of unsigned integers. This is what I am doing. //// status = alljoyn_msgarg_array_set(outArg, &numArgs, "say", size_of_segment, segment_data); //// This is not setting the parameters and giving me an error //// Too many array elements - could be an address: ER_BUS_BAD_VALUE////. Could you please clarify a little bit – Harsha Aug 03 '16 at 07:26
  • To put it in more simpler terms I am able to pass integers but not uint8_t. Though both server and client are not showing any errors I am receiving 0 at client in case of unsigned integer. Now if I am trying to pass an array with signature 'ai' or 'ay' I am getting an error {{{{ Too many array elements - could be an address: ER_BUS_BAD_VALUE }}}} After I cross checked I realised that error is caused if I exceeded the maximum array size and I could cross check that ALLJOYN_MAX_ARRAY_LEN is 131072. But I am using an array of 256 elements still getting the same error. – Harsha Aug 03 '16 at 09:51