结构图:

ble之gatt server


对应代码:

typedef struct

{
    uint16_t handle;
    uint8_t uuid_len;
    uint8_t uuid[16];
}desprip_t;








typedef struct
{
    uint16_t handle;
    uint8_t uuid_len;
    uint8_t uuid[16];
}include_t;










typedef struct
{
    uint16_t dhandle;
    uint16_t vhandle;
    uint8_t property;
    uint8_t uuid_len;
    uint8_t uuid[16];


    uint8_t nod;
    desprip_t * d;
}charact_t;








typedef struct
{
    uint16_t start;//服务定义中第一个Attribute的Handle
    uint16_t end;//服务定义中最后一个Attribute的Handle
    uint8_t uuid_len;
    uint8_t uuid[16];


    uint8_t noi;
    include_t * i;


    uint8_t noc;
    charact_t * c;
}service_t;










typedef struct
{
    uint8_t nos;//服务的数量
    service_t * s;
}server_t;



server_t server;




相关文章:

  • 2022-12-23
  • 2021-08-19
  • 2021-07-25
  • 2021-06-21
  • 2021-08-26
  • 2022-12-23
  • 2021-07-15
  • 2022-12-23
猜你喜欢
  • 2022-01-22
  • 2021-11-28
  • 2021-10-25
  • 2021-06-22
  • 2022-01-08
  • 2021-12-04
相关资源
相似解决方案