1 /* ****************************************************************
3 * Copyright 2015 Intel Corporation All Rights Reserved.
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 ******************************************************************/
19 #ifndef CA_BLE_LINUX_ADVERTISEMENT_H
20 #define CA_BLE_LINUX_ADVERTISEMENT_H
22 #include "bluez-glue.h"
28 * Information needed for registering an LE advertisement with BlueZ.
30 typedef struct CALEAdvertisement
32 /// OIC LE advertisement D-Bus interface skeleton object.
33 LEAdvertisement1 * advertisement;
36 * Proxies to the BlueZ D-Bus objects that implement the
37 * "org.bluez.LEAdvertisingManager1" interface with which the @c
38 * advertisement is registered.
45 * Initialize LE advertisement fields.
47 * This function initializes the @c CALEAdvertisement object fields.
49 * @param[out] a LE advertisement information to be
51 * @param[in] connection D-Bus connection to the bus on which the
52 * advertisement will be exported.
53 * @param[in] managers List of @c org.bluez.LEAdvertisingManager1
56 * @return @c true on success, @c false otherwise.
58 * @note This function does not allocate the @a adv object itself.
59 * The caller is responsible for allocating that memory.
61 bool CALEAdvertisementInitialize(CALEAdvertisement * a,
62 GDBusConnection * connection,
66 * Destroy LE advertisement fields.
68 * This function finalizes the @c CALEAdvertisement object fields.
70 * @param[in] adv LE advertisement information to be finalized.
72 * @note This function does not deallocate the @a adv object itself.
73 * The caller is responsible for deallocating that memory.
75 void CALEAdvertisementDestroy(CALEAdvertisement * adv);
78 #endif // CA_BLE_LINUX_ADVERTISEMENT_H