provisioning_device.c (1483c79213b711735793fd9abece42645cc59e40) provisioning_device.c (30a044b0956c3be1f387e2fa8623a84a01cef70d)
1/*
2 * Copyright (C) 2017 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

--- 136 unchanged lines hidden (view full) ---

145 DEVICE_SEND_RANDOM,
146 DEVICE_W4_DATA,
147 DEVICE_SEND_COMPLETE,
148 DEVICE_SEND_ERROR,
149} device_state_t;
150
151static device_state_t device_state;
152static uint16_t pb_transport_cid;
1/*
2 * Copyright (C) 2017 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

--- 136 unchanged lines hidden (view full) ---

145 DEVICE_SEND_RANDOM,
146 DEVICE_W4_DATA,
147 DEVICE_SEND_COMPLETE,
148 DEVICE_SEND_ERROR,
149} device_state_t;
150
151static device_state_t device_state;
152static uint16_t pb_transport_cid;
153static pb_type_t pb_type;
153static mesh_pb_type_t pb_type;
154
155static void pb_send_pdu(uint16_t transport_cid, const uint8_t * buffer, uint16_t buffer_size){
156 switch (pb_type){
157#ifdef ENABLE_MESH_ADV_BEARER
154
155static void pb_send_pdu(uint16_t transport_cid, const uint8_t * buffer, uint16_t buffer_size){
156 switch (pb_type){
157#ifdef ENABLE_MESH_ADV_BEARER
158 case PB_TYPE_ADV:
158 case MESH_PB_TYPE_ADV:
159 pb_adv_send_pdu(transport_cid, buffer, buffer_size);
160 break;
161#endif
162#ifdef ENABLE_MESH_GATT_BEARER
159 pb_adv_send_pdu(transport_cid, buffer, buffer_size);
160 break;
161#endif
162#ifdef ENABLE_MESH_GATT_BEARER
163 case PB_TYPE_GATT:
163 case MESH_PB_TYPE_GATT:
164 pb_gatt_send_pdu(transport_cid, buffer, buffer_size);
165 break;
166#endif
167 default:
168 break;
169 }
170}
171
172static void pb_close_link(uint16_t transport_cid, uint8_t reason){
173 switch (pb_type){
174#ifdef ENABLE_MESH_ADV_BEARER
164 pb_gatt_send_pdu(transport_cid, buffer, buffer_size);
165 break;
166#endif
167 default:
168 break;
169 }
170}
171
172static void pb_close_link(uint16_t transport_cid, uint8_t reason){
173 switch (pb_type){
174#ifdef ENABLE_MESH_ADV_BEARER
175 case PB_TYPE_ADV:
175 case MESH_PB_TYPE_ADV:
176 pb_adv_close_link(transport_cid, reason);
177 break;
178#endif
179#ifdef ENABLE_MESH_GATT_BEARER
176 pb_adv_close_link(transport_cid, reason);
177 break;
178#endif
179#ifdef ENABLE_MESH_GATT_BEARER
180 case PB_TYPE_GATT:
180 case MESH_PB_TYPE_GATT:
181 pb_gatt_close_link(transport_cid, reason);
182 break;
183#endif
184 default:
185 break;
186 }
187}
188

--- 725 unchanged lines hidden ---
181 pb_gatt_close_link(transport_cid, reason);
182 break;
183#endif
184 default:
185 break;
186 }
187}
188

--- 725 unchanged lines hidden ---