https://github.com/shtirlic/go-iwd
go-iwd Go binding for iwd
https://github.com/shtirlic/go-iwd
api binding bindings d-bus go golang iwd network wifi wireless
Last synced: 3 months ago
JSON representation
go-iwd Go binding for iwd
- Host: GitHub
- URL: https://github.com/shtirlic/go-iwd
- Owner: shtirlic
- License: mit
- Created: 2024-05-11T09:02:29.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-13T11:19:32.000Z (about 2 years ago)
- Last Synced: 2025-12-17T18:44:39.455Z (6 months ago)
- Topics: api, binding, bindings, d-bus, go, golang, iwd, network, wifi, wireless
- Language: Go
- Homepage:
- Size: 9.77 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-iwd Go binding for iwd
__go-iwd__ is a Go D-BUS binding for iNet Wireless Daemon [iwd](https://iwd.wiki.kernel.org/) API.
> [!NOTE]
> Please keep in mind that project is under active development.
## Getting started
### Prerequisites
go-iwd requires [Go](https://go.dev/) version [1.22](https://go.dev/doc/devel/release#go1.22.0) or above.
### Getting go-iwd
With [Go's module support](https://go.dev/wiki/Modules#how-to-use-modules), `go [build|run|test]` automatically fetches the necessary dependencies when you add the import in your code:
```sh
import "github.com/shtirlic/go-iwd"
```
Alternatively, use `go get`:
```sh
go get -u github.com/shtirlic/go-iwd
```
## Usage
```go
func main() {
i, err := iwd.NewIwd()
if err != nil {
panic(err)
}
defer i.Close()
// Get iwd Stations
stations, err := i.Stations()
if err != nil {
panic(err)
}
// Disconnect from network
for _, station := range stations {
station.Disconnect()
}
// Connect to Known Network
for _, station := range stations {
if station.State == iwd.ConnectedState {
return
}
nets, _ := station.GetOrderedNetworks()
for _, net := range nets {
net.Connect()
}
}
// Output iwd Station diagnostic info
fmt.Println(station[0].GetDiagnostics())
}
```
#### Examples
A number of ready-to-run examples demonstrating various use cases of go-iwd are available in the [go-iwd examples](https://github.com/shtirlic/go-iwd/tree/main/examples) dir.
## Features
- [x] Minimal dependencies
- [x] Easy API access
- [ ] Full API support + Experimental iwd API
- [ ] TUI Client
- [ ] API Tests
### IWD API
- [x] Adapter
- [x] Daemon
- [x] Device
- [x] KnowNetwork
- [x] Network
- [x] Station
- [x] Station Diagnostic
- [x] WSC
- [ ] Access Point
- [ ] Adhoc
- [ ] Agent
- [ ] Device Provisioning
- [ ] RadioManager
- [ ] RuleManager
- [ ] P2P (peer, service)
- [ ] Station Debug
- [ ] IWD specific error handling
- [ ] D-BUS Signals
## iwd Architecture

## Links
- [iwd Project page](https://iwd.wiki.kernel.org/)
- [iwd Git repo](https://git.kernel.org/pub/scm/network/wireless/iwd.git)
- [iwd ArchWiki](https://wiki.archlinux.org/title/iwd)