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

"con" command flow #5

Open
Peter-Lin opened this issue Oct 12, 2017 · 25 comments
Open

"con" command flow #5

Peter-Lin opened this issue Oct 12, 2017 · 25 comments

Comments

@Peter-Lin
Copy link

Hi
I change the source code from bluez to bluedroid on system1(arm device),and system2 is still bluez(ubuntu notebook).

My steps is follow:
1:
On system1, launch beetle with the command line:
sudo beetle -m per
2.
On system2, , launch beetle with the command line:
sudo beetle -m cen
3.
On the system1 system, connect to beetle with the command:
telnet localhost 6969
4.
On the system2 system, connect to beetle with the command:
telnet localhost 6969
5.
On system1, start sending advertising packets over BLE with the command:
pad 0006 03c0 d202010123456789abcdef01
6.
On system2I can see the advertising packets:
adv 7b:e9:3e:41:f1:cc d202010123456789abcdef01 -83
7.
Quit telnet session on system2 and restart another telnet session
telnet localhost 6969 | grep -v "^adv"
8.
On system2, connect to the MAC address of the system1's
con 7b:e9:3e:41:f1:cc

Error:
I will see the STATUS_TIMED_OUT
con 7b:e9:3e:41:f1:cc 0009 0000
Question:
Could you tell me if system2 do the command "con" system1 have do anything in the source code and the code flow??
Could you give me some idea to debug this issue?
thanks

Daniel

@Peter-Lin
Copy link
Author

Hi

I try the same steps on the two ubuntu notebook(beetle is bluez) will get the same STATUS_TIMED_OUT result
con 20:68:9d:2d:5d:96 0009 0000

Daniel

@Peter-Lin
Copy link
Author

Hi
I can see
con 4b:3c:81:ac:95:36
con 4b:3c:81:ac:95:36 0000 0007
dis 0007 0000 0013

Do you know what is the reason 0013?
Where can I get the reason code?
Thanks~

Daniel

@clifliu
Copy link
Contributor

clifliu commented Oct 12, 2017 via email

@clifliu
Copy link
Contributor

clifliu commented Oct 12, 2017 via email

@afjgeorge
Copy link
Contributor

afjgeorge commented Oct 12, 2017 via email

@Peter-Lin
Copy link
Author

Hi Joe
I had ported the peripheral mode cmd_per_advertisement now, the others is on going.
Now I am trying to do the "con" command test following the connectiontest.md.
I can connect to the MAC address by the command:
con 4b:3c:81:ac:95:36
and can see the response
con 4b:3c:81:ac:95:36 0000 0007
but I will get the response after about 1 mins
dis 0007 0000 0013

I doubt that I port peripheral mode something wrong.
Do you have any suggesting?

About porting beetle sequence, I port peripheral mode firstly and follow the connectiontest.md to do test and find out errors and debug.
Do you have any suggestions about the sequence?

My bluedroid beetle can not run in Raspberry Pi 3, because my bluedroid beetle is base on Qualcomm Gatt interface.

thanks

Daniel

@clifliu
Copy link
Contributor

clifliu commented Oct 13, 2017 via email

@afjgeorge
Copy link
Contributor

Hi Daniel,

I've uploaded a copy of the Raspberry Pi3 beetle utility for you. This is an internal version I'm working on and not the public developer release, so please don't distribute it outside of Wistron. You should be able to install this on a Pi3 and use it for beetle testing per Clif's recommendation. If you need any assistance installing it please let me know. There are a few prerequisite packages but they're commonly available through apt-get.

afero-ble_1.0.366-1_armhf.deb.zip

My recommendation to swap central and peripheral mode hosts was under the assumption that you had ported central mode code already, if you're working on that now then my apologies, we'll have to try that when you finish your porting effort. :)

Thank you,

Joe

@Peter-Lin
Copy link
Author

