Microchip® Advanced Software Framework

att_dispatch.c File Reference
#include "att_dispatch.h"
#include "ble/core.h"
#include "btstack_debug.h"
#include "l2cap.h"

Macros

#define __BTSTACK_FILE__   "att_dispatch.c"
 

Functions

int att_dispatch_client_can_send_now (hci_con_handle_t con_handle)
 can send packet for client More...
 
void att_dispatch_client_request_can_send_now_event (hci_con_handle_t con_handle)
 Request emission of L2CAP_EVENT_CAN_SEND_NOW as soon as possible for client. More...
 
void att_dispatch_register_client (btstack_packet_handler_t packet_handler)
 reset att dispatchter More...
 
void att_dispatch_register_server (btstack_packet_handler_t packet_handler)
 reset att dispatchter More...
 
int att_dispatch_server_can_send_now (hci_con_handle_t con_handle)
 can send packet for server More...
 
void att_dispatch_server_request_can_send_now_event (hci_con_handle_t con_handle)
 Request emission of L2CAP_EVENT_CAN_SEND_NOW as soon as possible for server. More...
 
static void att_packet_handler (uint8_t packet_type, uint16_t handle, uint8_t *packet, uint16_t size)
 

Variables

static btstack_packet_handler_t att_client_handler
 Dispatcher for independent implementation of ATT client and server. More...
 
static uint8_t att_client_waiting_for_can_send
 
static btstack_packet_handler_t att_server_handler
 
static uint8_t att_server_waiting_for_can_send
 

#define __BTSTACK_FILE__   "att_dispatch.c"

int att_dispatch_client_can_send_now ( hci_con_handle_t  con_handle)
void att_dispatch_client_request_can_send_now_event ( hci_con_handle_t  con_handle)

Request emission of L2CAP_EVENT_CAN_SEND_NOW as soon as possible for client.

Note
L2CAP_EVENT_CAN_SEND_NOW might be emitted during call to this function so packet handler should be ready to handle it
Parameters
con_handle

References att_client_waiting_for_can_send, L2CAP_CID_ATTRIBUTE_PROTOCOL, and l2cap_request_can_send_fix_channel_now_event().

Referenced by gatt_client_run().

void att_dispatch_register_client ( btstack_packet_handler_t  packet_handler)

reset att dispatchter

Dispatcher for independent implementation of ATT client and server.

Parameters
packet_handerfor ATT client packets

References att_client_handler, att_packet_handler(), L2CAP_CID_ATTRIBUTE_PROTOCOL, l2cap_register_fixed_channel(), and packet_handler.

Referenced by gatt_client_init().

void att_dispatch_register_server ( btstack_packet_handler_t  packet_handler)

reset att dispatchter

Parameters
packet_handerfor ATT server packets

References att_packet_handler(), att_server_handler, L2CAP_CID_ATTRIBUTE_PROTOCOL, l2cap_register_fixed_channel(), and packet_handler.

Referenced by att_server_init().

void att_dispatch_server_request_can_send_now_event ( hci_con_handle_t  con_handle)

Request emission of L2CAP_EVENT_CAN_SEND_NOW as soon as possible for server.

Note
L2CAP_EVENT_CAN_SEND_NOW might be emitted during call to this function so packet handler should be ready to handle it
Parameters
con_handle

References att_server_waiting_for_can_send, L2CAP_CID_ATTRIBUTE_PROTOCOL, and l2cap_request_can_send_fix_channel_now_event().

Referenced by att_event_packet_handler(), att_run_for_context(), att_server_handle_can_send_now(), att_server_register_can_send_now_callback(), and att_server_request_can_send_now_event().

static void att_packet_handler ( uint8_t  packet_type,
uint16_t  handle,
uint8_t *  packet,
uint16_t  size 
)
static

btstack_packet_handler_t att_client_handler
static

Dispatcher for independent implementation of ATT client and server.

Referenced by att_dispatch_register_client(), and att_packet_handler().

uint8_t att_client_waiting_for_can_send
static
btstack_packet_handler_t att_server_handler
static
uint8_t att_server_waiting_for_can_send
static