xref: /btstack/src/ble/gatt-service/device_information_service_server.h (revision afb581af3f1e8a5a283380efb7aacd4e0c8fe274)
1a4355820SMatthias Ringwald /*
2a4355820SMatthias Ringwald  * Copyright (C) 2014 BlueKitchen GmbH
3a4355820SMatthias Ringwald  *
4a4355820SMatthias Ringwald  * Redistribution and use in source and binary forms, with or without
5a4355820SMatthias Ringwald  * modification, are permitted provided that the following conditions
6a4355820SMatthias Ringwald  * are met:
7a4355820SMatthias Ringwald  *
8a4355820SMatthias Ringwald  * 1. Redistributions of source code must retain the above copyright
9a4355820SMatthias Ringwald  *    notice, this list of conditions and the following disclaimer.
10a4355820SMatthias Ringwald  * 2. Redistributions in binary form must reproduce the above copyright
11a4355820SMatthias Ringwald  *    notice, this list of conditions and the following disclaimer in the
12a4355820SMatthias Ringwald  *    documentation and/or other materials provided with the distribution.
13a4355820SMatthias Ringwald  * 3. Neither the name of the copyright holders nor the names of
14a4355820SMatthias Ringwald  *    contributors may be used to endorse or promote products derived
15a4355820SMatthias Ringwald  *    from this software without specific prior written permission.
16a4355820SMatthias Ringwald  * 4. Any redistribution, use, or modification is done solely for
17a4355820SMatthias Ringwald  *    personal benefit and not for any commercial purpose or for
18a4355820SMatthias Ringwald  *    monetary gain.
19a4355820SMatthias Ringwald  *
20a4355820SMatthias Ringwald  * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS
21a4355820SMatthias Ringwald  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22a4355820SMatthias Ringwald  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
232fca4dadSMilanka Ringwald  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BLUEKITCHEN
242fca4dadSMilanka Ringwald  * GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25a4355820SMatthias Ringwald  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
26a4355820SMatthias Ringwald  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
27a4355820SMatthias Ringwald  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
28a4355820SMatthias Ringwald  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29a4355820SMatthias Ringwald  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
30a4355820SMatthias Ringwald  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31a4355820SMatthias Ringwald  * SUCH DAMAGE.
32a4355820SMatthias Ringwald  *
33a4355820SMatthias Ringwald  * Please inquire about commercial licensing options at
34a4355820SMatthias Ringwald  * [email protected]
35a4355820SMatthias Ringwald  *
36a4355820SMatthias Ringwald  */
37fe5a6c4eSMilanka Ringwald 
38fe5a6c4eSMilanka Ringwald /**
39fe5a6c4eSMilanka Ringwald  * @title Device Information Service Server
40fe5a6c4eSMilanka Ringwald  *
41fe5a6c4eSMilanka Ringwald  */
42fe5a6c4eSMilanka Ringwald 
4380e33422SMatthias Ringwald #ifndef DEVICE_INFORMATION_SERVICE_SERVER_H
4480e33422SMatthias Ringwald #define DEVICE_INFORMATION_SERVICE_SERVER_H
45a4355820SMatthias Ringwald 
46a4355820SMatthias Ringwald #include <stdint.h>
47a4355820SMatthias Ringwald 
48a4355820SMatthias Ringwald #if defined __cplusplus
49a4355820SMatthias Ringwald extern "C" {
50a4355820SMatthias Ringwald #endif
51a4355820SMatthias Ringwald 
52a4355820SMatthias Ringwald /* API_START */
53a4355820SMatthias Ringwald 
54a4355820SMatthias Ringwald /**
551ea30d1bSMilanka Ringwald  * @text Th eDevice Information Service allows to query manufacturer and/or
561ea30d1bSMilanka Ringwald  * vendor information about a device.
57a4355820SMatthias Ringwald  *
581ea30d1bSMilanka Ringwald  * To use with your application, add `#import <device_information_service.gatt>` to your .gatt file.
59a4355820SMatthias Ringwald  *
601ea30d1bSMilanka Ringwald  * *Note*: instead of calling all setters, you can create a local copy of the .gatt file and remove
611ea30d1bSMilanka Ringwald  * all Characteristics that are not relevant for your application and define all fixed values in the .gatt file.
62a4355820SMatthias Ringwald  */
63a4355820SMatthias Ringwald 
64a4355820SMatthias Ringwald /**
65a4355820SMatthias Ringwald  * @brief Init Device Information Service Server with ATT DB
66a4355820SMatthias Ringwald  * @param battery_value in range 0-100
67a4355820SMatthias Ringwald  */
68a4355820SMatthias Ringwald void device_information_service_server_init(void);
69a4355820SMatthias Ringwald 
70a4355820SMatthias Ringwald /**
71a4355820SMatthias Ringwald  * @brief Set Manufacturer Name
72a4355820SMatthias Ringwald  * @param manufacturer_name
73a4355820SMatthias Ringwald  */
74a4355820SMatthias Ringwald void device_information_service_server_set_manufacturer_name(const char * manufacturer_name);
75a4355820SMatthias Ringwald 
76a4355820SMatthias Ringwald /**
77a4355820SMatthias Ringwald  * @brief Set Model Number
78a4355820SMatthias Ringwald  * @param model_number
79a4355820SMatthias Ringwald  */
80a4355820SMatthias Ringwald void device_information_service_server_set_model_number(const char * model_number);
81a4355820SMatthias Ringwald 
82a4355820SMatthias Ringwald /**
83a4355820SMatthias Ringwald  * @brief Set Serial Number
84a4355820SMatthias Ringwald  * @param serial_number
85a4355820SMatthias Ringwald  */
86a4355820SMatthias Ringwald void device_information_service_server_set_serial_number(const char * serial_number);
87a4355820SMatthias Ringwald 
88a4355820SMatthias Ringwald /**
89a4355820SMatthias Ringwald  * @brief Set Hardware Revision
90a4355820SMatthias Ringwald  * @param hardware_revision
91a4355820SMatthias Ringwald  */
92a4355820SMatthias Ringwald void device_information_service_server_set_hardware_revision(const char * hardware_revision);
93a4355820SMatthias Ringwald 
94a4355820SMatthias Ringwald /**
95a4355820SMatthias Ringwald  * @brief Set Firmware Revision
96a4355820SMatthias Ringwald  * @param firmware_revision
97a4355820SMatthias Ringwald  */
98a4355820SMatthias Ringwald void device_information_service_server_set_firmware_revision(const char * firmware_revision);
99a4355820SMatthias Ringwald 
100a4355820SMatthias Ringwald /**
101a4355820SMatthias Ringwald  * @brief Set Software Revision
102a4355820SMatthias Ringwald  * @param software_revision
103a4355820SMatthias Ringwald  */
104a4355820SMatthias Ringwald void device_information_service_server_set_software_revision(const char * software_revision);
105a4355820SMatthias Ringwald 
106a4355820SMatthias Ringwald /**
107a4355820SMatthias Ringwald  * @brief Set System ID
108a4355820SMatthias Ringwald  * @param manufacturer_identifier uint40
109a4355820SMatthias Ringwald  * @param organizationally_unique_identifier uint24
110a4355820SMatthias Ringwald  */
111a4355820SMatthias Ringwald void device_information_service_server_set_system_id(uint64_t manufacturer_identifier, uint32_t organizationally_unique_identifier);
112a4355820SMatthias Ringwald 
113a4355820SMatthias Ringwald /**
114a4355820SMatthias Ringwald  * @brief Set IEEE 11073-20601 regulatory certification data list
115a4355820SMatthias Ringwald  * @note: format duint16. duint16 is two uint16 values concatenated together.
116a4355820SMatthias Ringwald  * @param value_a
117a4355820SMatthias Ringwald  * @param value_b
118a4355820SMatthias Ringwald  */
119a4355820SMatthias Ringwald void device_information_service_server_set_ieee_regulatory_certification(uint16_t value_a, uint16_t value_b);
120a4355820SMatthias Ringwald 
121a4355820SMatthias Ringwald /**
1223721458bSMatthias Ringwald  * @brief Set PnP ID
123a4355820SMatthias Ringwald  * @param vendor_source_id
124a4355820SMatthias Ringwald  * @param vendor_id
125a4355820SMatthias Ringwald  * @param product_id
126*afb581afSMatthias Ringwald  * @param product_version
127a4355820SMatthias Ringwald  */
128a4355820SMatthias Ringwald 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);
129a4355820SMatthias Ringwald 
130*afb581afSMatthias Ringwald /**
131*afb581afSMatthias Ringwald  * @brief Set UDI for medical devices
132*afb581afSMatthias Ringwald  * @param label
133*afb581afSMatthias Ringwald  * @param device_id
134*afb581afSMatthias Ringwald  * @param issuer
135*afb581afSMatthias Ringwald  * @param authority
136*afb581afSMatthias Ringwald  */
137*afb581afSMatthias Ringwald void device_information_service_server_set_udi_for_medical_devices(const char * label, const char * device_id, const char * issuer, const char * authority);
138*afb581afSMatthias Ringwald 
139a4355820SMatthias Ringwald /* API_END */
140a4355820SMatthias Ringwald 
141a4355820SMatthias Ringwald #if defined __cplusplus
142a4355820SMatthias Ringwald }
143a4355820SMatthias Ringwald #endif
144a4355820SMatthias Ringwald 
145a4355820SMatthias Ringwald #endif
146a4355820SMatthias Ringwald 
147