Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: build

on:
push:
branches: [master]
pull_request:

jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v7

- uses: actions/setup-go@v7
with:
go-version: stable

- name: build
run: go build ./...

- name: vet
run: go vet ./...
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,19 @@ Function and type names in cbgo are intended to match the corresponding CoreBlue
* Named arguments in CoreBluetooth functions are eliminated.
* Properties are implemented as a pair of functions (`PropertyName` and `SetPropertyName`).

## L2CAP

Connection-oriented channels are supported in both roles. A central opens a
channel to a peripheral and is handed the result through its peripheral
delegate; a peripheral publishes a PSM and is handed incoming channels through
its peripheral manager delegate.

Reads and writes on an open channel never block. They return a count of zero
when the channel currently has no data to give or no space to take more, and
report the end of the stream once the far end goes away. Register an event
handler on the channel to be told when either of those conditions changes,
rather than polling for it.

## Issues

There are definitely memory leaks. ARC is not compatible with cgo, so objective C memory has to be managed manually. I didn't see a set of consistent guidelines for object ownership in the CoreBluetooth documentation, so cbgo errs on the side of leaking. Hopefully this is only an issue for very long running processes! Any fixes here are much appreciated.