jonas-schievink/rubble

Implement AccessAddress generation

Open

#16 geöffnet am 20. März 2019

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Rust (58 Forks)user submission
area: link layerhelp wantedstatus: needs codetype: enhancement

Repository-Metriken

Stars
 (403 Stars)
PR-Merge-Metriken
 (Keine gemergten PRs in 30 T)

Beschreibung

This is needed if the device wants to initiate a connection (by sending a connection request PDU), it is not needed if the device is just a peripheral that accepts a connection. It is specified in Part B 2.1.2 of Bluetooth Core v4.2.

Depends on #2.

Things that need to be done:

  • Create a struct AccessAddress(u32); newtype
  • Replace current uses of u32 for access addresses with the new type
    • The current advertising::ACCESS_ADDRESS constant can be replaced by an associated const AccessAddress::ADVERTISING
  • Implement Debug by hand and print the hex representation of the address
  • Implement a is_valid method that checks the requirements in the specification (also implement a lot of unit tests for this)
  • Implement a random constructor method that uses a rand_core::RngCore implementor to generate a random AccessAddress that adheres to the specified requirements

Contributor Guide