Skip to content
Permalink
Branch: master
Commits on Jul 10, 2019
  1. Bluetooth: Mesh: Move under subsys/bluetooth/mesh

    jhedberg committed Jul 9, 2019
    We've already got GATT services in subsys/bluetooth/services so
    subsys/bluetooth/mesh is a more natural place. Aditionally this aims
    to fix the Kconfig dependencies to be able to use mesh together with
    BT_CUSTOM (i.e. a custom, potentially non-HCI, host stack).
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Commits on Jul 1, 2019
  1. Bluetooth: Introduce separate pool for discardable events

    jhedberg committed Jun 28, 2019
    Introduce a separate buffer pool for events which the HCI driver
    considers discardable. Examples of such events could be e.g.
    Advertising Reports. The benefit of having such a pool means that the
    if there is a heavy inflow of such events it will not cause the
    allocation for other critical events to block and may even eliminate
    deadlocks in some cases.
    
    Also update all mesh samples not to specify explicit RX buffer counts
    anymore. Instead, create appropriate defaults in Kconfig so that we
    only need to override this in the app for cases like the bbc:microbit
    with limited memory.
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  2. Bluetooth: Add dedicated pool for HCI_Num_Completed_Packets HCI event

    jhedberg committed Jun 17, 2019
    This event is a priority one, so it's not safe to have it use the RX
    buffer pool which may be depleted due to non-priority events (e.g.
    advertising events). Since the event is consumed synchronously it's
    safe to have a single-buffer pool for it. Also introduce a new
    bt_buf_get_evt() API for HCI drivers to simplify the driver-side code,
    this effectively also deprecates bt_buf_get_cmd_complete() which now
    has no in-tree HCI driver users anymore.
    
    Fixes #16864
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Commits on Jun 27, 2019
  1. Bluetooth: Mesh: Fix provisioning send error handling

    jhedberg committed Jun 25, 2019
    Log all send errors, but don't try to call e.g. prov_send_fail_msg()
    since that'll almost certainly fail as well.
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  2. Bluetooth: Mesh: Fix rejecting invalid remote public key

    jhedberg committed Jun 25, 2019
    Mesh Profile Spec v1.0.1 | Section 5.4.2.3:
    "The Provisioner and the device shall check whether the public key
    provided by the peer device or obtained OOB is valid (see Section
    5.4.3.1).
    
    When the Provisioner receives an invalid public key, then provisioning
    fails, and the Provisioner shall act as described in Section 5.4.4.
    When the device receives an invalid public key, then provisioning
    fails, and the device shall act as described in Section 5.4.4."
    
    This is also in Erratum 10395 which is Mandatory for Mesh v1.0.
    
    The code was already rejecting the key, however that rejection
    happened only after we had already sent our public key as response,
    which got interpreted as acceptance by the tester (PTS).
    
    Fixes MESH/NODE/PROV/BI-13-C.
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  3. Bluetooth: Mesh: Generate new public key for each provisioning session

    jhedberg committed Jun 25, 2019
    Mesh Profile Spec v1.0.1 Section 5.4.2.3: "If the public key was not
    available using an OOB technology, then the public keys are exchanged
    between the Provisioner and the unprovisioned device. For each
    exchange, a new key pair shall be generated by the Provisioner and the
    unprovisioned device."
    
    This allows passing MESH/NODE/PROV/BV-12-C.
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  4. Bluetooth: Fix public key callback management

    jhedberg committed Jun 25, 2019
    Clear the callback list once generation is complete and we've done
    calling all callbacks. This lets us use bt_pub_key_gen() multiple
    times, which before this patch could have resulted in a corrupt linked
    list.
    
    Also remove redundant callback dispatching from bt_pub_key_gen() since
    the function checks for the PUB_KEY_BUSY flag in the beginning, i.e.
    there cannot be other pending generation actions at this point in the
    code.
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  5. Bluetooth: SMP: Make public key handling more robust

    jhedberg committed Jun 25, 2019
    Update code to handle other users of the public key generation APIs
    by fetching the current public key at the beginning of each SMP
    session. This is particularly important if someone creates the (rather
    odd) combination of Mesh and SMP where Mesh will regenerate a new
    key pair after provisioning.
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  6. Bluetooth: Mesh: Rename reset_link() to reset_adv_link()

    jhedberg committed Jun 25, 2019
    This is a PB-ADV specific internal helper, so rename it appropriately
    to avoid any confusion.
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  7. Bluetooth: Mesh: Fix Public Key mismatch error handling

    jhedberg committed Jun 25, 2019
    Mismatch in Public Key type will cause device to send Invalid Format
    error, and treat any further PDU's as unexpected.
    
    This affects MESH/NODE/PROV/BI-03-C test case.
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  8. Bluetooth: Mesh: Fix missing protocol error timeout

    jhedberg committed Jun 25, 2019
    Provisioning errors shouldn't cause device to close link. Upon error,
    device will send Provisioning Failed PDU, and any further PDU's will
    be considered as unexpected as per Mesh Profile section 5.4.4.
    
    Also a timer is started every time device sends or receives a PDU.
    This affects MESH/NODE/PROV/BV-10-C test case.
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Commits on Jun 26, 2019
  1. Bluetooth: Fix not using log_strdup() for bt_uuid_str()

    jhedberg committed Jun 13, 2019
    The string returned by bt_uuid_str() is not in ROM so log_strdup()
    must be used on it. This also eliminates the following kind of warning
    messages: "<err> log: argument 3 in log message "%s: start_handle
    0x%04x end_handle 0x%04x type %s" missing log_strdup()."
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Commits on Jun 25, 2019
  1. Bluetooth: Mesh: Fix segmented message RPL behavior

    jhedberg committed Jun 18, 2019
    Update the Replay Protection List handling for segmented messages to
    be more in line with Figure 3.43 in Mesh Profile Specification 1.0.
    This means that the RPL check and update need to be split into two
    independent steps rather than always doing these together.
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Commits on Jun 19, 2019
  1. Bluetooth: Fix expiring RPA when different local identities are used

    jhedberg committed Jun 18, 2019
    When advertising with different identities we need to flag any
    programmed RPA as invalid if it was generated using a different
    identity.
    
    Fixes #16893
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  2. Bluetooth: Remove unused bt_hci_get_cmd_opcode() function

    jhedberg committed Jun 19, 2019
    This function has no users in the tree.
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  3. Bluetooth: Remove unnecessary HCI command data array

    jhedberg committed Jun 19, 2019
    This array was created because more than 4 bytes were needed, however
    now the minimum is 8 bytes, so we can use the net_buf user data
    directly.
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  4. Bluetooth: Increase BT_BUF_USER_DATA_MIN to 8

    jhedberg committed Jun 19, 2019
    Commit b65fe62 updated the minimum
    required net_buf user data to 8 bytes, so increase this define as
    well. It has no other practical purpose except to trigger build
    asserts if the user data is for some reason ever decreased below this
    minimum.
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Commits on Jun 15, 2019
  1. Bluetooth: Simplify bt_gatt_notify_cb() API

    jhedberg committed Jun 15, 2019
    This API had several issues:
    
     - The parameter types and order were inconsistent with e.g.
       bt_le_adv_start()
     - There were no real users of num_params, which just caused increased
       code size and memory consumption for no good reason.
     - The error handling policy was arbitrary: if one of the
       notifications would fail it would be impossible for the caller to
       know if some notifications succeeded, i.e. at what point the
       failure happened. Some callers might also want to make note of the
       failure but continue trying to notify for the remaining parameters.
    
    The first issue is easily fixable, but because of the other two I
    think it's best we don't have this code as part of the stack, rather
    require whoever needs it to do the for loop themselves. It's just a
    few lines of code, so the benefit of having this in the stack was
    anyway quite minimal.
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Commits on Jun 5, 2019
  1. Bluetooth: Mesh: Fix missing implementation of Proxy SAR timeout

    jhedberg committed Jun 4, 2019
    Mesh Profile 1.0 Section 6.6:
    "The timeout for the SAR transfer is 20 seconds. When the timeout
    expires, the Proxy Server shall disconnect."
    
    This will let qualification test case MESH/SR/PROX/BV-05-C pass
    without requiring an explicit disconnect.
    
    Fixes #16600
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Commits on May 7, 2019
  1. Bluetooth: Mesh: Fix postponing storage deadline indefinitely

    jhedberg committed May 7, 2019
    If the local node keeps getting bombarded with messages, it's possible
    that the storage timer gets rescheduled over and over again and never
    expires. Add the necessary code to only reschedule the timer if the
    new deadline is earlier than an existing one.
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  2. Bluetooth: Mesh: Fix RPL storage timeout handling

    jhedberg committed May 7, 2019
    The default values for the timeouts, as well as non-defaults in most
    Mesh samples, use a higher value for the RPL than then generic mesh
    storage timeout. This hasn't had any effect in practice since the code
    only uses the RPL timeout if it is *smaller* than the generic one.
    
    The original intention of the code was to use the RPL timeout,
    regardless of what the generic one is, whenever the RPL is the only
    thing that needs updating. Add some helper macros to track the various
    groups of pending flags, and perform the appropriate checks to apply
    the RPL timeout whenever it's smaller than the generic timeout, or if
    there are no other items to store besides the RPL.
    
    Fixes #15904
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  3. CODEOWNERS: Add joerchan and remove sjanc for Bluetooth host paths

    jhedberg committed May 7, 2019
    Szymon is no longer actively looking at Bluetooth code, whereas Joakim
    from Nordic has been assigned for Bluetooth host support.
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Commits on May 2, 2019
  1. Bluetooth: Fix return type for settings read callback

    jhedberg committed May 1, 2019
    settings_read_cb is defined to return ssize_t and not size_t. This
    also eliminates several Coverity warnings.
    
    Fixes #15765
    Fixes #15768
    Fixes #15771
    Fixes #15774
    Fixes #15778
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Commits on Apr 18, 2019
  1. net: buf: Remove wrong alignment annotation from NET_BUF_SIMPLE()

    jhedberg authored and nashif committed Mar 29, 2019
    The code (net_buf_simple_init in particular) expects the data buffer
    to immediately follow the net_buf_simple struct, so it's wrong to
    request any specific alignment for this buffer. In practice this
    doesn't make any difference since the net_buf_simple struct itself is
    4-bytes aligned and a multiple of 4 bytes, however the extra
    __net_buf_align makes it look like its location in memory doesn't need
    to immediately follow the net_buf_simple struct.
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Commits on Apr 17, 2019
  1. Bluetooth: Mesh: Add error checks for scan start/stop

    jhedberg committed Mar 22, 2019
    It may be very important information for the developer if scanning
    fails to start or stop, so add proper logs. There's no need to log
    EALREADY errors, since the mesh stack doesn't track the current scan
    state and simply relies on the under lying GAP layer to return this
    error if the desired state is already set.
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Commits on Apr 11, 2019
  1. Bluetooth: Mesh: Fix qualification test MESH/SR/HM/CFS/BV-02-C

    jhedberg committed Apr 11, 2019
    The commit 8d0ef1e attempted to fix
    test case MESH/SR/HM/CFS/BV-02-C, however inadvertently ended up
    introducing a hidden bug. This bug was unearthed thanks to commit
    686f5c7. We have to keep always track
    of the FastPeriodDivisor state whether we're using it (faults > 0) or
    not (faults == 0). Introduce a boolean field to the model publication
    that's used to indicate whether the FastPeriodDivisor should be
    applied or not, instead of zeroing the divisor when there are no
    faults (this would cause wrong behavior when faults appear again).
    
    Additionally, the PTS seems to require that we wait until the end of
    the existing period before sending the next Health Current Status,
    rather than sending it immediately when the fault count changes.
    
    Fixes #15365
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  2. doc: relnotes: 1.14 Bluetooth Host release notes

    jhedberg authored and nashif committed Apr 11, 2019
    Add major changes for Bluetooth Host since 1.13.
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Commits on Apr 10, 2019
  1. doc: bluetooth: Clarify notes about blocking in the RX thread

    jhedberg authored and nashif committed Apr 8, 2019
    Callbacks called from the RX thread may block, but should avoid doing
    it for long periods of time.
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  2. doc: bluetooth: Move L2CAP text from to API reference section

    jhedberg authored and nashif committed Apr 8, 2019
    Move the L2CAP text from the guides section to the API reference
    section.
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  3. doc: bluetooth: Move GATT text to API reference section

    jhedberg authored and nashif committed Apr 8, 2019
    Move the GATT text from the guides section to the API reference.
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  4. doc: bluetooth: Add reference to Mesh API section

    jhedberg authored and nashif committed Apr 8, 2019
    Add a reference from the architecture guide to the Mesh API section.
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  5. doc: bluetooth: Fix text corruption

    jhedberg authored and nashif committed Apr 8, 2019
    For some reason there were garbage characters at the end of the line.
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  6. doc: bluetooth: Move connection management text to API reference

    jhedberg authored and nashif committed Apr 8, 2019
    Move the connection management text from the Guides section to the API
    reference section.
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  7. Bluetooth: Fix clearing conn->le.keys when unpairing

    jhedberg committed Apr 10, 2019
    When calling bt_unpair() the keys were removed from flash, however a
    pointer was left to the invalidated keys in case there was an existing
    connection. This would then lead to a bogus entry being stored in
    flash for a zero-address peer device. Fix this issue by clearing the
    conn->le.keys pointer in the bt_unpair() function.
    
    Fixes #15325
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
  8. Bluetooth: Mesh: Fix not updating health publication message

    jhedberg committed Apr 9, 2019
    The bt_mesh_fault_update() API is meant for updating the publication
    message and sending it out to the network, however it was missing the
    necessary call to health_pub_update() which is responsible for
    updating the publication message.
    
    Fixes #15300
    
    Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Older
You can’t perform that action at this time.