1*e001955aSMatthias Ringwald /* 2*e001955aSMatthias Ringwald * Copyright (C) 2023 BlueKitchen GmbH 3*e001955aSMatthias Ringwald * 4*e001955aSMatthias Ringwald * Redistribution and use in source and binary forms, with or without 5*e001955aSMatthias Ringwald * modification, are permitted provided that the following conditions 6*e001955aSMatthias Ringwald * are met: 7*e001955aSMatthias Ringwald * 8*e001955aSMatthias Ringwald * 1. Redistributions of source code must retain the above copyright 9*e001955aSMatthias Ringwald * notice, this list of conditions and the following disclaimer. 10*e001955aSMatthias Ringwald * 2. Redistributions in binary form must reproduce the above copyright 11*e001955aSMatthias Ringwald * notice, this list of conditions and the following disclaimer in the 12*e001955aSMatthias Ringwald * documentation and/or other materials provided with the distribution. 13*e001955aSMatthias Ringwald * 3. Neither the name of the copyright holders nor the names of 14*e001955aSMatthias Ringwald * contributors may be used to endorse or promote products derived 15*e001955aSMatthias Ringwald * from this software without specific prior written permission. 16*e001955aSMatthias Ringwald * 4. Any redistribution, use, or modification is done solely for 17*e001955aSMatthias Ringwald * personal benefit and not for any commercial purpose or for 18*e001955aSMatthias Ringwald * monetary gain. 19*e001955aSMatthias Ringwald * 20*e001955aSMatthias Ringwald * THIS SOFTWARE IS PROVIDED BY BLUEKITCHEN GMBH AND CONTRIBUTORS 21*e001955aSMatthias Ringwald * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22*e001955aSMatthias Ringwald * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 23*e001955aSMatthias Ringwald * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BLUEKITCHEN 24*e001955aSMatthias Ringwald * GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 25*e001955aSMatthias Ringwald * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 26*e001955aSMatthias Ringwald * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 27*e001955aSMatthias Ringwald * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 28*e001955aSMatthias Ringwald * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 29*e001955aSMatthias Ringwald * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 30*e001955aSMatthias Ringwald * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 31*e001955aSMatthias Ringwald * SUCH DAMAGE. 32*e001955aSMatthias Ringwald * 33*e001955aSMatthias Ringwald * Please inquire about commercial licensing options at 34*e001955aSMatthias Ringwald * [email protected] 35*e001955aSMatthias Ringwald * 36*e001955aSMatthias Ringwald */ 37*e001955aSMatthias Ringwald 38*e001955aSMatthias Ringwald #ifndef OBEX_SRM_H 39*e001955aSMatthias Ringwald #define OBEX_SRM_H 40*e001955aSMatthias Ringwald 41*e001955aSMatthias Ringwald #include <stdint.h> 42*e001955aSMatthias Ringwald 43*e001955aSMatthias Ringwald #if defined __cplusplus 44*e001955aSMatthias Ringwald extern "C" { 45*e001955aSMatthias Ringwald #endif 46*e001955aSMatthias Ringwald 47*e001955aSMatthias Ringwald typedef enum { 48*e001955aSMatthias Ringwald OBEX_SRM_STATE_DISABLED, 49*e001955aSMatthias Ringwald OBEX_SRM_STATE_SEND_CONFIRM, 50*e001955aSMatthias Ringwald OBEX_SRM_STATE_SEND_CONFIRM_WAIT, 51*e001955aSMatthias Ringwald OBEX_SRM_STATE_ENABLED, 52*e001955aSMatthias Ringwald OBEX_SRM_STATE_ENABLED_WAIT, 53*e001955aSMatthias Ringwald } obex_srm_state_t; 54*e001955aSMatthias Ringwald 55*e001955aSMatthias Ringwald typedef struct { 56*e001955aSMatthias Ringwald obex_srm_state_t srm_state; 57*e001955aSMatthias Ringwald 58*e001955aSMatthias Ringwald uint8_t srm_value; 59*e001955aSMatthias Ringwald uint8_t srmp_value; 60*e001955aSMatthias Ringwald } obex_srm_t; 61*e001955aSMatthias Ringwald 62*e001955aSMatthias Ringwald void obex_srm_init (obex_srm_t *obex_srm); 63*e001955aSMatthias Ringwald void obex_srm_header_store (obex_srm_t *obex_srm, 64*e001955aSMatthias Ringwald uint8_t header_id, 65*e001955aSMatthias Ringwald uint16_t total_len, 66*e001955aSMatthias Ringwald uint16_t data_offset, 67*e001955aSMatthias Ringwald const uint8_t *data_buffer, 68*e001955aSMatthias Ringwald uint16_t data_len); 69*e001955aSMatthias Ringwald void obex_srm_add_srm_headers (obex_srm_t *obex_srm, 70*e001955aSMatthias Ringwald uint16_t goep_cid); 71*e001955aSMatthias Ringwald bool obex_srm_is_enabled (obex_srm_t *obex_srm); 72*e001955aSMatthias Ringwald 73*e001955aSMatthias Ringwald #if defined __cplusplus 74*e001955aSMatthias Ringwald } 75*e001955aSMatthias Ringwald #endif 76*e001955aSMatthias Ringwald 77*e001955aSMatthias Ringwald #endif 78