Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1ef7020 authored by Chris Manton's avatar Chris Manton Committed by Automerger Merge Worker
Browse files

Enum-ify stack/smp/smp_int::SMP_MODEL_ am: fdfc65d2

Original change: https://android-review.googlesource.com/c/platform/system/bt/+/1540560

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I773b2e2e8a5894bcf47491658b6c26ad6e938486
parents 6d83b6fa fdfc65d2
Loading
Loading
Loading
Loading
+16 −15
Original line number Diff line number Diff line
@@ -30,21 +30,22 @@
#include "smp_api.h"
#include "stack/crypto_toolbox/crypto_toolbox.h"

typedef enum : uint8_t {
  /* Legacy mode */
#define SMP_MODEL_ENCRYPTION_ONLY 0 /* Just Works model */
#define SMP_MODEL_PASSKEY 1         /* Passkey Entry model, input the key */
#define SMP_MODEL_OOB 2             /* OOB model */
#define SMP_MODEL_KEY_NOTIF 3       /* Passkey Entry model, display the key */
  SMP_MODEL_ENCRYPTION_ONLY = 0, /* Just Works model */
  SMP_MODEL_PASSKEY = 1,         /* Passkey Entry model, input the key */
  SMP_MODEL_OOB = 2,             /* OOB model */
  SMP_MODEL_KEY_NOTIF = 3,       /* Passkey Entry model, display the key */
  /* Secure connections mode */
#define SMP_MODEL_SEC_CONN_JUSTWORKS 4    /* Just Works model */
#define SMP_MODEL_SEC_CONN_NUM_COMP 5     /* Numeric Comparison model */
#define SMP_MODEL_SEC_CONN_PASSKEY_ENT 6  /* Passkey Entry model, */
  SMP_MODEL_SEC_CONN_JUSTWORKS = 4,   /* Just Works model */
  SMP_MODEL_SEC_CONN_NUM_COMP = 5,    /* Numeric Comparison model */
  SMP_MODEL_SEC_CONN_PASSKEY_ENT = 6, /* Passkey Entry model, */
  /* this side inputs the key */
#define SMP_MODEL_SEC_CONN_PASSKEY_DISP 7 /* Passkey Entry model, */
  SMP_MODEL_SEC_CONN_PASSKEY_DISP = 7, /* Passkey Entry model, */
  /* this side displays the key */
#define SMP_MODEL_SEC_CONN_OOB 8 /* Secure Connections mode, OOB model */
#define SMP_MODEL_OUT_OF_RANGE 9
typedef uint8_t tSMP_ASSO_MODEL;
  SMP_MODEL_SEC_CONN_OOB = 8, /* Secure Connections mode, OOB model */
  SMP_MODEL_OUT_OF_RANGE = 9,
} tSMP_ASSO_MODEL;

#ifndef SMP_MAX_CONN
#define SMP_MAX_CONN 2
+3 −3
Original line number Diff line number Diff line
@@ -181,8 +181,8 @@ static const tSMP_CMD_ACT smp_cmd_build_act[] = {
    smp_build_pairing_commitment_cmd             /* 0x0F: pairing commitment */
};

static const uint8_t smp_association_table[2][SMP_IO_CAP_MAX][SMP_IO_CAP_MAX] =
    {
static const tSMP_ASSO_MODEL
    smp_association_table[2][SMP_IO_CAP_MAX][SMP_IO_CAP_MAX] = {
        /* display only */ /* Display Yes/No */ /* keyboard only */
        /* No Input/Output */                   /* keyboard display */

@@ -232,7 +232,7 @@ static const uint8_t smp_association_table[2][SMP_IO_CAP_MAX][SMP_IO_CAP_MAX] =
         {SMP_MODEL_PASSKEY, SMP_MODEL_PASSKEY, SMP_MODEL_KEY_NOTIF,
          SMP_MODEL_ENCRYPTION_ONLY, SMP_MODEL_PASSKEY}}};

static const uint8_t
static const tSMP_ASSO_MODEL
    smp_association_table_sc[2][SMP_IO_CAP_MAX][SMP_IO_CAP_MAX] = {
        /* display only */ /* Display Yes/No */ /* keyboard only */
        /* No InputOutput */                    /* keyboard display */