Hi
Hubby will shut down the connection after 14 seconds of no activity so you should be fine<=I test the the time that it is about 15 seconds. But I only run beetle and don't enable hubby. Is it cause by beetle cen mode? Could I change the time from 14 seconds to 60 seconds to verify this issue? Could you tell me how to modify it?

evloop_on_read(&ev, context.listen_fd, handle_listener_read, &context);<=But I don't have the context.listen_fd,so I fill NULL to the fd
evloop_on_read(&ev, NULL, handle_listener_read, &context);
I found that "handle_listener_read" will not run.
Do you have any suggestions?

Thanks

Daniel

@afjgeorge
Copy link
Contributor

afjgeorge commented Oct 17, 2017 via email

@Peter-Lin
Copy link
Author

Hi Joe

I change the value "central.c:#define CONNECT_TIMEOUT 11"
the connect is still disabled about 15 seconds.

Daniel

@afjgeorge
Copy link
Contributor

afjgeorge commented Oct 20, 2017 via email

@Peter-Lin
Copy link
Author

Hi Joe
I try to connect by the command
con 65:d6:72:1a:c8:34
and get the response:
con 65:d6:72:1a:c8:34 0009 0000

I check the log:
(handle_hci_read)
evt_cmd_complete 01 200e
(handle_hci_read)
LE_CONNECT: addr=00:00:00:00:00:00 handle=0
handle_connect
addr = 00:00:00:00:00:00
no such device 00:00:00:00:00:00

Why the address is 00:00:00:00:00:00?
Could I avoid this issue?
Thanks.

Daniel

@afjgeorge
Copy link
Contributor

afjgeorge commented Oct 23, 2017 via email

@Peter-Lin
Copy link
Author

Hi Joe

I get the address 00:00:00:00:00:00 in the test environment.
Notebook is bluez central(I add debug message), DB2.1 is the bluedroid peripheral.
When in the open environment, I will get the address 00:00:00:00:00:00 easily.
But in the shielding room, the frequency is not always happen.

Maybe I can give you the code which I add debug message bluez beetle, but I am sorry that I can't give you the bluedroid beetle before my boss agree

Daniel

@afjgeorge
Copy link
Contributor

afjgeorge commented Oct 25, 2017 via email

@Peter-Lin
Copy link
Author

Hi Joe

When I run the command "kat 7" on the central side.
I will get the uuid 0x2803 not 0x2800 on the peripheral side.
Is it correct?
thanks~

Daniel

@clifliu
Copy link
Contributor

clifliu commented Nov 3, 2017

Yes this is correct. The babygatt_central stack does a Read By Type Request for GATT Characteristics (0x2803) not services (0x2800).

@Peter-Lin
Copy link
Author

Hi
The function "add_attribute" in the babygatt_peripheral.c is similar to add characteristic or descriptor in the gatt stack?
thanks~
Daniel

@clifliu
Copy link
Contributor

clifliu commented Nov 6, 2017 via email

@Peter-Lin
Copy link
Author

Hi

Run command "kat 7" on central device, my BLUEDROID peripheral device will not receive data.
1.
Is the behavor correct that my BLUEDROID peripheral device can not receive data?
2.
Does my BLUEDROID peripheral device have to parser the command which receives from central device send?
3.
What should my BLUEDROID peripheral device do after running command "kat 7" on central device?

thanks~

Daniel

@clifliu
Copy link
Contributor

clifliu commented Nov 8, 2017 via email

@tastybento
Copy link
Member

@Peter-Lin - Hi Daniel - did this work okay for you?

@Peter-Lin
Copy link
Author

Hi
I can get the message and data in the bluedroid level.
But I can't get the data in the bluedroid peripheral beetle.

Daniel

@afjgeorge
Copy link
Contributor

@Peter-Lin Hello Daniel,

We've had a big Thanksgiving holiday in the US and I've been out of the office a few days. How are you doing? Can we assist in any way?

Joe

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

4 participants