btstack_slip.c (4ea43905e81e6bfa244dfdbd768b1d4e9664a403) btstack_slip.c (a8d51f092f1b660d0f6921369ad2bc3f9368296c)
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

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

210 case 0xdb:
211 decoder_state = SLIP_DECODER_X_DB;
212 break;
213 default:
214 btstack_slip_decoder_store_byte(input);
215 break;
216 }
217 break;
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

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

210 case 0xdb:
211 decoder_state = SLIP_DECODER_X_DB;
212 break;
213 default:
214 btstack_slip_decoder_store_byte(input);
215 break;
216 }
217 break;
218 default:
219 btstack_assert(false);
220 break;
218 }
219}
220
221/**
222 * @brief Get size of decoded frame
223 * @return size of frame. Size = 0 => frame not complete
224 */
225
226uint16_t btstack_slip_decoder_frame_size(void){
227 switch (decoder_state){
228 case SLIP_DECODER_COMPLETE:
229 return decoder_pos;
230 default:
231 return 0;
232 }
233}
221 }
222}
223
224/**
225 * @brief Get size of decoded frame
226 * @return size of frame. Size = 0 => frame not complete
227 */
228
229uint16_t btstack_slip_decoder_frame_size(void){
230 switch (decoder_state){
231 case SLIP_DECODER_COMPLETE:
232 return decoder_pos;
233 default:
234 return 0;
235 }
236}