gatt_client.h (a94d23eaebfede58bf9fb58975795b387dd511df) | gatt_client.h (cb5b2b64b641b0c9ea8fec53cab92f9c86ecd94e) |
---|---|
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 --- 1013 unchanged lines hidden (view full) --- 1022 * GATT_CLIENT_CHARACTERISTIC_NOTIFICATION_NOT_SUPPORTED if configuring notification, but characteristic has no notification property set 1023 * GATT_CLIENT_CHARACTERISTIC_INDICATION_NOT_SUPPORTED if configuring indication, but characteristic has no indication property set 1024 * ERROR_CODE_UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE if configuration is invalid 1025 * ERROR_CODE_SUCCESS if query is successfully registered 1026 */ 1027uint8_t gatt_client_write_client_characteristic_configuration(btstack_packet_handler_t callback, hci_con_handle_t con_handle, gatt_client_characteristic_t * characteristic, uint16_t configuration); 1028 1029/** | 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 --- 1013 unchanged lines hidden (view full) --- 1022 * GATT_CLIENT_CHARACTERISTIC_NOTIFICATION_NOT_SUPPORTED if configuring notification, but characteristic has no notification property set 1023 * GATT_CLIENT_CHARACTERISTIC_INDICATION_NOT_SUPPORTED if configuring indication, but characteristic has no indication property set 1024 * ERROR_CODE_UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE if configuration is invalid 1025 * ERROR_CODE_SUCCESS if query is successfully registered 1026 */ 1027uint8_t gatt_client_write_client_characteristic_configuration(btstack_packet_handler_t callback, hci_con_handle_t con_handle, gatt_client_characteristic_t * characteristic, uint16_t configuration); 1028 1029/** |
1030 * @brief Writes the client characteristic configuration of the specified characteristic. 1031 * It is used to subscribe for notifications or indications of the characteristic value. 1032 * For notifications or indications specify: GATT_CLIENT_CHARACTERISTICS_CONFIGURATION_NOTIFICATION 1033 * resp. GATT_CLIENT_CHARACTERISTICS_CONFIGURATION_INDICATION as configuration value. 1034 * The GATT_EVENT_QUERY_COMPLETE event marks the end of write. 1035 * The write is successfully performed if the event's att_status field is set to ATT_ERROR_SUCCESS (see bluetooth.h for ATT_ERROR codes). 1036 * @param callback 1037 * @param con_handle 1038 * @param characteristic 1039 * @param configuration GATT_CLIENT_CHARACTERISTICS_CONFIGURATION_NOTIFICATION, GATT_CLIENT_CHARACTERISTICS_CONFIGURATION_INDICATION 1040 * @param service_id - context provided to callback in events 1041 * @param connection_id - contest provided to callback in events 1042 * @return status ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if no HCI connection for con_handle is found 1043 * BTSTACK_MEMORY_ALLOC_FAILED if no GATT client for con_handle could be allocated 1044 * GATT_CLIENT_IN_WRONG_STATE if GATT client is not ready 1045 * GATT_CLIENT_CHARACTERISTIC_NOTIFICATION_NOT_SUPPORTED if configuring notification, but characteristic has no notification property set 1046 * GATT_CLIENT_CHARACTERISTIC_INDICATION_NOT_SUPPORTED if configuring indication, but characteristic has no indication property set 1047 * ERROR_CODE_UNSUPPORTED_FEATURE_OR_PARAMETER_VALUE if configuration is invalid 1048 * ERROR_CODE_SUCCESS if query is successfully registered 1049 */ 1050uint8_t gatt_client_write_client_characteristic_configuration_with_context(btstack_packet_handler_t callback, hci_con_handle_t con_handle, 1051 gatt_client_characteristic_t * characteristic, uint16_t configuration, uint16_t service_id, uint16_t connection_id); 1052 1053/** |
|
1030 * @brief Register for changes to the Service Changed and Database Hash Characteristics of the remote GATT Service 1031 * * 1032 * When configured, GATT_EVENT_QUERY_COMPLETE event is emitted 1033 * If supported, the Database Hash is read as well 1034 * 1035 * Requires ENABLE_GATT_CLIENT_SERVICE_CHANGED 1036 * 1037 * @param callback --- 114 unchanged lines hidden --- | 1054 * @brief Register for changes to the Service Changed and Database Hash Characteristics of the remote GATT Service 1055 * * 1056 * When configured, GATT_EVENT_QUERY_COMPLETE event is emitted 1057 * If supported, the Database Hash is read as well 1058 * 1059 * Requires ENABLE_GATT_CLIENT_SERVICE_CHANGED 1060 * 1061 * @param callback --- 114 unchanged lines hidden --- |