美文网首页
android smp protocal

android smp protocal

作者: 413x | 来源:发表于2018-09-27 15:07 被阅读0次

smp protocal

smp.png

android smp state machine

data structure

smp has two role initiator and responder, in aosp code correspond to master and slave :( so
there is a table smp_br_entry_table , include master entry map and slave entry map. smp state is
in smp control block.

static const tSMP_BR_ENTRY_TBL smp_br_entry_table[] = {smp_br_master_entry_map,
                                                       smp_br_slave_entry_map};

the two table are similar, we first focus on master; the table are two-dimensional array, in smp_br_state_machine_event use entry_table[event - 1][curr_state], then lets look
smp_br_master_entry_map, event is

static const uint8_t smp_br_master_entry_map[][SMP_BR_STATE_MAX] = {
    /* br_state name:               Idle      WaitApp  Pair    Bond
                                              Rsp      ReqRsp  Pend       */
    /* BR_PAIRING_REQ           */ {0, 0, 0, 0},
    /* BR_PAIRING_RSP           */ {0, 0, 1, 0},
    /* BR_CONFIRM               */ {0, 0, 0, 0},
    /* BR_RAND                  */ {0, 0, 0, 0},
    /* BR_PAIRING_FAILED        */ {0, 0x81, 0x81, 0},
    /* BR_ENCRPTION_INFO        */ {0, 0, 0, 0},
    /* BR_MASTER_ID             */ {0, 0, 0, 0},
    /* BR_ID_INFO               */ {0, 0, 0, 1},
    /* BR_ID_ADDR               */ {0, 0, 0, 2},
    /* BR_SIGN_INFO             */ {0, 0, 0, 3},
    /* BR_SECURITY_REQ          */ {0, 0, 0, 0},
    /* BR_PAIR_PUBLIC_KEY_EVT   */ {0, 0, 0, 0},
    /* BR_PAIR_DHKEY_CHCK_EVT   */ {0, 0, 0, 0},
    /* BR_PAIR_KEYPR_NOTIF_EVT  */ {0, 0, 0, 0},
    /* BR_KEY_READY             */ {0, 0, 0, 0},
    /* BR_ENCRYPTED             */ {0, 0, 0, 0},
    /* BR_L2CAP_CONN            */ {1, 0, 0, 0},
    /* BR_L2CAP_DISCONN         */ {2, 0x83, 0x83, 0x83},
    /* BR_KEYS_RSP              */ {0, 1, 0, 0},
    /* BR_API_SEC_GRANT         */ {0, 0, 0, 0},
    /* BR_TK_REQ                */ {0, 0, 0, 0},
    /* BR_AUTH_CMPL             */ {0, 0x82, 0x82, 0x82},
    /* BR_ENC_REQ               */ {0, 0, 0, 0},
    /* BR_BOND_REQ              */ {0, 0, 2, 0},
    /* BR_DISCARD_SEC_REQ       */ {0, 0, 0, 0}};

static const uint8_t smp_br_all_table[][SMP_BR_SM_NUM_COLS] = {
    /* Event              Action                   Next State */
    /* BR_PAIRING_FAILED */
    {SMP_PROC_PAIR_FAIL, SMP_BR_PAIRING_COMPLETE, SMP_BR_STATE_IDLE},
    /* BR_AUTH_CMPL */
    {SMP_SEND_PAIR_FAIL, SMP_BR_PAIRING_COMPLETE, SMP_BR_STATE_IDLE},
    /* BR_L2CAP_DISCONN */
    {SMP_PAIR_TERMINATE, SMP_BR_SM_NO_ACTION, SMP_BR_STATE_IDLE}};

相关文章

  • android smp protocal

    smp protocal android smp state machine data structure smp...

  • Android 优化——存储优化

    Android 优化目录 交换数据格式 Google 推出的 Protocal Buffers 是一种更轻便高效的...

  • @protocal

    对代理的理解就是代理对象内存的传递和操作,我们在委托类设置代理对象后,实际上只是用一个id类型的指针将代理对象进行...

  • Protocal

    https://www.jianshu.com/p/38d7d83fcedd[https://www.jiansh...

  • Protocol Buffer For Android

    什么是protocal buffer? protocal buffer 以下简称protobuf是google 的...

  • protocal buffer

    protocal buffer 定义(Java) protobuf是一个序列化结构化数据的工具: 语言无关 平台无...

  • BitTorrent Protocal

    Abstract When I was downloading a file using BT, I wonder...

  • net protocal

    ip addr命令出来的日志中 UP表示网卡处于启动状态,BROADCAST表示这个网卡有广播地址,可以发送广播包...

  • X86 Linux的SMP

    SMP是对称多处理器的意思。Intel为SMP特地出台了一个MultiProcessor Specificatio...

  • 一、基础

    1. 计算机关键的硬件 CPU、内存、I/O控制芯片 2. SMP与多核 SMP: Symmetrical Mul...

网友评论

      本文标题:android smp protocal

      本文链接:https://www.haomeiwen.com/subject/gwlanftx.html