8000 Corrected ioctl on mips (#52) by amarkee · Pull Request #53 · go-ble/ble · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Corrected ioctl on mips (#52) #53

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

Merged
merged 1 commit into from
May 19, 2021
Merged

Conversation

amarkee
Copy link
@amarkee amarkee commented Sep 3, 2019

Splits ioR and ioW related constants to a separate file and uses architecture build flags to determine which set to use.

Fixes file descriptor in bad state error from #52.

Copy link

Thanks for the PR! I do not have a mips system on which to test these changes. Can you provide some logs show the issue and logs showing it working with this fix?

@photostorm
Copy link

@amarkee what about "mipsle"?

@1am
Copy link
1am commented Jul 22, 2020

I have a MIPS (Carambola2) available and built the scanner example from https://github.com/amarkee/ble/tree/mips_ioctl with go 1.14.4, to make everything work fine had to make this go.mod file to fake it as github.com/go-ble/ble

module github.com/go-ble/ble

go 1.14

require (
	github.com/mattn/go-colorable v0.1.7 // indirect
	github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
	github.com/mgutz/logxi v0.0.0-20161027140823-aebf8a7d67ab
	github.com/pkg/errors v0.9.1
	golang.org/x/sys v0.0.0-20200720211630-cb9d2d5c5666
)

Built with:

GOOS=linux GOARCH=mips GOMIPS=softfloat go build examples/basic/scanner/main.go

After uploading and running the scanner with a HCI dongle seems to be working the same way as on my PC

# ./main 
Scanning for 5s...
[be:ef:fa:ce:00:00] C -50: MD: 6C6D72656D20697073756D3030
[be:ef:fa:ce:00:01] C -66: MD: 6C6D72656D20697073756D3031
[be:ef:fa:ce:00:02] C -50: MD: 6C6D72656D20697073756D3032
[be:ef:fa:ce:00:03] C -58: MD: 6C6D72656D20697073756D3033
[be:ef:fa:ce:00:04] C -56: MD: 6C6D72656D20697073756D3034
...

Hope this helps. Works for me

@estutzenberger estutzenberger merged commit 22bd95b into go-ble:master May 19, 2021
@caotian
Copy link
caotian commented Jan 11, 2022

I have a MIPS (Carambola2) available and built the scanner example from https://github.com/amarkee/ble/tree/mips_ioctl with go 1.14.4, to make everything work fine had to make this go.mod file to fake it as github.com/go-ble/ble

module github.com/go-ble/ble

go 1.14

require (
	github.com/mattn/go-colorable v0.1.7 // indirect
	github.com/mgutz/ansi v0.0.0-20200706080929-d51e80ef957d // indirect
	github.com/mgutz/logxi v0.0.0-20161027140823-aebf8a7d67ab
	github.com/pkg/errors v0.9.1
	golang.org/x/sys v0.0.0-20200720211630-cb9d2d5c5666
)

Built with:

GOOS=linux GOARCH=mips GOMIPS=softfloat go build examples/basic/scanner/main.go

After uploading and running the scanner with a HCI dongle seems to be working the same way as on my PC

# ./main 
Scanning for 5s...
[be:ef:fa:ce:00:00] C -50: MD: 6C6D72656D20697073756D3030
[be:ef:fa:ce:00:01] C -66: MD: 6C6D72656D20697073756D3031
[be:ef:fa:ce:00:02] C -50: MD: 6C6D72656D20697073756D3032
[be:ef:fa:ce:00:03] C -58: MD: 6C6D72656D20697073756D3033
[be:ef:fa:ce:00:04] C -56: MD: 6C6D72656D20697073756D3034
...

Hope this helps. Works for me

Appreciate your help, and I have a cpu with mipsle, so i change the build command to:

GOOS=linux GOARCH=mipsle GOMIPS=softfloat go build examples/basic/scanner/main.go

then the error still came out: can't new device : can't init hci: can't get device list: file descriptor in bad state.
Any ideas?

@1am
Copy link
1am commented Apr 6, 2022

From top of my head I'm not sure. Do you have the same problems when running bluetoothctl utility?

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.

5 participants
0