more debugging around ble
This commit is contained in:
parent
8275050dee
commit
bcb877887e
1 changed files with 5 additions and 3 deletions
|
@ -138,8 +138,7 @@ static const struct ble_gatt_svc_def service_defs[] = {
|
||||||
{ 0 } // no more services
|
{ 0 } // no more services
|
||||||
};
|
};
|
||||||
|
|
||||||
static int gatt_svr_chr_write(struct os_mbuf *om, uint16_t min_len, uint16_t max_len,
|
static int gatt_svr_chr_write(struct os_mbuf *om, uint16_t min_len, uint16_t max_len, void *dst, uint16_t *len) {
|
||||||
void *dst, uint16_t *len) {
|
|
||||||
uint16_t om_len;
|
uint16_t om_len;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
|
@ -159,6 +158,7 @@ static int gatt_svr_chr_write(struct os_mbuf *om, uint16_t min_len, uint16_t max
|
||||||
static int svc_access_system(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg) {
|
static int svc_access_system(uint16_t conn_handle, uint16_t attr_handle, struct ble_gatt_access_ctxt *ctxt, void *arg) {
|
||||||
uint16_t uuid16 = ble_uuid_u16(ctxt->chr->uuid);
|
uint16_t uuid16 = ble_uuid_u16(ctxt->chr->uuid);
|
||||||
uint8_t value = 0;
|
uint8_t value = 0;
|
||||||
|
uint16_t vlen = 0;
|
||||||
|
|
||||||
ESP_LOGI(TAG, "0x%02X access: %d", uuid16, ctxt->op);
|
ESP_LOGI(TAG, "0x%02X access: %d", uuid16, ctxt->op);
|
||||||
|
|
||||||
|
@ -168,9 +168,11 @@ static int svc_access_system(uint16_t conn_handle, uint16_t attr_handle, struct
|
||||||
ctxt->om,
|
ctxt->om,
|
||||||
sizeof value,
|
sizeof value,
|
||||||
sizeof value,
|
sizeof value,
|
||||||
&value, NULL
|
&value, &vlen
|
||||||
);
|
);
|
||||||
|
|
||||||
|
ESP_LOGI(TAG, "value (%d): %d", vlen, value);
|
||||||
|
|
||||||
switch(uuid16) {
|
switch(uuid16) {
|
||||||
case BAROS_CHAR_POUR:
|
case BAROS_CHAR_POUR:
|
||||||
if(value == 1) {
|
if(value == 1) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue