paypal / gatt

Gatt is a Go package for building Bluetooth Low Energy peripherals
BSD 3-Clause "New" or "Revised" License
1.13k stars 284 forks source link

Create connection only connects to public, but not random addresses. #25

Closed roylee17 closed 9 years ago

roylee17 commented 9 years ago

At the HCI level, this would be the PeerAddressType flag, which currently is hardcoded as the other detailed parameters.

cmd.LECreateConn{
            LEScanInterval:        0x0004,     // N x 0.625ms
            LEScanWindow:          0x0004,     // N x 0.625ms
            InitiatorFilterPolicy: 0x00,       // white list not used
            PeerAddressType:       0x00,       // public
            PeerAddress:           pd.Address, //
            OwnAddressType:        0x00,       // public
            ConnIntervalMin:       0x0006,     // N x 0.125ms
            ConnIntervalMax:       0x0006,     // N x 0.125ms
            ConnLatency:           0x0000,     //
            SupervisionTimeout:    0x000A,     // N x 10ms
            MinimumCELength:       0x0000,     // N x 0.625ms
            MaximumCELength:       0x0000,     // N x 0.625ms

We need to preserve peer type during the advertisement parsing, so that we know which to be specify when we send the created command.

roylee17 commented 9 years ago

Fixed by #26