rfcomm.h (2fca4dad957cd7b88f4657ed51e89c12615dda72) rfcomm.h (8f4649e3ba0a9d21085f42b688929492b3ab33b7)
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

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

420 * @brief Query max frame size
421 * @param rfcomm_cid
422 * @return max frame size
423 */
424uint16_t rfcomm_get_max_frame_size(uint16_t rfcomm_cid);
425
426/**
427 * @brief Reserve packet buffer to allow to create RFCOMM packet in place
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

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

420 * @brief Query max frame size
421 * @param rfcomm_cid
422 * @return max frame size
423 */
424uint16_t rfcomm_get_max_frame_size(uint16_t rfcomm_cid);
425
426/**
427 * @brief Reserve packet buffer to allow to create RFCOMM packet in place
428 * @return true on success
428 * @note Must only be called after a 'can send now' check or event
429 * @note Asserts if packet buffer is already reserved
429 *
430 * if (rfcomm_can_send_packet_now(cid)){
431 * rfcomm_reserve_packet_buffer();
432 * uint8_t * buffer = rfcomm_get_outgoing_buffer();
433 * uint16_t buffer_size = rfcomm_get_max_frame_size(cid);
434 * .. setup data in buffer with len ..
435 * rfcomm_send_prepared(cid, len)
436 * }
437 */
430 *
431 * if (rfcomm_can_send_packet_now(cid)){
432 * rfcomm_reserve_packet_buffer();
433 * uint8_t * buffer = rfcomm_get_outgoing_buffer();
434 * uint16_t buffer_size = rfcomm_get_max_frame_size(cid);
435 * .. setup data in buffer with len ..
436 * rfcomm_send_prepared(cid, len)
437 * }
438 */
438bool rfcomm_reserve_packet_buffer(void);
439void rfcomm_reserve_packet_buffer(void);
439
440/**
441 * @brief Get outgoing buffer
442 * @return pointer to outgoing rfcomm buffer
443 */
444uint8_t * rfcomm_get_outgoing_buffer(void);
445
446/**

--- 124 unchanged lines hidden ---
440
441/**
442 * @brief Get outgoing buffer
443 * @return pointer to outgoing rfcomm buffer
444 */
445uint8_t * rfcomm_get_outgoing_buffer(void);
446
447/**

--- 124 unchanged lines hidden ---