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 BLUEKITCHEN 24 * GMBH 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 38 /** 39 * @title Device Information Service Server 40 * 41 */ 42 43 #ifndef DEVICE_INFORMATION_SERVICE_SERVER_H 44 #define DEVICE_INFORMATION_SERVICE_SERVER_H 45 46 #include <stdint.h> 47 48 #if defined __cplusplus 49 extern "C" { 50 #endif 51 52 /* API_START */ 53 54 /** 55 * @text Th eDevice Information Service allows to query manufacturer and/or 56 * vendor information about a device. 57 * 58 * To use with your application, add `#import <device_information_service.gatt>` to your .gatt file. 59 * 60 * *Note*: instead of calling all setters, you can create a local copy of the .gatt file and remove 61 * all Characteristics that are not relevant for your application and define all fixed values in the .gatt file. 62 */ 63 64 /** 65 * @brief Init Device Information Service Server with ATT DB 66 * @param battery_value in range 0-100 67 */ 68 void device_information_service_server_init(void); 69 70 /** 71 * @brief Set Manufacturer Name 72 * @param manufacturer_name 73 */ 74 void device_information_service_server_set_manufacturer_name(const char * manufacturer_name); 75 76 /** 77 * @brief Set Model Number 78 * @param model_number 79 */ 80 void device_information_service_server_set_model_number(const char * model_number); 81 82 /** 83 * @brief Set Serial Number 84 * @param serial_number 85 */ 86 void device_information_service_server_set_serial_number(const char * serial_number); 87 88 /** 89 * @brief Set Hardware Revision 90 * @param hardware_revision 91 */ 92 void device_information_service_server_set_hardware_revision(const char * hardware_revision); 93 94 /** 95 * @brief Set Firmware Revision 96 * @param firmware_revision 97 */ 98 void device_information_service_server_set_firmware_revision(const char * firmware_revision); 99 100 /** 101 * @brief Set Software Revision 102 * @param software_revision 103 */ 104 void device_information_service_server_set_software_revision(const char * software_revision); 105 106 /** 107 * @brief Set System ID 108 * @param manufacturer_identifier uint40 109 * @param organizationally_unique_identifier uint24 110 */ 111 void device_information_service_server_set_system_id(uint64_t manufacturer_identifier, uint32_t organizationally_unique_identifier); 112 113 /** 114 * @brief Set IEEE 11073-20601 regulatory certification data list 115 * @note: format duint16. duint16 is two uint16 values concatenated together. 116 * @param value_a 117 * @param value_b 118 */ 119 void device_information_service_server_set_ieee_regulatory_certification(uint16_t value_a, uint16_t value_b); 120 121 /** 122 * @brief Set PnP ID 123 * @param vendor_source_id 124 * @param vendor_id 125 * @param product_id 126 * @param product_version 127 */ 128 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); 129 130 /** 131 * @brief Set UDI for medical devices 132 * @param label 133 * @param device_id 134 * @param issuer 135 * @param authority 136 */ 137 void device_information_service_server_set_udi_for_medical_devices(const char * label, const char * device_id, const char * issuer, const char * authority); 138 139 /* API_END */ 140 141 #if defined __cplusplus 142 } 143 #endif 144 145 #endif 146 147