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

cyw43439: HCI implementation #271

Merged
merged 3 commits into from
Jun 11, 2024
Merged

cyw43439: HCI implementation #271

merged 3 commits into from
Jun 11, 2024

Conversation

deadprogram
Copy link
Member

@deadprogram deadprogram commented May 17, 2024

This PR is work in progress on support for the CYW43439 as used on the Raspberry Pi RP2040-W

To compile:

tinygo build -o test.uf2 -size=short -target=pico -tags=cyw43439 ./examples/scanner

UPDATE: this is now working! Just awaiting some updates to https://github.com/soypat/cyw43439 and it can be completed.

@deadprogram
Copy link
Member Author

This PR is now working once soypat/cyw43439#50 is merged into soypat/cyw43439#47 and that is merged into main.

$ tinygo flash -size=short -target=pico -tags="cyw43439" -monitor -ldflags="-X main.DeviceAddress=48:9E:47:66:90:8B" ./examples/heartrate-monitor/
   code    data     bss |   flash     ram                                                                
 432504   16356    3352 |  448860   19708                                                                                                                                                                          
Connected to /dev/ttyACM0. Press Ctrl-C to exit.                                                         
Enabling CYW43439 device                                                                                 
Enabled CYW43439 device                                                                                  
scanning...                                                                                              
found device: 48:9E:47:66:90:8B -70 Pixel 7a                                                             
connected to  48:9E:47:66:90:8B                                                                                                                                                                                    
discovering services/characteristics
found service 0000180d-0000-1000-8000-00805f9b34fb
found characteristic 00002a37-0000-1000-8000-00805f9b34fb
data: 90
data: 90
data: 90
data: 91
data: 91
data: 92
...

@deadprogram deadprogram changed the title cyw43439: work in progress on HCI implementation cyw43439: HCI implementation Jun 5, 2024
Base automatically changed from hci-transport to dev June 7, 2024 06:41
@deadprogram deadprogram force-pushed the hci-transport-cyw43439 branch 2 times, most recently from e7a1c5c to 1f725d8 Compare June 9, 2024 12:36
@deadprogram deadprogram marked this pull request as ready for review June 9, 2024 12:36
@deadprogram
Copy link
Member Author

The cyw43439 package was updated, so this PR is now ready for review and is working!

@deadprogram
Copy link
Member Author

Added docs. NOW it is ready 😸

Copy link
Member

@aykevl aykevl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some nits, but the code looks clean.

// Enable configures the BLE stack. It must be called before any
// Bluetooth-related calls (unless otherwise indicated).
func (a *Adapter) Enable() error {
time.Sleep(2 * time.Second)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's pretty long! Is this really required?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually I can remove this entirely.

adapter_cyw43439.go Outdated Show resolved Hide resolved
go.mod Show resolved Hide resolved
README.md Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
@deadprogram
Copy link
Member Author

Thanks for review @aykevl changes made so now merging.

@deadprogram deadprogram merged commit b1081a9 into dev Jun 11, 2024
5 checks passed
@deadprogram deadprogram deleted the hci-transport-cyw43439 branch June 11, 2024 08:06
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

Successfully merging this pull request may close these issues.

2 participants