jonas-schievink / rubble

(going to be a) BLE stack for embedded Rust
BSD Zero Clause License
397 stars 56 forks source link

First-class beacon support #6

Closed jonas-schievink closed 5 years ago

jonas-schievink commented 5 years ago

Beacon usage is different from other usages (which establish connections), so it should get its own interface. Beacon use doesn't need a CSPRNG or crypto engine, and it sends non-connectable advertisements instead of connectable ones. It should also be easy to implement a simple beacon scanner.

The API should probably look like this:

This API should probably be limited to non-scannable beacons in any case (are scannable beacons even still called beacons?).

jonas-schievink commented 5 years ago

Beacon is now a thing, but BeaconScanner is still missing PDU deserialization support. This isn't trivial in a no-alloc situation, but still doable. Just needs a bit of thought put into it.

jonas-schievink commented 5 years ago

Apparently to use BeaconScanner you still have to create the entire link layer. This should be fixed, it's pretty silly.

jonas-schievink commented 5 years ago

Another thing to note: Data channel packets can be much larger than advertising channel packets (>255 Bytes vs. <40 Bytes). It would be nice if we could structure the radio interface in a way that allows using a smaller buffer if only advertising functionality is used.

Data channel packets can be up to 255 Bytes or so, but we don't have to support that. The smaller buffers are just fine.

jonas-schievink commented 5 years ago

I must have been hallucinating because BeaconScanner doesn't seem to exist.

jonas-schievink commented 5 years ago

BeaconScanner with filtering is now implemented