Home > Mobile >  Android to the bluetooth device to send the file data, takes a matter of time
Android to the bluetooth device to send the file data, takes a matter of time

Time:02-20

Android App to the bluetooth device to send the file data, because our bluetooth device receives the largest 200 bytes at a time, so I put the file data is divided into 200 bytes in one bag, send the subcontract,
But if sending data in a row, write data failure happens,
Online said that the need for interval between twice to send me a little time, so I now send a package every 500 milliseconds, but found that is too slow,
Tried to reduce the time interval to 100 milliseconds, also can appear error writing data failure,
Change to 200 milliseconds, but will not appear this kind of situation,
But still feeling slowly, calculation, if send a 5 m file, it takes approximately 87 minutes,
Because send the file data is made to the bluetooth device for the first time, so don't know if this is normal, bosses, please help me solve my confusion

CodePudding user response:

You this is a package to send and receive success to send a package?

CodePudding user response:

200 bytes, head long is understandable, the packet is 200 bytes.

CodePudding user response:

Error 200 milliseconds just discovering
Now changed to 300 milliseconds, to send the files in the test of 3.45 M,,,
That if 300 milliseconds can send file will need about 131 minutes in the 5 m

CodePudding user response:

Refer to https://blog.csdn.net/sinat_19628093/article/details/51890827? Utm_medium=distribute. Pc_relevant. None - task - blog - BlogCommendFromMachineLearnPai2-2. Control& Depth_1 - utm_source=distribute. Pc_relevant. None - task - blog - BlogCommendFromMachineLearnPai2-2. Control,
And bluetooth transmission have speed problems, about 160 KB/s limit,

CodePudding user response:

mountain branch reference 3 floor response:
200 milliseconds just discovering error
Now changed to 300 milliseconds, to send the files in the test of 3.45 M,,,
That if 300 milliseconds can send file will need about 131 minutes in the 5 m



Ha ha ha, you want to tease the hell out of me, each receiving 200 - byte must have a problem

CodePudding user response:

reference 1st floor can't write code monkey reply:
you this is a package to send and receive success to send a package?

Oh, no ah, I directly send the next packet interval of 300 milliseconds, should wait for a package sent successfully to send the next packet?

CodePudding user response:

refer to the second floor can't write code monkey reply:
200 bytes, head long is understandable, packet is 200 bytes.

Is such, have sent a few instructions, before the last step to send the file data, went directly to the file data

CodePudding user response:

reference 4 floor qq_1113502097 response:
reference https://blog.csdn.net/sinat_19628093/article/details/51890827? Utm_medium=distribute. Pc_relevant. None - task - blog - BlogCommendFromMachineLearnPai2-2. Control& Depth_1 - utm_source=distribute. Pc_relevant. None - task - blog - BlogCommendFromMachineLearnPai2-2. Control,
And contains a bluetooth transmission rate, around 160 KB/s limit,

I use the library: com. CLJ. Fastble: FastBleLib: 2.3.4, before also tried to revise the mtu, modified the mtu to 203, thought to send 200 bytes at a time, but only to send 20 bytes at a time, don't know where is didn't do right, or with bluetooth devices also have a relationship?

CodePudding user response:

Have relations, bluetooth protocol not only to see your hair how much, how much also look at each other, this is a serial port communication, mutual agreement to agree,

CodePudding user response:

refer to 7th floor [color=# 000000
mountain branch response:] so, before you have sent a few instructions, the final step to send the file data, went directly to the file data


This should be equipment problems, receiving quantity is too small

CodePudding user response:

references 9 f qq_1113502097 response:
have relations, bluetooth protocol not only to see your hair how much, how much also look at each other, this is a serial port communication, mutual agreement to agree,

Oh, oh, well understand, thank you,
Before I communicated with hardware engineer, he said that Android has the limitation of the 20 bytes, let me the subcontract by 20 bytes sent
I communicate with him again see

CodePudding user response:

reference 5 floor can't write code monkey's reply:
ha ha ha, you want to tease the hell out of me, each receiving 200 - byte must have problem

What you mean, no understand
Every time I did not receive 200 bytes, hardware engineer told me the bluetooth devices to send data at a time not more than 247 bytes, so they send a package for each 200 bytes, until all the data is sent, but there seems to be a limit, the Android system can only send 20 bytes, then I set the mtu is no use, I use the library itself can divide the data directly into the 20 bytes are sent

CodePudding user response:

The
references to the tenth floor can't write code monkey's reply:
, the problem should be equipment, too small receipt

Oh oh, good, that I communicate with the hardware, thanks
  • Related