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 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 3. Neither the name of the copyright holders nor the names of 14 * contributors may be used to endorse or promote products derived 15 * from this software without specific prior written permission. 16 * 4. Any redistribution, use, or modification is done solely for 17 * personal benefit and not for any commercial purpose or for 18 * monetary gain. 19 * 20 * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS 21 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MATTHIAS 24 * RINGWALD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 26 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 27 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 28 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 29 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 30 * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31 * SUCH DAMAGE. 32 * 33 * Please inquire about commercial licensing options at 34 * [email protected] 35 * 36 */ 37 #ifndef DEVICE_INFORMATION_SERVICE_SERVER_H 38 #define DEVICE_INFORMATION_SERVICE_SERVER_H 39 40 #include <stdint.h> 41 42 #if defined __cplusplus 43 extern "C" { 44 #endif 45 46 /* API_START */ 47 48 /** 49 * Implementation of the Device Information Service Server 50 * 51 * To use with your application, add '#import <device_information_sevice.gatt' to your .gatt file 52 * and call all functions below. All strings and blobs need to stay valid after calling the functions. 53 * 54 * @note: instead of calling all setters, you can create a local copy of the .gatt file and remove 55 * all Characteristics that are not relevant for your application and define all fixed values in the .gatt file 56 */ 57 58 /** 59 * @brief Init Device Information Service Server with ATT DB 60 * @param battery_value in range 0-100 61 */ 62 void device_information_service_server_init(void); 63 64 /** 65 * @brief Set Manufacturer Name 66 * @param manufacturer_name 67 */ 68 void device_information_service_server_set_manufacturer_name(const char * manufacturer_name); 69 70 /** 71 * @brief Set Model Number 72 * @param model_number 73 */ 74 void device_information_service_server_set_model_number(const char * model_number); 75 76 /** 77 * @brief Set Serial Number 78 * @param serial_number 79 */ 80 void device_information_service_server_set_serial_number(const char * serial_number); 81 82 /** 83 * @brief Set Hardware Revision 84 * @param hardware_revision 85 */ 86 void device_information_service_server_set_hardware_revision(const char * hardware_revision); 87 88 /** 89 * @brief Set Firmware Revision 90 * @param firmware_revision 91 */ 92 void device_information_service_server_set_firmware_revision(const char * firmware_revision); 93 94 /** 95 * @brief Set Software Revision 96 * @param software_revision 97 */ 98 void device_information_service_server_set_software_revision(const char * software_revision); 99 100 /** 101 * @brief Set System ID 102 * @param manufacturer_identifier uint40 103 * @param organizationally_unique_identifier uint24 104 */ 105 void device_information_service_server_set_system_id(uint64_t manufacturer_identifier, uint32_t organizationally_unique_identifier); 106 107 /** 108 * @brief Set IEEE 11073-20601 regulatory certification data list 109 * @note: format duint16. duint16 is two uint16 values concatenated together. 110 * @param value_a 111 * @param value_b 112 */ 113 void device_information_service_server_set_ieee_regulatory_certification(uint16_t value_a, uint16_t value_b); 114 115 /** 116 * @brief Set PnP ID 117 * @param vendor_source_id 118 * @param vendor_id 119 * @param product_id 120 * @Param product_versoin 121 */ 122 void device_information_service_server_set_pnp_id(uint8_t vendor_source_id, uint16_t vendor_id, uint16_t product_id, uint16_t product_version); 123 124 /* API_END */ 125 126 #if defined __cplusplus 127 } 128 #endif 129 130 #endif 131 132