gatt_client.c (25b7c058c69de0897522d15191237c303294cb03) | gatt_client.c (695e959a42777f8a81e84a8d9932f73a91b3e9a4) |
---|---|
1/* 2 * Copyright (C) 2014 BlueKitchen GmbH 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright --- 1856 unchanged lines hidden (view full) --- 1865 peripheral->gatt_client_state = P_W2_SEND_READ_MULTIPLE_REQUEST; 1866 gatt_client_run(); 1867 return ERROR_CODE_SUCCESS; 1868} 1869 1870uint8_t gatt_client_write_value_of_characteristic_without_response(hci_con_handle_t con_handle, uint16_t value_handle, uint16_t value_length, uint8_t * value){ 1871 gatt_client_t * peripheral = provide_context_for_conn_handle(con_handle); 1872 if (peripheral == NULL) return BTSTACK_MEMORY_ALLOC_FAILED; | 1/* 2 * Copyright (C) 2014 BlueKitchen GmbH 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright --- 1856 unchanged lines hidden (view full) --- 1865 peripheral->gatt_client_state = P_W2_SEND_READ_MULTIPLE_REQUEST; 1866 gatt_client_run(); 1867 return ERROR_CODE_SUCCESS; 1868} 1869 1870uint8_t gatt_client_write_value_of_characteristic_without_response(hci_con_handle_t con_handle, uint16_t value_handle, uint16_t value_length, uint8_t * value){ 1871 gatt_client_t * peripheral = provide_context_for_conn_handle(con_handle); 1872 if (peripheral == NULL) return BTSTACK_MEMORY_ALLOC_FAILED; |
1873 if (is_ready(peripheral) == 0) return GATT_CLIENT_IN_WRONG_STATE; | |
1874 1875 if (value_length > peripheral_mtu(peripheral) - 3) return GATT_CLIENT_VALUE_TOO_LONG; 1876 if (!att_dispatch_client_can_send_now(peripheral->con_handle)) return GATT_CLIENT_BUSY; 1877 1878 return att_write_request(ATT_WRITE_COMMAND, peripheral->con_handle, value_handle, value_length, value); 1879} 1880 1881uint8_t gatt_client_write_value_of_characteristic(btstack_packet_handler_t callback, hci_con_handle_t con_handle, uint16_t value_handle, uint16_t value_length, uint8_t * data){ --- 249 unchanged lines hidden --- | 1873 1874 if (value_length > peripheral_mtu(peripheral) - 3) return GATT_CLIENT_VALUE_TOO_LONG; 1875 if (!att_dispatch_client_can_send_now(peripheral->con_handle)) return GATT_CLIENT_BUSY; 1876 1877 return att_write_request(ATT_WRITE_COMMAND, peripheral->con_handle, value_handle, value_length, value); 1878} 1879 1880uint8_t gatt_client_write_value_of_characteristic(btstack_packet_handler_t callback, hci_con_handle_t con_handle, uint16_t value_handle, uint16_t value_length, uint8_t * data){ --- 249 unchanged lines hidden --- |